Blog / AI News

AI News

Claude Code LSP: Drop Code Navigation from 30 Seconds to 50ms

By Team Resolve··5 min read

By default, when Claude Code needs to find where a function is defined or track down all references to a method, it uses grep. It searches through your files as plain text, returns results, and works out context from there.

This works. It is just slow. We are talking 30 to 60 seconds for a query that your IDE resolves in under a second.

There is a better way, and it has been sitting in Claude Code since version 2.0.74.

What LSP gives you

Language Server Protocol is the same technology your IDE uses for "go to definition," "find references," and real-time error squiggles. It understands your code semantically, not just textually. When you enable it in Claude Code, the same navigation queries that took 30 seconds complete in around 50 milliseconds. That is roughly 900 times faster.

But the speed is not even the most valuable part.

The real win is automatic error detection. With LSP running, Claude sees type errors and missing imports immediately after every edit, before it shows you results. Instead of writing code, realizing there is a type error two steps later, and going back to fix it, Claude catches and corrects errors in a single pass. Fewer round trips. Less back and forth.

LSP supports 11 languages: Python, TypeScript, Go, Rust, Java, C and C++, C#, PHP, Kotlin, Ruby, and HTML and CSS.

How to set it up (4 steps)

Step 1. Enable the feature flag. Open ~/.claude/settings.json and add:

"ENABLE_LSP_TOOL": "1"

This flag is not in the official docs yet, which is why most people miss it.

Step 2. Install a language server for your language. For Python, install Pyright with npm install -g pyright. For Go, use gopls. For Rust, use rust-analyzer. For TypeScript, use vtsls. For PHP, install the PHP language server via npm or Composer.

Step 3. Install and activate the Claude Code plugin. Run claude plugin install pyright@claude-code-lsps (or the equivalent for your language). Then run claude plugin list to verify it shows as active, not just installed. This is a common gotcha: plugins can be installed but disabled.

Step 4. Restart Claude Code. Language servers initialize at startup and index your entire project. The first startup after enabling LSP will take a bit longer than usual while it indexes.

One more thing to do after setup

Even with LSP fully configured, Claude will sometimes fall back to grep out of habit. It defaults to its familiar tools. To prevent this, add an explicit instruction to your project's CLAUDE.md file telling Claude to prefer LSP for all code navigation tasks. Something simple works fine: "Use LSP tools for finding definitions, references, and navigating code. Prefer lsp_definition and lsp_references over grep for code lookups."

Without this instruction, you can go through the whole setup and still not get the full benefit because Claude keeps choosing the old path.

Is it worth doing?

If you work on any codebase larger than a few hundred files, yes. The combination of faster navigation, real-time error feedback, and fewer correction cycles meaningfully changes the quality of Claude's output on complex coding tasks. The setup takes about two minutes. The payoff compounds across every session you run after that.

Full setup guide with language-specific instructions: karanbansal.in/blog/claude-code-lsp. The original Reddit discussion about it is also worth reading if you want to see real-world experiences from other developers.

Good tooling helps you move faster, but the decisions about what to build and where to focus still come from you. When those choices feel hard, Resolve is built to help you work through them clearly.

Ready to make a better decision?

Resolve coaches you through it — step by step, bias by bias.

Start for free →