Skip to content

Instantly share code, notes, and snippets.

@lonormaly
Created January 12, 2026 09:32
Show Gist options
  • Select an option

  • Save lonormaly/189117f4d2a55245e96ae88c9ab60a24 to your computer and use it in GitHub Desktop.

Select an option

Save lonormaly/189117f4d2a55245e96ae88c9ab60a24 to your computer and use it in GitHub Desktop.
Claude Code LSP

Claude Code Native LSP Setup Guide

Enable Language Server Protocol support in Claude Code for 900x faster code navigation (~50ms vs ~45s for text-based search).

What LSP Provides

  • goToDefinition - Jump to symbol definitions
  • findReferences - Find all usages across codebase
  • hover - Type info and documentation
  • documentSymbol - File structure overview
  • getDiagnostics - Real-time errors/warnings

Quick Setup (5 minutes)

1. Enable LSP Tool

Add to your shell profile (~/.zshrc or ~/.bashrc):

export ENABLE_LSP_TOOL=1

Then reload: source ~/.zshrc

2. Install Language Servers

Choose the languages you need:

# TypeScript/JavaScript (recommended for most projects)
bun add -g @vtsls/language-server typescript
# Or with npm: npm install -g @vtsls/language-server typescript

# Python
bun add -g pyright
# Or: pip install pyright

# Go
go install golang.org/x/tools/gopls@latest

# Rust  
rustup component add rust-analyzer

# PHP
bun add -g intelephense

# HTML/CSS/JSON
bun add -g vscode-langservers-extracted

3. Add Plugin Marketplace

In Claude Code, run:

/plugin marketplace add Piebald-AI/claude-code-lsps

4. Install LSP Plugins

In Claude Code, install plugins for your languages:

/plugin install vtsls@claude-code-lsps        # TypeScript/JS
/plugin install pyright@claude-code-lsps      # Python
/plugin install gopls@claude-code-lsps        # Go
/plugin install rust-analyzer@claude-code-lsps # Rust
/plugin install phpactor@claude-code-lsps     # PHP
/plugin install vscode-langservers@claude-code-lsps # HTML/CSS

5. (Optional) Apply Stability Patches

npx tweakcc --apply

6. Restart Claude Code

Required for all changes to take effect.

Verification

Test your setup by asking Claude Code:

Go to the definition of [function_name]

Expected: Direct file:line navigation instead of text search.

Troubleshooting

Problem Solution
"No LSP server available" Check /plugin shows language installed; restart Claude Code
"Executable not found in $PATH" Verify binary with which vtsls (or your language server)
Plugin installed but not working Clear cache: rm -rf ~/.claude/plugins/cache and reinstall

Sources


Created by Claude Code with SuperClaude

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment