Skip to main content
skill CX Codex

dead-code — Claude Code skill: find unused code

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

Install into Claude Code · Skills CLI (Vercel) All methods and platforms ↓
npx skills add parcadei/Continuous-Claude-v3 --skill dead-code -a claude-code
Open on GitHub

What dead-code 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.

What it helps with

  • 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 for the agent

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

How to install dead-code

1Skills CLI (Vercel)

npx skills add parcadei/Continuous-Claude-v3 --skill dead-code -a claude-code

2Manually: put the files in place

~/.claude/skills/dead-code/SKILL.md

Copy the whole skill folder; for one project use .claude/skills/dead-code/

Step by step, with commands for each platform: How to install skills in Claude Code: five ways

Questions about dead-code

How do I install dead-code in Claude?

Run npx skills add parcadei/Continuous-Claude-v3 --skill dead-code -a claude-code. The skill lands in ~/.claude/skills/dead-code/SKILL.md.

What does dead-code do?

It finds unused functions and dead code through TLDR static analysis, listing the file and line for every hit.

How is the skill different from the session-start-dead-code hook?

The hook ran the analysis automatically at session start and cost 3 seconds of startup time. The skill does the same work, but only when you ask for it.

Source text

SKILL.md · MIT
---
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
```

© parcadei · MIT · parcadei/Continuous-Claude-v3

Similar skills

Everything for Code review and refactoring →

From the same set69

Project sponsors

Companies that keep this analytics open
Gold sponsor

Impressions, clicks and code copies — open statistics. We keep the numbers public for the same reason NeBlask itself is public. Become a sponsor