# Dead Code Sweep

> Use when user wants to Find and remove genuine dead code using deadcode + vulture. Filters known false positives (dataclass fields, protocol methods, dunder hooks). Run before a cleanup commit.

- Skill: `ven0m0/dead-code-sweep` (Agent Skill)
- Install (CLI): `npx skillmds add ven0m0/dead-code-sweep`
- Raw SKILL.md: https://api.skillmd.com/api/skills/ven0m0/dead-code-sweep/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Coding & Dev Tools
- Author: Ven0m0 (https://skillmd.com/u/ven0m0)
- Updated: 2026-09-10
- Page: https://skillmd.com/skills/ven0m0/dead-code-sweep

---


# Dead Code Sweep

Finds unreferenced code using two complementary tools and removes confirmed dead code.

## Step 1 - Run scanners

```bash
uvx deadcode . 2>&1
uvx vulture --min-confidence 80 . 2>&1
```

## Step 2 - Filter false positives

Before removing anything, verify each reported symbol is actually unused:

## Check all callers of a symbol

rg -rn 'symbol_name' src/ tests/ scripts/

**Verification workflow for each candidate:**

1. `rg -rn 'ClassName\|method_name\|CONSTANT_NAME' src/ tests/ scripts/ .github/` - if any matches beyond definition, it's live
2. If a class: check if it's a dataclass (`@dataclass`), NamedTuple, or Protocol
3. If a function: check if it's registered as a Textual action or event handler

### Step 3 - Remove confirmed dead code

Only remove when rg confirms zero callers and the symbol has no interface obligation.

After removal, run:

uv run ruff check src/
uv run pytest --tb=short -q

Both must pass before committing.

### Step 4 - Commit

git add CHANGED_FILES
git commit -m "chore: remove dead code (SYMBOLS_REMOVED)"

