Agent skill

Lsp Code Analysis

by lsp-client in lsp-client/lsp-skill

Semantic code analysis via LSP. An agent skill from lsp-client/lsp-skill.

MITAuto-check passedDevelopment

Install Lsp Code Analysis

skills CLI
$ npx skills add lsp-client/lsp-skill --skill lsp-code-analysis -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install lsp-client/lsp-skill lsp-code-analysis --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/lsp-client/lsp-skill.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/lsp-code-analysis .claude/skills/lsp-code-analysis && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
lsp-code-analysis
GitHub stars
119
Token cost
~3k tokens
SKILL.md length
883 words
Files
9 (incl. scripts, references, assets)
Skills in repo
1
Repo updated
First seen
Licence
MIT

At a glance

Semantic code analysis via LSP. An agent skill from lsp-client/lsp-skill.

  • Works in 2 steps: Check for updates: Run the update script… → Verify project support: Run lsp server…
  • Exploring unfamiliar codebases
  • SKILL.md covers IMPORTANT: PREREQUISITE, Abstract, Overview and Commands, plus 1 more section
  • Runs Shell scripts from its folder

What it does

Lsp Code Analysis is an agent skill from lsp-client/lsp-skill. 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.

Its SKILL.md is about 3k tokens, which your agent loads only when the skill is triggered. The skill folder holds 11 other files, including scripts, reference files and assets (for example `assets/bp_template.md`, `references/bp_backend.md` and `references/bp_frontend.md`).

It sits in Development, covering Refactoring and Codebase onboarding. The repository describes itself as: IntelliSense Designed for Coding Agent. The licence is MIT.

When your agent uses it

  • Exploring unfamiliar codebases
  • Performing safe refactoring

Example prompts

  • “/lsp-code-analysis”

Requirements

  • A Bash shell

Workflow steps

2 steps, taken from the first numbered list in SKILL.md.

  1. Check for updates: Run the update script to ensure you are using the latest version of the tool.
  2. Verify project support: Run lsp server start to start the LSP server and confirm the project is supported.

What it can do on your machine

Read from SKILL.md and the folder at commit 66f3e41. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Ships 1 file in scripts/ (Shell), which the agent can run.

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Lsp Code Analysis loads about 3k tokens when it runs, and up to ~3.8k if it reads all its reference files. Until then it costs about 60 tokens; SKILL.md has 883 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~60
When it runs · the whole SKILL.md, loaded when a task matches
~3k
With references · SKILL.md plus every file in references/, read only if the agent opens them
~3.8k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); the scripts in this folder are not scanned.

SKILL.md

The full file from lsp-client/lsp-skill at commit 66f3e41, republished under its MIT licence (© lsp-client). 883 words, ~2,954 tokens.

Download SKILL.mdSave it as .claude/skills/lsp-code-analysis/SKILL.md (or your agent's skills folder). This skill also uses 8 other files; get the full folder from GitHub.
name
lsp-code-analysis
description
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.
license
LICENSE

LSP Code Analysis

IMPORTANT: PREREQUISITE

To use this skill, you MUST follow these steps:

  1. Check for updates: Run the update script to ensure you are using the latest version of the tool.
  2. Verify project support: Run lsp server start <project_path> to start the LSP server and confirm the project is supported.

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, analysis and refactoring via the Language Server Protocol (LSP).

Overview

You are provided with lsp CLI tool for semantic code navigation and analysis. It SHOULD be preferred over read or grep for most code understanding tasks.

Usages:

  • 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

Guideline: You SHOULD prioritize LSP commands for code navigation and analysis. Agents MAY use read or grep ONLY when semantic analysis is not applicable (e.g., searching for comments or literal strings).

TaskTraditional ToolRecommended LSP Command
Find Definitiongrep, readdefinition
Find Usagesgrep -rreference
Understand Filereadoutline
View Docs/Typesreaddoc
RefactorsedSee Refactoring Guide

Commands

All commands support -h or --help.

Locating Symbols

Most commands use a unified locating syntax via the --scope and --find options.

Arguments: <file_path>

Options:

  • --scope: Narrow search to a symbol body or line range.
  • --find: Text pattern to find within the scope.

Scope Formats:

  • <line>: Single line number (e.g., 42).
  • <start>,<end>: Line range (e.g., 10,20). Use 0 for end to mean till EOF (e.g., 10,0).
  • <symbol_path>: Symbol path with dots (e.g., MyClass.my_method).

Find Pattern (--find):

The --find option narrows the target to a text pattern within the selected scope:

  • The scope is determined by --scope (line/range/symbol). If no --scope is given, the entire file is the scope.
  • Pattern matching is whitespace-insensitive: differences in spaces, tabs, and newlines are ignored.
  • You MAY include the cursor marker <|> inside the pattern to specify the exact position of interest within the match (for example, on a variable name, keyword, or operator).
  • If --find is omitted, the command uses the start of the scope (or a tool-specific default) as the navigation target.

Cursor Marker (<|>):

The <|> marker indicates the exact position for symbol resolution. It represents the character immediately to its right. Use it within the find pattern to point to a specific element (e.g., user.<|>name to target the name property).

Examples:

  • lsp doc foo.py --find "self.<|>" - Find self. in entire file, position at the character after the dot (typically for completion or member access)
  • lsp doc foo.py --scope 42 --find "return <|>result" - Find return result on line 42, position at r of result
  • lsp doc foo.py --scope 10,20 --find "if <|>condition" - Find if condition in lines 10-20, position at c of condition
  • lsp doc foo.py --scope MyClass.my_method --find "self.<|>" - Find self. within MyClass.my_method, position after the dot
  • lsp doc foo.py --scope MyClass - Target the MyClass symbol directly

Guideline for Scope vs. Find:

  • Use --scope <symbol_path> (e.g., --scope MyClass, --scope MyClass.my_method) to target classes, functions, or methods. This is the most robust and preferred way to target symbol.
  • Use --find (often combined with --scope) to target variables or specific positions. Use this when the target is not a uniquely named symbol or when you need to pinpoint a specific usage within a code block.

Agents MAY use lsp locate <file_path> --scope <scope> --find <find> to verify if the target exists in the file and view its context before running other commands.

bash
# Verify location exists
lsp locate main.py --scope 42 --find "<|>process_data"
Show full SKILL.md (255 more words)Show less
Pagination

Use pagination for large result sets like reference or search.

  • --pagination-id <ID>: (Required) Unique session ID for consistent paging.
  • --max-items <N>: Page size.
  • --start-index <N>: Offset (0-based).

Example:

bash
# Page 1
lsp search "User" --max-items 20 --pagination-id "task_123"

# Page 2
lsp search "User" --max-items 20 --start-index 20 --pagination-id "task_123"

Guideline: Use pagination with a unique ID for common symbols to fetch results in manageable chunks. Increment --start-index using the same ID to browse.

Outline: File Structure

Get hierarchical symbol structure without reading implementation.

bash
# Get main symbols (classes, functions, methods)
lsp outline <file_path>

# Get all symbols including variables and parameters
lsp outline <file_path> --all

Agents SHOULD use outline before reading files to avoid unnecessary context consumption.

Definition: Navigate to Source

Navigate to where symbols are defined.

bash
# Jump to where User.get_id is defined
lsp definition models.py --scope User.get_id

# Find where an imported variable comes from
lsp definition main.py --scope 42 --find "<|>config"

# Find declaration (e.g., header files, interface declarations)
lsp definition models.py --scope 25 --mode declaration --find "<|>provider"

# Find the class definition of a variable's type
lsp definition models.py --scope 30 --find "<|>user" --mode type_definition
Reference: Find All Usages

Find where symbols are used or implemented.

bash
# Find all places where logger is referenced
lsp reference main.py --scope MyClass.run --find "<|>logger"

# Find all concrete implementations of an interface/abstract class
lsp reference api.py --scope "IDataProvider" --mode implementations

# Get more surrounding code context for each reference
lsp reference app.py --scope 10 --find "<|>my_var" --context-lines 5

# Limit results for large codebases
lsp reference utils.py --find "<|>helper" --max-items 50 --start-index 0
Doc: Get Documentation

Get documentation and type information without navigating to source.

bash
# Get docstring and type info for symbol at line 42
lsp doc main.py --scope 42

# Get API documentation for process_data function
lsp doc models.py --scope process_data

Agents SHOULD prefer doc over read when only documentation or type information is needed.

Search for symbols across the workspace when location is unknown.

bash
# Search by name (defaults to current directory)
lsp search "MyClassName"

# Search in specific project
lsp search "UserModel" --project /path/to/project

# Filter by symbol kind (can specify multiple times)
lsp search "init" --kinds function --kinds method

# Limit and paginate results for large codebases
lsp search "Config" --max-items 10
lsp search "User" --max-items 20 --start-index 0

Agents SHOULD use --kinds to filter results and reduce noise.

Symbol: Get Complete Symbol Code

Get the full source code of the symbol containing a location.

bash
# Get complete code of the function/class at line 15
lsp symbol main.py --scope 15

# Get full UserClass implementation
lsp symbol utils.py --scope UserClass

# Get complete method implementation
lsp symbol models.py --scope User.validate

Response includes: symbol name, kind (class/function/method), range, and complete source code.

Agents SHOULD use symbol to read targeted code blocks instead of using read on entire files.

Refactoring Operations

Read Refactoring Guide for rename, extract, and other safe refactoring operations.

Server: Manage Background Servers

The background manager starts automatically. Manual control is OPTIONAL.

bash
# List running servers
lsp server list

# Start server for a project
lsp server start <path>

# Stop server for a project
lsp server stop <path>

# Shutdown the background manager
lsp server shutdown

Best Practices

General Workflows
Understanding Unfamiliar Code

The RECOMMENDED sequence for exploring new codebases:

bash
# Step 1: Start with outline - Get file structure without reading implementation
lsp outline <file_path>

# Step 2: Inspect signatures - Use doc to understand API contracts
lsp doc <file_path> --scope <symbol_name>

# Step 3: Navigate dependencies - Follow definition chains
lsp definition <file_path> --scope <symbol_name>

# Step 4: Map usage - Find where code is called with reference
lsp reference <file_path> --scope <symbol_name>
Debugging Unknown Behavior
bash
# Step 1: Locate symbol definition workspace-wide
lsp search "<symbol_name>"

# Step 2: Verify implementation details
lsp definition <file_path> --scope <symbol_name>

# Step 3: Trace all callers to understand invocation context
lsp reference <file_path> --scope <symbol_name>
Finding Interface Implementations
bash
# Step 1: Locate interface definition
lsp search "IUserService" --kinds interface

# Step 2: Find all implementations
lsp reference src/interfaces.py --scope IUserService --mode implementations
Tracing Data Flow
bash
# Step 1: Find where data is created
lsp search UserDTO --kinds class

# Step 2: Find where it's used
lsp reference models.py --scope UserDTO

# Step 3: Check transformations
lsp doc transform.py --scope map_to_dto
Understanding Type Hierarchies
bash
# Step 1: Get class outline
lsp outline models.py

# Step 2: Find subclasses (references to base)
lsp reference models.py --scope BaseModel

# Step 3: Check type definitions
lsp definition models.py --scope BaseModel --mode type_definition
Performance Tips
bash
# Use outline instead of reading entire files
lsp outline large_file.py  # Better than: read large_file.py

# Use symbol paths for nested structures (more precise than line numbers)
lsp definition models.py --scope User.Profile.validate

# Limit results in large codebases
lsp search "User" --max-items 20

# Use doc to understand APIs without navigating to source
lsp doc api.py --scope fetch_data  # Get docs/types without jumping to definition

# Verify locate strings if commands fail
lsp locate main.py --scope 42 --find "<|>my_var"
Domain-Specific Guides

For specialized scenarios, see:

© lsp-client, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 8 other files (scripts, references, assets) in skills/lsp-code-analysis of lsp-client/lsp-skill.

  • SKILL.md
  • .version
  • LICENSE
  • assets/bp_template.md
  • references/bp_backend.md
  • references/bp_frontend.md
  • references/monorepo.md
  • references/refactor.md
  • scripts/update.sh

Open the folder on GitHubat commit 66f3e41

Compare with similar skills

Lsp Code Analysis next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Lsp Code Analysis compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Lsp Code Analysis this skilllsp-client/lsp-skill119—~3kAutomated safety check: PassMIT
Ast GrepBiFangKNT/mtga1.2k—~802Automated safety check: PassAGPL-3.0
Gograph Go Repository Intelligenceozgurcd/gograph227—~4.8kAutomated safety check: NotesMIT
Ripwire Graph Queryredhat-et/ripwire2.4k—~1.1kAutomated safety check: NotesApache-2.0
CodeNavitech-leads-club/agent-skills7k—~3.4kAutomated safety check: PassCC-BY-4.0
Golang Goplscontext-labs/whip1.1k1 repos~2.3kAutomated safety check: PassMIT

Similar skills

  • Ast Grep

    BiFangKNT/mtga

    Write and debug ast-grep rules for structural code search and rewrite.

    1.2k GitHub stars~802 tokensUpdated 3 mo ago
    DevelopmentAuto-check passed
  • Gives an agent working in a Go codebase a structural view through a local MCP server: call graphs, blast-radius and impact analysis, and bounded first-call exploration.

    227 GitHub stars~4.8k tokensUpdated yesterday
    DevelopmentAuto-check: notes
  • Ripwire Graph Query

    redhat-et/ripwire

    Answers call-graph questions that combine several conditions, such as complex functions that reach a target or untested symbols near main, using ripwire's graph-query mode.

    2.4k GitHub stars~1.1k tokensUpdated 2 days ago
    DevelopmentAuto-check: notes
  • CodeNavi

    tech-leads-club/agent-skills

    Investigates unfamiliar codebases before changing them, makes small targeted edits and records what it learns in a .notebook/ folder for later sessions.

    7k GitHub stars~3.4k tokensUpdated 17 days ago
    DevelopmentAuto-check passed
  • Golang Gopls

    context-labs/whip

    Golang semantic code intelligence via gopls — go-to-definition, references, call hierarchy, symbols, diagnostics, rename, refactors.

    1.1k GitHub starsUsed in 1 repo~2.3k tokens
    DevelopmentAuto-check passed
  • Repo Map

    AnastasiyaW/codex-claude-code-config

    Ranked symbol map of a codebase within a token budget — a compact "what matters in this repo" before reading files.

    154 GitHub stars~1.5k tokensUpdated 5 days ago
    DevelopmentAuto-check passed

Categories

Questions about Lsp Code Analysis

What does Lsp Code Analysis do?

Semantic code analysis via LSP. An agent skill from lsp-client/lsp-skill. Lsp Code Analysis is an agent skill from lsp-client/lsp-skill. Semantic code analysis via LSP.

When should I use Lsp Code Analysis?

Lsp Code Analysis fits situations like: exploring unfamiliar codebases; performing safe refactoring.

How do I install Lsp Code Analysis in Claude Code?

Run `npx skills add lsp-client/lsp-skill --skill lsp-code-analysis -a claude-code`. Or copy the skill folder (skills/lsp-code-analysis in lsp-client/lsp-skill) into .claude/skills/lsp-code-analysis in your project. Claude Code loads it when a task matches its description.

How do I install Lsp Code Analysis in Codex?

Run `npx skills add lsp-client/lsp-skill --skill lsp-code-analysis -a codex`. Or copy the skill folder (skills/lsp-code-analysis in lsp-client/lsp-skill) into .agents/skills/lsp-code-analysis in your project. Codex loads it when a task matches its description.

Can I use Lsp Code Analysis in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add lsp-client/lsp-skill --skill lsp-code-analysis -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/lsp-code-analysis, .gemini/skills/lsp-code-analysis, .github/skills/lsp-code-analysis and .opencode/skills/lsp-code-analysis in your project.

What does Lsp Code Analysis need to run?

Going by SKILL.md and its folder, Lsp Code Analysis needs a shell for the scripts in its folder. Our summary lists: A Bash shell.

Does Lsp Code Analysis access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Lsp Code Analysis safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. The check reads SKILL.md only: the scripts in the folder are not scanned, so read them before running anything.

What licence does Lsp Code Analysis use?

Lsp Code Analysis is published under the MIT licence (from the LICENSE file in the skill folder). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Lsp Code Analysis use?

About 3k tokens (SKILL.md is roughly 12k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full. Its references folder adds about 840 tokens, read only when the agent opens those files.

What are the alternatives to Lsp Code Analysis?

Skills that share tags, products or a category with Lsp Code Analysis: Ast Grep (BiFangKNT/mtga, 1.2k stars), Gograph Go Repository Intelligence (ozgurcd/gograph, 227 stars), Ripwire Graph Query (redhat-et/ripwire, 2.4k stars) and CodeNavi (tech-leads-club/agent-skills, 7k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Lsp Code Analysis?

lsp-client (a GitHub organization) maintains it in lsp-client/lsp-skill, which has 119 GitHub stars. The repository was last updated on February 9, 2026.

Source: lsp-client/lsp-skill on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.