Skip to content
lsp logo

LSP Code Intelligence

lsp

Code navigation with LSP. When user says "find references", "go to definition", "where defined", "show type", "list symbols", "what uses", or "who calls" - use native LSP tools if available, otherwise fall back to specweave lsp commands.

SKILL.md

Full skill instructions

LSP Code Intelligence

Semantic code navigation and analysis.

Current Status (v2.1.0+)

⚠️ Native LSP is BROKEN in Claude Code v2.1.0+ (Issue #17468)

VersionNative LSPSpecWeave CLI
≤2.0.76✅ Works✅ Works
≥2.1.0❌ Broken✅ Works

Always use SpecWeave CLI until native LSP is fixed.

SpecWeave LSP CLI (Always Works)

# Find all references to a symbol (SEMANTIC, not grep!)
specweave lsp refs <file> <symbol>

# Go to definition
specweave lsp def <file> <symbol>

# Get type information (hover)
specweave lsp hover <file> <symbol>

# List all symbols in a file
specweave lsp symbols <file>

# Search workspace for symbols
specweave lsp search <query>

File Path Required

If user doesn't specify a file path, find it first:

# Step 1: Find which file(s) contain the symbol
grep -rn --include="*.ts" "function symbolName\|class symbolName" .

# Step 2: Then use LSP on the found file
specweave lsp refs <found-file> <symbol>

Why Use SpecWeave CLI over Grep

AspectGrepSpecWeave LSP
TypeText matchingSemantic analysis
ResultsIncludes comments, strings, docsActual code usages only
SpeedFast52x faster than grep
AccuracyMany false positivesZero false positives

⚠️ Never use Grep for "find references" - Grep finds TEXT matches (including comments, strings, docs). LSP finds SEMANTIC references (actual code usages only).

Workarounds for Native LSP

If you need native LSP tools:

# Option 1: Use older Claude Code version
ENABLE_LSP_TOOL=1 npx @anthropic-ai/​[email protected]

# Option 2: Use tweakcc patch
npx tweakcc --apply

Multi-Repo LSP Setup (v1.0.203+)

For umbrella projects with multiple repositories, use the interactive setup:

# Scan project and install LSP plugins interactively
specweave lsp setup

# Options:
specweave lsp setup --max 5       # Limit to top 5 languages
specweave lsp setup --min-files 10  # Min files to consider a language
specweave lsp setup --scope project # Install to .claude/​settings.json
specweave lsp setup --dry-run       # Show what would be installed

What Setup Does

  1. Scans all repos - Finds languages in repositories/, packages/, services/, etc.
  2. Ranks by file count - Shows top languages with file counts
  3. Shows implications - Restart required, startup time impact
  4. Prompts for approval - User selects which plugins to install
  5. Installs plugins - Uses claude plugin install with specified scope

Scan Coverage

Scans these directories for nested repositories:

  • repositories/ - Multi-repo umbrella pattern
  • packages/ - Monorepo (Lerna, Nx, etc.)
  • services/ - Microservices
  • apps/, libs/, modules/ - Nx/​Turborepo patterns

Status and Diagnostics

# Check current LSP status
specweave lsp status

# Shows:
#   - LSP env ready (ENABLE_LSP_TOOL)
#   - Detected languages
#   - Missing servers/​plugins
#   - Warm-up state

Supported Languages (10 LSPs)

SpecWeave LSP supports 10 major languages via their respective language servers:

LanguageServerInstall Command
TypeScript/​JavaScripttsserver (built-in)npm i -g typescript
Pythonpyrightnpm i -g pyright or pip install pyright
Gogoplsgo install golang.org/​x/​tools/​gopls@latest
Rustrust-analyzerrustup component add rust-analyzer
JavajdtlsVia VS Code or manual install
C#csharp-lsdotnet tool install -g csharp-ls
Kotlinkotlin-language-serverVia IntelliJ or manual install
Swiftsourcekit-lspComes with Xcode/​Swift toolchain
PHPintelephensenpm i -g intelephense
Rubysolargraphgem install solargraph

Auto-Detection

SpecWeave automatically detects which language servers to use based on project files:

LanguageDetection Files
TypeScripttsconfig.json, package.json
Pythonpyproject.toml, requirements.txt, setup.py
Gogo.mod, go.sum
RustCargo.toml
Javapom.xml, build.gradle
C#*.csproj, *.sln
Kotlinbuild.gradle.kts, *.kt
SwiftPackage.swift, *.xcodeproj
PHPcomposer.json
RubyGemfile, *.gemspec

How to Enable LSP in Your Project

1. Install the Language Server

# For Python projects
pip install pyright
# OR
npm install -g pyright

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

# For Rust projects
rustup component add rust-analyzer

# For C# projects
dotnet tool install -g csharp-ls

2. Run SpecWeave LSP

# It auto-detects languages!
specweave lsp refs src/​file.py MyClass
specweave lsp def src/​main.go HandleRequest
specweave lsp hover src/​lib.rs calculate

3. Verify Setup

specweave lsp status

How SpecWeave CLI Works

Uses language-specific clients:

  • TypeScript: TsServerClient (direct tsserver protocol, fastest)
  • Other languages: Generic LSPClient (JSON-RPC over stdio)

Features:

  1. Spawns language server directly
  2. Uses native LSP protocol
  3. Provides real semantic analysis
  4. Works in any environment (CI/​CD, Claude Code, scripts)

Project-Specific Learnings

Before starting work, check for project-specific learnings:

# Check if skill memory exists for this skill
cat .specweave/​skill-memories/​lsp.md 2>/​dev/​null || echo "No project learnings yet"

Project learnings are automatically captured by the reflection system when corrections or patterns are identified during development. These learnings help you understand project-specific conventions and past decisions.

More skills from majiayu000

xiaohongshu logo
majiayu000/claude-arsenal

xiaohongshu

xiaohongshu

286 148
View
agent-task-conductor logo
majiayu000/claude-skill-registry

agent-task-conductor

Conduct multi-agent task orchestration and workflow coordination.

663 1
View
conductor-setup logo
majiayu000/claude-skill-registry

conductor-setup

Initialize project with Conductor artifacts (product definition,

663 1
View
animation-designer logo
majiayu000/claude-skill-registry

animation-designer

Expert in web animations, transitions, and motion design using Framer Motion and CSS

663 1
View
diagramming logo
majiayu000/claude-skill-registry

diagramming

Creates Mermaid and ASCII diagrams for flowcharts, architecture, ERDs, state machines, mindmaps, and more. Use when user mentions diagram, flowchart, mermaid, ASCII diagram, text diagram, terminal diagram, visualize, C4, mindmap, architecture diagram, sequence diagram, ERD, or needs visual docume...

663 1
View
h3-pg logo
majiayu000/claude-skill-registry-data

h3-pg

PostgreSQL bindings for H3 hexagonal grid system. Use when working with H3 cells in Postgres, including spatial indexing, geometry/geography integration, and raster analysis.

23 1
View
conductor-development logo
majiayu000/claude-skill-registry

conductor-development

Context-Driven Development skill for projects using Conductor. Use this skill when you detect a `conductor/` directory in the project, when working on tasks defined in a `plan.md` file, or when the user asks about tracks, specs, or plans. Automatically applies TDD workflow, tracks task completion...

663 1
View
conductor-status logo
majiayu000/claude-skill-registry

conductor-status

Display project status, active tracks, and next actions

663 1
View
dockerization logo
majiayu000/claude-skill-registry

dockerization

Official Stakpak application containerization standard operating procedure, a step-by-step guidline to properly dockerize applications. This is a rule book curated by the Stakpak Team.

663 1
View

Popular AI tools

Kaiber logo
Video

Kaiber

Generate, edit, and beat-sync AI video with leading models in one workspace.

Paid
View
Vimcal logo
Productivity

Vimcal

The world's fastest calendar for remote work

Free
View

Transform Your Design with AI Designer by ImgCreator.ai

Freemium
View
Akool AI logo
Content & writing

Akool AI

Revolutionizing Video Production with AI-Powered Creativity

Paid
View

Extend an image past the frame and let AI fill the new aspect ratio.

Freemium
View
StarByFace logo
Security

StarByFace

Discover your celebrity doppelgänger with StarByFace!

Free
View
C

ChainClarity explains 700+ crypto whitepapers in plain English, with layered summaries, comparisons, research tools, alerts, and a $4.99 Pro plan.

Freemium
View
Opus Clip logo
Coding & apps

Opus Clip

Opus.ai: Revolutionize Your Web Experience

Free
View