Semantic code analysis via LSP. Navigate code (definitions, references, implementations), search symbols, preview refactorings, and get file outlines. Use for exploring unfamiliar codebases or performing safe refactoring.
View on GitHublsp-client/lsp-skill
lsp-code-analysis
January 20, 2026
Select agents to install to:
npx add-skill https://github.com/lsp-client/lsp-skill/blob/main/skills/lsp-code-analysis/SKILL.md -a claude-code --skill lsp-code-analysisInstallation paths:
.claude/skills/lsp-code-analysis/# LSP Code Analysis ## IMPORTANT: PREREQUISITE **You MUST run the [update script](scripts/update.sh) to check for updates before using this skill.** Before any LSP operations, you **MUST first run `lsp server start <project_path>` to verify project support**. **IF YOU DO NOT PERFORM THESE STEPS, YOU ARE NOT ALLOWED TO USE THIS SKILL.** ## Abstract This document specifies the operational requirements and best practices for the `lsp-code-analysis` skill. It provides a semantic interface to codebase navigation and analysis via the Language Server Protocol (LSP). ## Overview You SHOULD use the `lsp` CLI tool for semantic code navigation and analysis, and it SHOULD be preferred over `read` or `grep` for most code understanding tasks. - **Semantic navigation**: Jump to definitions, find references, locate implementations - understands code structure, not just text patterns. - **Language-aware**: Distinguishes between variables, functions, classes, types - eliminates false positives from text search. - **Cross-file intelligence**: Trace dependencies, refactor safely across entire codebase - knows what imports what. - **Type-aware**: Get precise type information, signatures, documentation - without reading implementation code. ### Tool Selection | Task | Traditional Tool | Recommended LSP Command | | ------------------- | ---------------- | ----------------------------------------------- | | **Find Definition** | `grep`, `read` | [`definition`](#definition-navigate-to-source) | | **Find Usages** | `grep -r` | [`reference`](#reference-find-all-usages) | | **Understand File** | `read` | [`outline`](#outline-file-structure) | | **View Docs/Types** | `read` | [`doc`](#doc-get-documentation) | | **Refactor** | `sed` | See [Refactoring Guide](references/refactor.md) | **Guideline**: Agents SHOULD prioritize LSP commands for code navigation and an