LSP Not Working in Claude Code? How to Check and Fix It

LSP Not Working in Claude Code? How to Check and Fix It

If Claude Code LSP is not working, the most common cause is a missing language server program. The code intelligence plugin only tells Claude Code which command to run, such as typescript-language-server, and you install that program yourself. When it isn’t on your PATH, Claude Code shows “Executable not found in $PATH” and Claude never gets diagnostics.

To check it, ask Claude to edit a file in that language and look for a line like Found 1 new diagnostic issue in 1 file under the edit. If that line never shows up, run /plugin and open the Errors tab. It names the exact reason, and the fix is usually to install the binary and start a new session.

In our test we also hit two less obvious failures: a server that starts and then quits, and a broken .lsp.json file. This guide shows each one with real screenshots and the fix that worked.

Browse all our Claude Code tutorials for more fixes and how-tos.

Tested with Claude Code v2.1.332 on macOS on December 4, 2026. We used a tiny throwaway TypeScript project and loaded Anthropic’s official typescript-lsp plugin (from the claude-plugins-official repo, commit e599fbc) with --plugin-dir, which runs the same plugin for one session.

The language server was typescript-language-server 6.1.0. Items marked as coming from the docs follow Anthropic’s official documentation.

Quick Summary: Why Claude Code LSP Is Not Working

Find what you see in the first column. Rows marked “Tested” are failures we reproduced ourselves.

What you seeLikely causeFixHow we checked it
No diagnostics line, no LSP tool callsNo code intelligence plugin for that languageInstall the plugin, for example typescript-lspFrom the official docs
“Executable not found in $PATH”The language server binary isn’t installed or isn’t on PATHInstall it, check with which, start a new sessionTested
“couldn’t start. The Errors tab in /plugin may have the reason”The server starts but quits during setupRead the reason with claude --debugTested
“provides no tsserver.js” in the debug logTypeScript 7.0.2 has no tsserver.js for the server to useInstall TypeScript 6 in the projectTested
“Invalid LSP server config for .lsp.json”A wrong or missing key in a custom pluginUse command and extensionToLanguageTested
“is not used for .ts files”Two servers claim the same extensionDisable one of the two pluginsTested
No diagnostics in a cloud sessionCloud sessions don’t start plugin language serversUse a terminal sessionFrom the official docs

How LSP Works in Claude Code

LSP stands for Language Server Protocol. It’s the same system your code editor uses to underline type errors and jump to a function’s definition. Claude Code can talk to these servers too, through code intelligence plugins.

The code intelligence docs list official plugins for 13 languages, including TypeScript, Python (pyright-lsp), Go (gopls-lsp), Rust (rust-analyzer-lsp) and C/C++ (clangd-lsp). Each plugin connects one language server. You install the plugin from the official marketplace and the server binary on your own machine.

When it works, Claude gains two things. After each edit it gets the errors and warnings the server reports, and it gets an LSP tool that can find definitions and references by symbol instead of by text search.

Diagram of how Claude Code starts a language server: plugin loaded, Claude edits a matching file, binary found on PATH, then diagnostics and the LSP tool
Every step has to work before Claude sees a single diagnostic

One detail trips people up: the server doesn’t start when Claude Code opens. It starts the first time Claude edits a file with one of the plugin’s extensions. In our test, the /plugin Errors tab said “No plugin errors” at launch even though the binary was missing, and the error only appeared after the first edit.

No edit, no language server. Always test LSP by having Claude change a real file.

How to Check If LSP Is Working in Claude Code

The official check is simple. Ask Claude to put a type error in a file and then fix it, and watch the output under the edit.

In our working session we asked Claude to change a price from the number 2 to the string "2". Right under the edit, Claude Code printed Found 1 new diagnostic issue in 1 file (ctrl+o to expand). That line is your proof the server is running.

Claude Code terminal showing an LSP tool call and the line Found 1 new diagnostic issue in 1 file
The diagnostics line appears right after an edit when the language server is running

Press Ctrl+O to read the issues themselves. Claude then fixed the error using what the server told it: Type 'string' is not assignable to type 'number'.

You can also test the LSP tool directly. We asked Claude to find every reference to a function, and it called the tool with findReferences and found 3 references across 2 files.

Claude Code calling the LSP tool with findReferences and finding 3 references across 2 files
A working server also lets Claude look up symbols through the LSP tool

If you see neither the diagnostics line nor any LSP(...) calls, something in the chain is broken. Work through the fixes below in order.

Fix 1: Install the Code Intelligence Plugin

The tools reference says Claude Code keeps the LSP tool inactive until you install a code intelligence plugin for your language. So with no plugin, nothing happens and no error appears.

In a terminal session, install the plugin for your language from inside Claude Code:

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

Swap typescript-lsp for your language’s plugin, such as pyright-lsp or gopls-lsp. The confirmation message says whether the plugin is active now or needs /reload-plugins. Our guide to managing plugins covers scopes and updates, and the LSP plugins guide walks through all 12 Anthropic-made language plugins.

If the install fails with Marketplace "claude-plugins-official" not found, the docs point to a separate troubleshooting entry for adding the official marketplace. Our explainer on plugin marketplaces shows how marketplaces work.

Fix 2: “Executable not found in $PATH”

This is the error you’ll most likely see. We loaded the TypeScript plugin without installing typescript-language-server and asked Claude for a one-line comment in a .ts file. The edit worked, and then Claude Code printed a yellow warning that the server’s program wasn’t found.

Claude Code warning that language server plugin:typescript-lsp:typescript couldn't start because typescript-language-server wasn't found
The warning appears under the first edit to a matching file

The /plugin Errors tab gave the same reason in its standard form: Executable not found in $PATH: "typescript-language-server". The quoted name is the binary you need.

The Errors tab in /plugin showing Executable not found in $PATH for typescript-language-server
The Errors tab names the exact binary Claude Code tried to run

How to fix it

  1. Open the plugin’s README (linked from the docs table) to find the install command. For TypeScript it is npm install -g typescript-language-server typescript.
  2. Check that the binary is on the PATH of the shell you start claude from, with which typescript-language-server (or Get-Command in PowerShell).
  3. Start a new Claude Code session from that same shell, then ask Claude to edit a matching file again.

Here is what that check looked like for us. The first which found nothing, and after we added the server’s folder to PATH it found the binary and printed version 6.1.0.

Terminal showing which typescript-language-server not found, then found after adding its folder to PATH
The which check before and after putting the server’s folder on PATH

A common trap is installing the binary in one terminal and running claude from another. The docs say Claude Code starts the server by name from the PATH it was launched with, so if you used a version manager or a custom folder, open a fresh terminal where which finds it.

Fix 3: The Server Starts, Then Quits

This one surprised us. With typescript-language-server on PATH, Claude Code still printed “couldn’t start. The Errors tab in /plugin may have the reason.” Claude even told us it never received any diagnostics and had to run the TypeScript compiler by hand.

Claude explaining that no language-server error reached it, so it ran tsc itself
When the server dies during setup, Claude falls back to running the compiler

Find the real reason with –debug

The plugin troubleshooting page says claude --debug logs these failures as LSP server <name> failed to start. We used --debug-file to save each session’s log to a file, then searched it:

claude --debug-file lsp.log
grep "LSP server" lsp.log

The log showed two different failures from our runs. The first time, the server couldn’t find any TypeScript at all. After we added TypeScript to the project, it found TypeScript 7.0.2, the version npm installed by default on our test date, and quit because that version provides no tsserver.js.

Debug log lines showing Executable not found, TypeScript 7.0.2 provides no tsserver.js, and finally LSP server instance started
The debug log shows the exact reason, and a working start looks like the last line

How to fix it

For TypeScript, the server needs a TypeScript package that still ships tsserver.js. Installing TypeScript 6 in the project fixed it for us:

npm install --save-dev typescript@6

After that, the log said LSP server instance started and diagnostics came through on the next edit. For other languages the reason will differ, but the method is the same: read the debug log, fix what it names, and start a new session. If you’re moving a project to TypeScript, our TypeScript conversion tutorial shows a full setup.

Fix 4: Invalid LSP Server Config in a Custom Plugin

If you wrote your own .lsp.json for a language with no official plugin, one wrong key breaks the whole file. The plugin components docs warn that an invalid file still passes claude plugin validate, so you only see the problem after loading it.

We tested this with a demo plugin that used cmd instead of command. The Errors tab showed Invalid LSP server config for ".lsp.json", listed the unrecognized key, and Claude Code skipped the file.

The /plugin Errors tab showing Invalid LSP server config for .lsp.json with an unrecognized key cmd
One unknown key makes Claude Code skip the whole .lsp.json file

A valid entry maps the server name straight to its settings, with no wrapper object. Only command and extensionToLanguage are required:

{
  "lua": {
    "command": "lua-language-server",
    "extensionToLanguage": { ".lua": "lua" }
  }
}

Each extension key must start with a dot. The plugins reference lists the optional fields, such as args, env, startupTimeout and restartOnCrash, and says any unknown key fails validation. Our guide to creating plugins covers the rest of the plugin folder.

Fix 5: Two Servers Claim the Same Extension

Each file extension gets exactly one language server. If two enabled plugins both handle .ts, the first one registered wins and the other is ignored for those files.

We loaded a second demo plugin that also claimed .ts. The Errors tab showed a warning that its server “is not used for .ts files” because typescript-lsp already registered one, and suggested disabling one plugin.

Warning in the /plugin Errors tab that LSP server ts-second is not used for .ts files
When two servers claim one extension, only the first is used

Fix it by disabling the plugin you don’t want with /plugin disable <plugin>. If you’re not sure which plugins are on, our post on skills versus plugins explains where each one comes from.

Other Reasons LSP Isn’t Working

A few cases come straight from the official docs rather than our test, so we list them separately.

  • Cloud sessions: Claude Code doesn’t start plugin language servers in web sessions of Claude Code, so there are no diagnostics or LSP calls there.
  • High memory use: servers such as rust-analyzer and pyright index the whole project. The docs suggest /plugin disable <plugin> and relying on Claude’s built-in search.
  • False errors in a monorepo: a server not set up for your workspace can report internal imports as unresolved. The docs say there’s nothing to fix on the Claude Code side, and it doesn’t stop Claude from editing.
  • Slow servers: a request the server never answers fails after 60 seconds by default (requestTimeout, v2.1.288 or later).

Here is the whole troubleshooting path in one picture.

Decision ladder for fixing Claude Code LSP: no plugin, executable not found, server quits, config row in Errors tab, cloud session
Start at the top; the first Yes usually points to your fix

The LSP Plugin Recommendation Dialog

In our working session a dialog titled “LSP plugin recommendation” popped up after Claude edited a .ts file. The docs say it appears when a matching server binary is on your PATH but the plugin that uses it isn’t installed.

LSP plugin recommendation dialog offering typescript-lsp with Yes install, Not now, Never for this plugin and Disable all LSP recommendations
The recommendation dialog offers to install the matching plugin

Choosing “Yes, install” installs the plugin for your user account, and you start a new session to load the server. “Not now” or Esc closes it for this session only.

If you ignore it, it closes after 30 seconds, and after five ignored dialogs Claude Code stops recommending plugins. To turn recommendations back on, the docs say to remove the lspRecommendationDisabled and lspRecommendationIgnoredCount keys from ~/.claude.json. A plugin you blocked with “Never for this plugin” sits in the lspRecommendationNeverPlugins list in the same file.

Try It Yourself

Once you’ve installed a plugin and its binary, run this test in a small project. It proves both diagnostics and the LSP tool work in under a minute.

In one file, change a number value to a string so it causes a type error.
Make only that edit, then fix the error the language server reports.
After that, use the LSP tool to find every reference to one function.

You should see the Found N new diagnostic issues line after the first edit and an LSP(operation: "findReferences" ...) call at the end. If not, open /plugin and check the Errors tab.

Common Mistakes

  • Installing only the plugin. The plugin doesn’t include the server binary, so you need both.
  • Checking the Errors tab before any edit. The server starts lazily, so the tab looks clean until Claude edits a matching file.
  • Keeping the old session open. After installing a binary, start a new session from a shell where which finds it.
  • Assuming the server is fine because it’s on PATH. It can still quit during setup, as TypeScript 7.0.2 showed us.
  • Trusting claude plugin validate for .lsp.json. An invalid file still passes it.

Pro Tips

  • Use --debug-file to save the log somewhere easy to search, instead of scrolling past it.
  • Look for the line LSP server instance started in the log. It’s the clearest sign the server is healthy.
  • For TypeScript, the server checks the project’s own typescript package first, so pin a working version in package.json.
  • If a server eats memory on a big repo, disable that plugin per project rather than uninstalling it.
  • Run the /doctor check too when plugins behave oddly in general.

Claude Code LSP Fix Cheat Sheet

Cheat sheet of commands to check and fix Claude Code LSP: /plugin Errors tab, which, claude --debug, plugin install, npm installs, reload-plugins
The commands to check, diagnose and fix Claude Code LSP

For other error messages, see our list of common errors in Claude Code.

Frequently Asked Questions

How do I know if LSP is working in Claude Code?

Ask Claude to edit a file in that language. If a line like Found 1 new diagnostic issue in 1 file appears under an edit that caused an error, or Claude makes LSP(...) calls, the server is running.

Why does Claude Code say “Executable not found in $PATH”?

The plugin is installed, but the language server program it names isn’t on your PATH. Install the binary from the plugin’s README, confirm it with which, and start a new session from that shell.

Does Claude Code install the language server for me?

No. The plugin only tells Claude Code which command to run and which file types it covers. You install the server binary yourself.

Why is there no error in /plugin even though LSP isn’t working?

The server only starts when Claude first edits a matching file, so the Errors tab stays empty before that. If there’s still no error after an edit, check that a plugin for your language is installed at all.

Does LSP work in Claude Code on the web?

No. The docs say cloud sessions don’t start plugin language servers, so code intelligence only works in terminal sessions. You can read more about the model behind it on our Claude AI page.

Conclusion

When Claude Code LSP is not working, check it the official way: have Claude edit a file and look for the diagnostics line, then open the /plugin Errors tab if it’s missing. In our test the fixes were clear once we saw the reason: install the plugin, put the server binary on your PATH and start a new session, read claude --debug when the server quits during setup (for TypeScript, pin version 6), and fix bad .lsp.json keys or duplicate extensions in the Errors tab.

Newsletter

New AI tools in your inbox

The best new tools and the AI news that matters, in one short email. Unsubscribe any time.

Free · No spam · Unsubscribe any time

✓ Looks like you’re subscribed

Loading Google’s sign-up form…

Looks like you’re already subscribed

Thanks for reading! New AI tools and the AI news that matters will land in your inbox.

Not subscribed yet? Refresh the page to load the sign-up form.

The sign-up form couldn’t load. If you use an ad or content blocker, allow news.google.com and reload the page.

Free instant check before you pay. Takes a few seconds.

Scroll to Top