# Dead code audit

> Dead code audit is an open-source agent skill for developer tools. Finds unused functions, dead imports, orphan files and unreachable branches in a codebase. It is available on Claude Code.

- **Kind:** Skill
- **Pricing:** Open source
- **Platforms:** Claude Code
- **Website:** https://github.com/tansuasici/claude-code-kit/tree/main/.claude/skills/dead-code-audit
- **Repository:** https://github.com/tansuasici/claude-code-kit
- **GitHub stars:** 6
- **License:** MIT
- **Skill name:** dead-code-audit
- **Collection:** https://github.com/tansuasici/claude-code-kit
- **Categories:** [developer tools](https://ai-powered.com/categories/developer-tools)
- **Listing updated:** 2026-12-03

## About

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.

## What it can access

From a static check of the files on GitHub; nothing was run.

- [Instructions only, no scripts](https://github.com/tansuasici/claude-code-kit/tree/HEAD/.claude/skills/dead-code-audit)
- [License: MIT](https://github.com/tansuasici/claude-code-kit/tree/HEAD/.claude/skills/dead-code-audit)

## Features

- **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

## Install

### Claude Code

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):

```sh
/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`:

```sh
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.

### Codex

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

```sh
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.

### Cursor

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

```sh
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.

### Gemini CLI

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

```sh
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.

### VS Code

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

```sh
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.

### Other agents

Get the folder:

```sh
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.

## 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.

## Alternatives

- [Dead code cleanup edho ferdian](https://ai-powered.com/skills/dead-code-cleanup-edho-ferdian): Dead code cleanup edho ferdian is an open-source agent skill for developer tools.
- [Code reachability audit](https://ai-powered.com/skills/code-reachability-audit): Code reachability audit is an open-source agent skill for developer tools.
- [Code quality audit](https://ai-powered.com/skills/code-quality-audit): Code quality audit is an open-source agent skill for developer tools.
- [Code review](https://ai-powered.com/skills/code-review-kripu77): Code review is an open-source agent skill for developer tools.
- [Improve codebase architecture](https://ai-powered.com/skills/improve-codebase-architecture): Improve codebase architecture is an open-source agent skill for developer tools.
- [Skill audit edho ferdian](https://ai-powered.com/skills/skill-audit-edho-ferdian): Skill audit edho ferdian is an open-source agent skill for developer tools.
- [Dependency cycle audit](https://ai-powered.com/skills/dependency-cycle-audit): Dependency cycle audit is an open-source agent skill for developer tools.
- [Audit prep assistant](https://ai-powered.com/skills/audit-prep-assistant): Audit prep assistant is an open-source agent skill for security.

---
Source: https://ai-powered.com/skills/dead-code-audit
