Skip to content
Skill

Dead code audit

Finds unused functions, dead imports, orphan files and unreachable branches in a codebase

Dead code audit is an open-source agent skill for developer tools. It is available on Claude Code.

Scripts
None
Platforms
Claude Code
GitHub stars
6
Last commit
License
MIT
Listing updated

Similar skills

About Dead code audit

This skill guides the agent through a read-only audit of a codebase to locate dead code before a cleanup, migration or release. It starts by mapping the project's config, stack and source directories, skipping vendor and build folders, then inventories exported symbols and checks each one for references across the whole project.

The workflow covers four kinds of findings: exports that are never called or rendered, imports that are never used, files no other file imports, and code that can never run. Before anything is reported, the agent is told to rule out false positives such as entry points, barrel re-exports, framework hooks, dynamic or config-driven references, and types used only in annotations. Results are grouped by confidence, with a separate list for items that need manual verification.

The output is a structured report with tables of file paths and line numbers, an estimate of removable lines, and packages that could be dropped. The skill expects to read the project's own files and references a few project files such as a codebase map and lessons index when they exist, and it also points to a separate dead-code-remover agent for deletion. It never removes code unless the user explicitly asks for a fix.

When your agent uses it

Detect unused code — unreferenced functions, dead imports, orphan files, and unreachable branches. Use when hunting dead code before a cleanup or release, or when the user suspects code is unused.

From the skill's SKILL.md. Your agent reads this description to decide when to load the skill.

What it can access

From a static check of its 1 file (7 KB) on GitHub on 3 December 2026. Nothing was run. Read the files before you install a skill: it can tell your agent to run anything its tools allow.

Check another skill before you install it.

Install

This skill ships in the claude-code-kit plugin. In Claude Code, add the marketplace and install the plugin (it may include other skills too):

/plugin marketplace add tansuasici/claude-code-kit
/plugin install claude-code-kit@claude-code-kit

Or copy only this skill to ~/.claude/skills/dead-code-audit:

tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/tansuasici/claude-code-kit.git "$tmp" &&
mkdir -p ~/.claude/skills &&
rm -rf ~/.claude/skills/dead-code-audit &&
cp -R "$tmp/.claude/skills/dead-code-audit" ~/.claude/skills/dead-code-audit &&
rm -rf "$tmp"

For one project only, put the folder in .claude/skills/dead-code-audit inside it instead.

Claude Code docs on skills

Copy the skill folder to ~/.agents/skills/dead-code-audit to use it in every repository:

tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/tansuasici/claude-code-kit.git "$tmp" &&
mkdir -p ~/.agents/skills &&
rm -rf ~/.agents/skills/dead-code-audit &&
cp -R "$tmp/.claude/skills/dead-code-audit" ~/.agents/skills/dead-code-audit &&
rm -rf "$tmp"

For one repository only, put the folder in .agents/skills/dead-code-audit inside it instead.

Codex docs on skills

Copy the skill folder to ~/.cursor/skills/dead-code-audit to use it in every project:

tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/tansuasici/claude-code-kit.git "$tmp" &&
mkdir -p ~/.cursor/skills &&
rm -rf ~/.cursor/skills/dead-code-audit &&
cp -R "$tmp/.claude/skills/dead-code-audit" ~/.cursor/skills/dead-code-audit &&
rm -rf "$tmp"

For one project only, put the folder in .cursor/skills/dead-code-audit inside it instead.

Cursor docs on skills

Run in a terminal (add --scope workspace to install it for the current workspace only):

gemini skills install https://github.com/tansuasici/claude-code-kit.git --path .claude/skills/dead-code-audit

Or copy the folder to ~/.gemini/skills/dead-code-audit yourself.

Gemini CLI docs on skills

For GitHub Copilot in VS Code, copy the skill folder to ~/.copilot/skills/dead-code-audit:

tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/tansuasici/claude-code-kit.git "$tmp" &&
mkdir -p ~/.copilot/skills &&
rm -rf ~/.copilot/skills/dead-code-audit &&
cp -R "$tmp/.claude/skills/dead-code-audit" ~/.copilot/skills/dead-code-audit &&
rm -rf "$tmp"

For one project only, put the folder in .github/skills/dead-code-audit inside it instead.

VS Code docs on skills

Get the folder:

git clone --depth 1 https://github.com/tansuasici/claude-code-kit.git

Then copy claude-code-kit/.claude/skills/dead-code-audit into your agent's skills folder as dead-code-audit. Agents that support SKILL.md read one folder per skill.

The SKILL.md format

What it does

Reference-based symbol search
Checks every exported function, class, type, constant and component for callers across the project.
Dead import detection
Flags imported names and whole modules that the importing file never uses.
Orphan file discovery
Lists files no other file imports, including stale tests, configs and migrations.
Unreachable branch spotting
Finds code after unconditional returns, constant-false conditions and permanently disabled feature flags.
False positive filtering
Excludes entry points, barrel exports, framework hooks and dynamically referenced symbols before reporting.
Confidence-graded report
Separates safe-to-remove items from those needing verification, with file and line references.

Good for

  • Find unused functions and exports before a release
  • Check which files nothing imports after a feature removal
  • Locate dead imports and unreachable branches in a module
  • Estimate how many lines a cleanup sprint could remove
  • Identify packages used only by dead code before a migration

Dead code audit FAQ

Does Dead code audit modify my code?

No. By default it produces a report only. Files are changed only when the user explicitly asks to implement, fix, apply or refactor.

When does the skill trigger?

It is invoked with /dead-code-audit, and it fits requests to hunt dead code before a cleanup or release or when the user suspects code is unused.

Does Dead code audit need any special tools?

The SKILL.md does not set allowed tools. It assumes the agent can read and search project files and reads a codebase map and lessons index if they exist.

How does Dead code audit avoid false positives?

It checks entry points, dynamic and config-wired references, framework conventions, barrel re-exports, test helpers and type-only usage before reporting a symbol as dead.

How do I install Dead code audit in Claude Code?

Copy the skill folder from GitHub to ~/.claude/skills/dead-code-audit to use it in all your projects, or to .claude/skills/dead-code-audit in one project. Or install the claude-code-kit plugin, which includes it: /plugin marketplace add tansuasici/claude-code-kit, then /plugin install claude-code-kit@claude-code-kit.

Does Dead code audit run scripts?

No. It is instructions only, with no scripts. This comes from a static check of the files on GitHub; nothing was run. Read the files before you install it.

Which AI agents can use Dead code audit?

Claude Code. It reads skills in the SKILL.md format; the install steps on this page show where to put the folder.

What are the best alternatives to Dead code audit?

The closest alternatives to Dead code audit are Dead code cleanup edho ferdian, Code reachability audit, Code quality audit, Code review and Improve codebase architecture.

Where this comes from

  • Description: from the skill's own SKILL.md.

More from tansuasici/claude-code-kit

  1. Audits UI code against WCAG 2.1 AA for semantics, keyboard use, contrast and ARIA

    • Open source
    • 6 GitHub stars
    • Developer tools
  2. Audits a codebase's structure for SOLID violations, coupling and module boundary issues

    • Open source
    • 6 GitHub stars
    • Developer tools
  3. Lists the skills, agents, hooks and modules installed in a kit-enabled project

    • Open source
    • 6 GitHub stars
    • Developer tools
  4. Audits code for smells, error-handling gaps and maintainability issues with fixes

    • Open source
    • 6 GitHub stars
    • Developer tools
  5. Guides the agent to write and extend a project's golden-principles.yaml rule file

    • Open source
    • 6 GitHub stars
    • Developer tools
  6. Guides the agent through root-cause debugging with reproduction, hypotheses

    • Open source
    • 6 GitHub stars
    • Developer tools