If you searched “Claude Code LSP,” your agent may be finding a definition by matching text when you need the IDE’s answer. A Claude Code language server plugin can give it that navigation through LSP, but it is one of four useful ways to explore code. Pick by the question your repository needs answered and what you can keep running.

Short answer: Claude Code’s LSP tool can request operations such as go-to-definition, find references, and hover from a language server; the official changelog documents the tool, and Claude Code’s plugin system supplies language-server integrations. That is the right starting point when type-aware navigation matters and you can install and configure the server. Claude Code’s grep is already available and works well when you know a name or phrase. Semantic search helps when the question is about meaning rather than a known symbol. Tree-sitter symbol tools can expose definitions and code relationships without a language server or a persistent index, but they infer relationships from syntax and names. We build octofs and octocode. In a one-run, six-task comparison dated November 15, 2026, octofs 0.25 code returned 6,561 tokens on tokio and 1,101 on cargo; octocode 0.29.0 returned 11,093 and 4,826. Those are tool responses, not evidence that one approach produces better agent outcomes.

Claude Code LSP vs grep: what does LSP add?

LSP asks a language server to resolve code intelligence requests at a source position; grep finds matching text. Use LSP when “find every reference to this symbol” must distinguish the symbol from comments, strings, and unrelated identifiers.

The Language Server Protocol specification defines a references request that resolves “project-wide references” for the symbol at a position, and call-hierarchy requests for its incoming and outgoing calls. A language server can use its language and project knowledge to resolve those requests. Grep has a different advantage: it searches literal text without requiring a language server to start or understand the project.

Need Start with Why
Find a known string, flag, error, or configuration key rg 'pattern' src Direct text match; no project model required
Resolve a definition or references with language awareness Claude Code LSP plus the matching server The server answers requests such as definition and references
Ask where a concept or behavior is implemented Semantic code search Search by meaning when you do not know the symbol name
Map names and syntax relationships without a running server Tree-sitter symbol tools Parse files on demand and expose symbol relationships, with weaker semantic guarantees

A text match can include non-code occurrences, while a parser-derived relation can miss language-level resolution. See our overviews of semantic code search and structural search; keep those as separate jobs rather than replacements for references.

How do you enable LSP in Claude Code?

Follow the official Code intelligence plugins page. In a terminal session, install the server binary first, then launch Claude Code and install the language plugin at its prompt. For a Claude Code TypeScript LSP setup, which also covers JavaScript, the docs specify typescript-language-server and this binary install command:

npm install -g typescript-language-server typescript

Then, inside Claude Code:

/plugin install typescript-lsp@claude-plugins-official

These are docs-only commands; we did not run them. Claude starts the server the first time it edits a matching file. The docs say a Found N new diagnostic issues in M files (ctrl+o to expand) line confirms it started; otherwise run /plugin and inspect the Errors tab. The changelog dates LSP tool support to Claude Code v2.0.74, December 19, 2025. ENABLE_LSP_TOOL does not appear in the current docs checked November 15, 2026.

If Claude Code LSP is not working and Claude reports No LSP server available for file type, check that the plugin is installed and active and that the server binary is on the PATH. A December 2025 issue report documents that error even when a server was installed, with ENABLE_LSP_TOOL=1 as a workaround at the time. An Anthropic collaborator closed it on August 17, 2026 with “This works via LSP plugins”, so treat the report as history, not as the state of current releases.

We checked Anthropic’s docs and changelog November 15, 2026. LSP is useful when it works with your project, but plugin and language-server setup remains a real dependency. If you can’t install one in the agent environment, choose a different navigation route.

LSP, semantic search, grep or Tree-sitter symbols: which answers your question?

Use the narrowest tool that can answer the question accurately. A call hierarchy is about relationships between known symbols; semantic search is for concepts you can’t name yet.

Approach Answers well Setup and runtime Where it can be wrong Choose it when…
Grep (rg) “Where does this exact name or text appear?” No index or server Matches comments, strings, similarly named symbols; does not resolve a symbol You know a literal to search, or need a dependable first pass
Language server through LSP “What is this symbol’s definition, reference, caller, or type?” Install a language server and configure the client/plugin; server may load project state Coverage and behavior depend on the server, language, and project configuration Type-aware answers matter and the project’s server is available
Semantic search “Where is the retry policy implemented?” Usually an embedding model and an index; details vary by product Similar meaning is not proof of a call or reference relationship You know the behavior, not the names or files
Tree-sitter symbols “What declarations and syntax-level relations are near this name?” Parser grammars and a tool; can run without an LSP server or persistent index Syntax and names do not establish types or every resolved call You need lightweight symbol navigation without server setup

Tree-sitter is a parser generator and incremental parsing library that builds concrete syntax trees, according to the Tree-sitter project. A syntax tree gives a tool structure to inspect; the parser alone doesn’t provide a type checker or a project’s resolved call graph. Aider’s repo map implementation is another example of turning source structure into a compact map for an agent.

This distinction isn’t the same as “agentic search vs RAG.” A retrieval index can help locate relevant passages by meaning; explicit navigation tools answer exact structural questions. See our local semantic indexing guide for that separate workflow.

Do coding agents like Claude Code still need codebase indexing?

Not always: Claude Code and Cline gather code context without pre-indexing, and Cursor, which measured a gain from semantic search in November 2025, said in July 2026 that it was turning its semantic index down in favor of grep. One August 2026 preprint still found retrieval ahead on read-only questions, so the answer depends on the task.

Anthropic’s 2025 engineering post describes a hybrid: some context loaded up front, the rest fetched by the agent with tools when it needs it. “Claude Code is an agent that employs this hybrid model”, it says, with CLAUDE.md files in context from the start and glob and grep used to find files just in time. Boris Cherny of the Claude Code team said on the Latent Space podcast (May 7, 2025) that early versions used RAG over an indexed codebase and that agentic search “outperformed everything”; asked on which benchmark, he said “mostly vibes”. Cline’s Nick Baumann wrote on May 27, 2025: “We don't index your codebase”. These describe their approaches; neither settles what works best for every codebase.

Cursor’s November 6, 2025 post reports semantic search achieved “on average 12.5% higher accuracy in answering questions (6.5%–23.5% depending on the model)” on its own evaluation set, with its own embedding model. Its online A/B test showed smaller effects: agent code retention rose 0.3%, and 2.6% on codebases of 1,000 files or more. The 12.5% is question-answering accuracy, not a universal production lift.

Cursor has since changed course. On its forum in July 2026, a staff member wrote that models had become very good at using grep and indexed search, so “the older dedicated semantic search path was rapidly no longer helping in a meaningful way”. A support engineer confirmed the next day: “Semantic/embeddings indexing is being turned down in favor of grep-based retrieval.” Cursor still builds a local index, but for regex search, with no embeddings in it.

The evidence is not one-sided. An August 2026 preprint, under review, reports that on the SWE-QA benchmark semantic search answered 65.2% of repository questions correctly against 46.2% for grep search delegated to a subagent. It covers read-only questions on repositories indexed in advance.

Our view: simple tools win with today’s models. They have learned to explore code with exact search, and they do it well: search for a name, read the file, follow a symbol. In our use, semantic search adds less for an agent than we expected, which is where Cursor ended up too; what ours lacked was symbol navigation that needs no setup. An embedding index is a setup step (octocode’s semantic search needs octocode index to run first), so it stays off until someone sets it up, and we find it helps a person exploring an unfamiliar codebase more than it helps an agent. So we kept semantic search (octocode stays the default semantic provider) and moved the symbol questions into the file server. This is our opinion from building and using both tools; we have not run an experiment comparing agent outcomes.

Question the agent has What answers it without an index / what needs one
Where is this exact name or string? Grep answers directly, no index.
What is this symbol’s definition or caller? LSP or syntax-based symbol navigation; a persistent index is not required.
Where is this behavior implemented when I can describe it but not name it? Semantic search over an index can retrieve relevant code by meaning.

What did we measure when we moved symbol navigation into the file server?

We compared six navigation tasks on tokio and cargo: outlines, definitions, references, callers, supertypes or subtypes, and a call path. The run measured tool response tokens and calls, not whether an agent completed a coding task better.

We build two MCP servers: octocode provides semantic search and a symbol graph, while octofs provides file tools. In octofs 0.25.0, released November 15, 2026, the symbol tool adds definitions, references, callers, callees, supertypes, subtypes, imports, imported-by relations, and call paths. It uses Tree-sitter without a language server, a persistent index on disk, or embeddings.

On November 15, 2026, we measured octocode 0.29.0 against an octofs build of the 0.25.0 source made before the version bump (the binary prints 0.24.0), counting tokens with the o200k_base tokenizer. The comparison covered two repositories, tokio and cargo, and six tasks in one run; it was not a benchmark of agent outcomes. The octofs answers were captured on a 12-core Linux box and came back byte-identical on an Apple M5 laptop with 10 cores, where octocode ran and both tools were timed.

Repository octofs response tokens octocode response tokens Calls: octofs / octocode
tokio 6,561 11,093 8 / 12
cargo 1,101 4,826 7 / 10
Total 7,662 15,919 15 / 22

The response-token totals count returned tool text across the six tasks. They do not include the model’s own request text or tell us which result would lead an agent to a better patch. In particular, one references task was not checked against octocode’s paginated 111-match result, and the hand checks are not an accuracy study.

Tool-definition size also changes when structural and graph search move to octofs. These sums are arithmetic over the per-tool definition sizes of the two measured builds; they were not captured inside a running Octomind session, and the octofs view definition from before the change was not measured.

Configuration Tools granted Definition tokens
Structural and graph search on octocode 10 6,455
Structural and graph search on octofs 8 5,468

The difference is 987 tokens. Semantic search stays on octocode. In the tap, the registry change that makes octofs the default for structural and graph search ships with the next tap update; it was not yet on master on November 15, 2026. Octocode’s graph queries remain available as a selectable provider.

On the same M5 laptop, each octofs call took at most 0.105 seconds, with a fresh process and its in-memory table build included. We optimized the port for that one job: a bounded answer per query. Octocode works differently: the first graphrag call in a process builds a full graph, while its structural search and signature view do not wait for it. We ran octocode only on copies without .git, using --no-git, and did not compare that with a normal checkout, so we give no timing for its graph build. These numbers describe our six tasks and our method; they do not rank the two tools.

Where is Tree-sitter symbol navigation wrong?

Treat Tree-sitter relations as a navigation aid, not type-resolved truth. Our octofs implementation extracts names and imports, can mark uncertain relations (guess), and limits graph relations to local paths.

Its documented limits per query are 800 ms, 600 parsed files and 100 listed results, and graph relations skip files over 1 MB. It doesn’t read manifests or TypeScript path aliases. If it reaches a cap, the answer can be partial and includes a repeat notice. For type-accurate references or project-wide resolution through aliases, a language server is the better fit.

The comparison exposed a concrete shared miss. In tokio, the free function spawn_blocking has callers that reach it through a path-qualified call and a re-export. Neither tool listed those real callers. Octofs returned (none) for the definition; octocode showed no incoming call edge. A plausible-looking empty caller list is therefore not proof that a function has no callers. Octofs 0.25.0 has this miss. Version 0.25.1 fixes it: the same narrowed query lists 10 callers of the free function, JoinSet::spawn_blocking among them. The token table above is from the 0.25.0 code and was not re-run.

Check a critical relation against the source before acting on it. For a tree-sitter call graph generator or call hierarchy, verify both a positive result and a known negative or re-export case in your language. When the answer affects a broad refactor, use the language server or inspect the call sites directly.

Which code navigation tool should you give your agent?

Choose LSP for type-aware symbol answers, grep for known text, semantic search for behavior described in ordinary language, and Tree-sitter when you want syntax-level navigation without a server or persistent index.

We build octofs, an open-source MCP file server with symbol navigation since version 0.25.0. Install it with cargo install octofs. Its relations are syntax-based, bounded, and may be guesses; don’t use them as type-accurate proof. Choose it when an agent needs definitions and local code relationships without LSP setup. Keep a language server when resolved references and types matter, and keep semantic search available for questions that start with meaning rather than a symbol name.

  • If the repository has a working language server and precision matters, configure Claude Code LSP.
  • If you know the exact name or string, start with rg.
  • If you can describe the behavior but not its implementation, use semantic search.
  • If you need lightweight local symbol navigation, try Tree-sitter and verify important relations in source.

— Don


We build open-source tools for focused coding workflows. Explore octofs on GitHub or tell us which navigation case you would like us to document next.