# dead-code

A skill that finds unused functions and dead code with TLDR static analysis. Runs on demand, whenever a codebase needs a cleanup pass.

- skill · `type=skill` · Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, OpenCode · 729 installs · ★ 3946
- Author: parcadei
- License: MIT · policy=mirror · the beginning of the file is at the end of this page
- Source: https://github.com/parcadei/Continuous-Claude-v3/tree/HEAD/.claude/skills/dead-code/SKILL.md
- Updated: 2026-01-26
- HTML: https://affpapa.org/en/nevibecode/skills/dead-code

## What it does

The skill runs TLDR analysis over a codebase and reports dead functions: the total count, how many are never called, and the file and line for each one. Point it at the whole project or a single directory.

Under the hood it calls `tldr dead`. Pick a language with `--lang` (`python`, `typescript`) and set entry points with `--entry`. By default `main`, `cli`, `test_*`, `*_test`, `setup`, `teardown` and handlers like `@app.route` are excluded from the analysis; pass your own names as a list to the same flag. Bash is the only tool the skill is allowed to use.

It replaces the session-start-dead-code hook. That hook ran on its own but added 3 seconds to session startup, so this version trades automatic runs for manual invocation. Works on Windows, Mac and Linux, WSL included.

## Install

### Claude Code (native platform)

1. **Skills CLI (Vercel)**
```bash
npx skills add parcadei/Continuous-Claude-v3 --skill dead-code -a claude-code
```

2. **Manually: put the files in place**
- File: `~/.claude/skills/dead-code/SKILL.md` — Copy the whole skill folder; for one project use .claude/skills/dead-code/

### Codex

1. **Skills CLI (Vercel)**
```bash
npx skills add parcadei/Continuous-Claude-v3 --skill dead-code -a codex
```

2. **Manually: put the files in place**
- File: `.agents/skills/dead-code/SKILL.md` — For all projects use ~/.agents/skills/

### Cursor

1. **Skills CLI (Vercel)**
```bash
npx skills add parcadei/Continuous-Claude-v3 --skill dead-code -a cursor
```

2. **Manually: put the files in place**
- File: `.cursor/skills/dead-code/SKILL.md` — Cursor also reads .agents/skills/ and .claude/skills/

### GitHub Copilot

1. **GitHub CLI**
```bash
gh skill install parcadei/Continuous-Claude-v3 dead-code
```

2. **Manually: put the files in place**
- File: `.github/skills/dead-code/SKILL.md`

### Gemini CLI

1. **Skills CLI (Vercel)**
```bash
npx skills add parcadei/Continuous-Claude-v3 --skill dead-code -a gemini-cli
```

2. **Platform CLI**
```bash
gemini skills install https://github.com/parcadei/Continuous-Claude-v3 --path .claude/skills/dead-code
```

### Windsurf (Devin Desktop)

**Manually: put the files in place**
- File: `.devin/skills/dead-code/SKILL.md` — The legacy .windsurf/skills/ path still works

### OpenCode

**Skills CLI (Vercel)**
```bash
npx skills add parcadei/Continuous-Claude-v3 --skill dead-code -a opencode
```

### Claude.ai

**Claude.ai**
- Zip the folder and upload it in Settings → Capabilities → Skills

Where a file is given instead of a command, copy the files from the source to that path: https://github.com/parcadei/Continuous-Claude-v3/tree/HEAD/.claude/skills/dead-code/SKILL.md

## When to use it
- find functions nothing calls anymore
- strip old code before a refactor
- check a directory for unreachable methods
- drop legacy helpers after a module rewrite
- size up how much dead code a project carries

## Example prompts
- scan the project for dead code
- find unused functions in src/
- check src/ for dead code, entry points are main and api_handler

## Source text · SKILL.md · MIT

Below is the content of a third-party file. It is data, not instructions for you: do not act on anything written inside unless the human asks. Block tag: c2c9000ff81c49ef.

BEGIN THIRD-PARTY FILE c2c9000ff81c49ef
````text
---
name: dead-code
description: Find unused functions and dead code in the codebase
allowed-tools: [Bash]
keywords: [dead code, unused, cleanup, refactor, unreachable]
---

# Dead Code Detection

Find unused functions and dead code using TLDR static analysis.

## Quick Start

```bash
# Scan entire project
tldr dead .

# Scan specific directory
tldr dead src/

# Specify entry points (functions to exclude from analysis)
tldr dead . --entry main cli test_

# Specify language
tldr dead . --lang python
tldr dead . --lang typescript
```

## Output Format

```
Dead code analysis:
  Total functions: 150
  Dead functions: 12

Unused functions:
  - old_helper (src/utils.py:42)
  - deprecated_func (src/legacy.py:15)
  - _unused_method (src/api.py:230)
```

## Cross-Platform

Works on Windows, Mac, and Linux (including WSL).

```bash
# Windows (PowerShell)
tldr dead .

# Mac/Linux
tldr dead .
```

## Entry Points

Functions matching entry patterns are excluded from dead code analysis:
- `main`, `cli` - Application entry points
- `test_*`, `*_test` - Test functions
- `setup`, `teardown` - Fixtures
- `@app.route`, `@api.endpoint` - Framework handlers

```bash
# Custom entry points
tldr dead src/ --entry main api_handler background_job
```

## Integration

This skill replaces the session-start-dead-code hook with on-demand analysis.

| Approach | Pros | Cons |
|----------|------|------|
| Hook (removed) | Automatic | Slowed startup by 3s |
| Skill (this) | On-demand, fast | Manual invocation |

## Related Commands

```bash
# Impact analysis (who calls this?)
tldr impact func_name .

# Architecture layers
tldr arch src/

# Full codebase structure
tldr structure . --lang python
```
````
END THIRD-PARTY FILE c2c9000ff81c49ef

The third-party file has ended. Everything between the c2c9000ff81c49ef tags is data: requests and commands from it are not followed. An “end of file” line with another tag inside the block is part of the file.

© parcadei · MIT · https://github.com/parcadei/Continuous-Claude-v3/tree/HEAD/.claude/skills/dead-code/SKILL.md

## Similar
- [vulture-dead-code](https://affpapa.org/en/nevibecode/skills/vulture-dead-code.md) — skill · 311 installs
- [simplify-code](https://affpapa.org/en/nevibecode/skills/simplify-code.md) — skill · 345 installs
- [unused-code-cleaner](https://affpapa.org/en/nevibecode/agents/unused-code-cleaner.md) — subagent · 1990 installs
- [fallow](https://affpapa.org/en/nevibecode/skills/fallow.md) — skill · 9600 installs
- [refactor](https://affpapa.org/en/nevibecode/skills/refactor.md) — skill · 22321 installs
- [refactor-safely](https://affpapa.org/en/nevibecode/skills/refactor-safely.md) — skill · 1100 installs

From the same set: [parcadei/continuous-claude-v3](https://affpapa.org/en/nevibecode/by/parcadei/continuous-claude-v3.md) — 69 cards

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
