Claude Code hook
LSP Enforcement Kit
Hooks that steer Claude Code toward LSP-based navigation instead of grep to save tokens.
Install
git clone https://github.com/nesaminua/claude-code-lsp-enforcement-kit.gitFrom the README
LSP Enforcement Kit Physical enforcement of LSP-first navigation in Claude Code. Stop burning tokens on Grep. Make Claude navigate code like an IDE — 100% of the time. Quick Start • Why • Savings • Architecture • Hooks • Changelog In Action When Claude tries to Grep for a code symbol, the hook blocks with a copy-pasteable LSP command: When Claude tries to Read a code file without warming up LSP, the progressive gate blocks: No generic advice. Every block message is parametrized by the actual file Claude tried to touch. ⚡ Quick Start Restart Claude Code. Done. The installer is idempotent — safe to re-run on upgrades. Verify: 🎯 The Problem Claude Code defaults to Grep + Read for code navigation. This works, but it's wasteful: ~40x fewer tokens. Same answer. A rule in CLAUDE.md saying "use LSP" helps ~60% of the time. Hooks make it 100%. 💰 Token Savings: Grep vs LSP Per Operation 📊 Real-World Data: 1 Week, 2 Projects Aggregate from a week of development across 2 TypeScript projects: How the estimate works: - Each blocked Grep saves ~1200 tokens of noisy output - Each avoided Read saves ~1500 tokens of file content loaded into context - 39 LSP calls cost ~4k tokens total (precise, compact results) - Without LSP: ~120 Greps + ~180 Reads = ~315k tokens for the same navigation work - With LSP: 39 nav calls + 53 targeted Reads = ~84k tokens 🔌 Works with any LSP MCP server v2.1 introduces provider-aware block messages. The kit detects which LSP MCP server(s) you have installed and tailors its suggestions accordingly: - cclsp — standalone MCP server or bundled via the typescript-lsp Claude Code plugin. Suggestions use mcpcclspfind_definition, find_references, find_workspace_symbols, etc. - Serena — high-level…
How hooks work
- Hooks are shell commands Claude Code runs at fixed points: before or after a tool call, when you submit a prompt, when Claude stops, on notifications and at session start.
- They are set in the hooks section of ~/.claude/settings.json (or .claude/settings.json for a project), or come bundled in a plugin.
- A hook can block a tool call, add context, or run a formatter or test. Read the scripts before you install them: they run on your machine with your permissions.
Details
- Repository
- nesaminua/claude-code-lsp-enforcement-kit
- Type
- Hooks
- Website
- madsalt.tech
- Language
- JavaScript
- License
- MIT
- Last updated
- 14 April 2026
- Topics
- claudeclaude-aiclaude-codeclaude-hookclaude-hooks
FAQ
What is LSP Enforcement Kit?
Hooks that steer Claude Code toward LSP-based navigation instead of grep to save tokens. It is a hook for Claude Code, from nesaminua/claude-code-lsp-enforcement-kit on GitHub.
How do I install LSP Enforcement Kit?
Clone nesaminua/claude-code-lsp-enforcement-kit from GitHub and follow the setup steps in its README.
Is LSP Enforcement Kit popular?
nesaminua/claude-code-lsp-enforcement-kit has 328 GitHub stars and 31 forks. It was last updated on 14 April 2026.
More hooks
Abide
621coldteadotai/abide
Make your coding agent abide by all your project rules
Taskmaster
533blader/taskmaster
Stop hook for Claude Code that keeps the agent working until all plans and user requests are 100% complete
nWave
631nWave-ai/nWave
AI agents that guide you from idea to working code, with you in control at every step.
Grip
439guilyx/grip
A git hook that won't let you push code you can't explain. Quizzes you on your own diff. Works with Claude Code, Codex, Cursor.
Lasso Claude Hooks
271lasso-security/claude-hooks
Security hooks from Lasso that scan tool output for prompt-injection attempts.
cchooks
131GowayLee/cchooks
Python SDK that simplifies parsing hook input and returning decisions for Claude Code hooks.
Browse the most popular Claude Code mods, all hooks, or the skills and MCP server directories.