lsp-dead-code

Enumerate exported symbols and cross-check references to identify dead code.

102|5|Updated Apr 6, 2026
One-click install
npx skills add https://github.com/blackwell-systems/agent-lsp --skill lsp-dead-code
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: lsp-dead-code
Source: https://github.com/blackwell-systems/agent-lsp/tree/main/skills/lsp-dead-code
Command: npx skills add https://github.com/blackwell-systems/agent-lsp --skill lsp-dead-code

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Enumerate exported symbols in a file and surface those with zero references across the workspace, enabling targeted dead-code audits and API cleanup.

Core Features & Use Cases

  • Enumerate exported symbols for a target file via LSP, then gather references to determine usage.
  • Produce a structured Dead Code Report highlighting zero-reference candidates and test-only references, with caveats for dynamic usage patterns.
  • Use cases include cleaning up APIs before releases, reducing maintenance surface area, and validating public interfaces.

Quick Start

Open a target project and run this skill against a file to identify exported symbols with zero references.

Frequently Asked Questions about lsp-dead-code

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I find dead code by checking exported symbols with zero references?▼

To find dead code, enumerate exported symbols in a target file and cross-check their references across the workspace to surface zero-reference candidates for cleanup. This process uses LSP to build a structured report identifying unused public interfaces.

What is the best way to audit APIs for unused exports before a release?▼

The best way to audit APIs before a release is to cross-check exported symbols against workspace references to identify dead code. This generates a zero-reference report with grep-based validation, highlighting unused public interfaces and reducing maintenance surface area.

Does dead code analysis work with multi-language repositories?▼

Yes, dead code analysis applies to multi-language repositories by leveraging the agent-lsp MCP server. It uses get_document_symbols and get_references to audit exported symbols and validate their usage across different languages within the workspace.

Do I need an LSP server to detect unused exported symbols?▼

Yes, you need the agent-lsp MCP server to detect unused exported symbols. The analysis relies on LSP methods like get_document_symbols and get_references to enumerate exports and cross-check their usage across the workspace.

How does static analysis handle dynamic usage patterns when identifying dead code?▼

Static analysis handles dynamic usage patterns by including caveats in the dead code report. While it surfaces zero-reference candidates and test-only references using LSP, it explicitly notes that dynamic usage patterns may not be fully captured by static cross-checking.

Can I identify test-only references during a dead code audit?▼

Yes, you can identify test-only references during a dead code audit. The analysis produces a structured report that specifically highlights both zero-reference candidates and symbols that are only referenced by tests, ensuring safe refactoring.