Available in
Marketplaces, most starred first
Tags
Add to README
Shows its components, always-on context cost and install status, kept current. Add ?tokens=0 to hide the cost.
Marketplaces, most starred first
Shows its components, always-on context cost and install status, kept current. Add ?tokens=0 to hide the cost.
Marketplaces, most starred first
Shows its components, always-on context cost and install status, kept current. Add ?tokens=0 to hide the cost.
By danielselnickv1.14.0MITIn 1 marketplace
Proactive LSP context injection for Claude Code — automatically provides symbol info, diagnostics, and structural context via hooks + a persistent daemon
Claude loads one when your task matches it, or you run it by name.
2 cautions to review before installing
A hook runs when Claude uses the Bash tool
A hook runs when Claude writes or edits files
Static checks of hooks, mods, MCP servers and commands. Not a security audit.
1 marketplace, most starred first
Shows its components, always-on context cost and install status, kept current. Add ?tokens=0 to hide the cost.
A structural knowledge graph for Claude Code.
lsp-hooks gives Claude a formal understanding of your codebase's type system, symbol hierarchy, call graph, and diagnostics — injected automatically before every tool call. Claude doesn't grep and hope; it already knows.
There are three ways to give an AI agent access to language intelligence. Two of them don't work well in practice.
| Approach | Model | Problem |
|---|---|---|
| Plain LSP (IDE-style) | Pull-only — the model must know what to ask for | Great for autocomplete. Useless for an agent that doesn't know what it doesn't know. Claude would need to issue dozens of LSP queries per task, and it has no reason to. |
| MCP server (tool-based) | Request/response — Claude can call LSP tools | Claude must decide to query. In practice it rarely does, burning tokens re-reading files and guessing at structure instead. |
| lsp-hooks (push model) | Context injected before every tool call via hooks | Claude never has to ask. It already knows the symbol tree, callers, diagnostics, and exports before it reads, writes, or builds. Zero-effort, zero-token-waste structural awareness. |
The key insight: push, not pull. Claude Code's hook system lets lsp-hooks inject LSP context into the system message before every read, write, build, search, and prompt. The agent receives structural knowledge as a side effect of acting — no extra tool calls, no wasted tokens, no missed context.
lsp-hooks transforms Plan Mode from "grep and hope" into "reason over a knowledge graph":
Net effect: Plan Mode operates on a formal knowledge graph instead of grepping and hoping. Fewer file reads, fewer wrong turns, faster plans.
lsp-hooks builds and maintains a live structural model of your codebase:
# 1. Clone
git clone https://github.com/danielselnick/claude-hooks-lsp.git
cd claude-hooks-lsp
# 2. Register as a plugin marketplace
claude /plugin marketplace add "$(pwd)"
# 3. Run the installer (installs npm deps, checks LSP servers, starts daemon)
python3 install.py
# 4. Enable the plugin when prompted, or manually:
claude /plugin enable lsp-hooks
That's it. Open a new Claude Code session in any supported project and LSP context will appear automatically.
When you use Claude Code in a supported project, lsp-hooks fires on every hook event:
You open a session in a Rust project
→ SessionStart hook fires
→ Claude sees: "[LSP] Project overview: Structs: `Config`, `Server`; Functions: `main`, `run`"
You ask Claude to read src/server.rs
→ PreToolUse(Read) hook fires
→ Claude sees: "[LSP] Structure of src/server.rs: `Server` (Struct, L12), `new` (Method, L15)..."
You ask Claude to edit a function
→ PreToolUse(Edit) hook fires
→ Claude sees: "[LSP] Structural context: `handle_request` called by `main`, `dispatch`; 8 references across 3 files"
You ask Claude to run `cargo build`
→ PreToolUse(Bash) hook fires
→ Claude sees: "[LSP] Pre-build diagnostics: src/server.rs:42: mismatched types"
Hook Event (pre-read, pre-write, pre-bash, prompt, session-start)
│
▼
lsp_hooks.py ─── thin client, <100ms overhead
│ Unix socket
▼
lsp_hooks_daemon.py ─── persistent process, caches results
│ JSON-RPC over stdio
▼
lsp-mcp-server ─── npm package, bundled automatically
│ LSP protocol
▼
Language Servers (rust-analyzer, pylsp, typescript-language-server, etc.)
The daemon auto-starts on first hook invocation if not already running.
npx claudepluginhub danielselnick/claude-hooks-lsp --plugin lsp-hooksBuilt from public signals: copy clicks on this site, GitHub stars and activity, the README and the manifest. Not a security audit or an endorsement.
Plugins from other owners that cover similar ground