.claude/skills/review-dead-code/SKILL.md
Find and plan removal of dead code (unused functions, variables, unreachable paths)
npx skillsauth add cwilliams5/Alt-Tabby review-dead-codeInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Enter planning mode. Systematically audit the codebase for dead code and write a removal plan.
This project has changed significantly over time. Find code that is no longer serving a purpose: unused functions, unread variables, unreachable branches, orphaned helpers. Use maximum parallelism — spawn explore agents for independent areas of the codebase.
SetTimer)return, throw, or ExitApp#Include files whose exports are entirely unusedsrc/lib/ (third-party code — excluded from analysis)Use the query tools to validate findings — do NOT rely on grep alone:
query_function_visibility.ps1 <funcName> — authoritative caller list (public/private, all call sites)query_global_ownership.ps1 <globalName> — who declares, writes, and reads a globalquery_interface.ps1 <filename> — public surface of a file (spot unused exports)query_visibility.ps1 — lists public functions with 0 or 1 external callers (direct dead code signal)query_includes.ps1 — include tree for finding orphaned #Include files whose exports are entirely unusedFor each candidate:
file.ahk lines X–Y" with the actual code. Vague references without quoting code are not sufficient.Split the codebase into independent zones and explore in parallel:
src/gui/ — GUI rendering, state machine, overlaysrc/core/ — Producers (WinEventHook, Komorebi, pumps)src/shared/ — Window list, config, IPC, blacklist, themesrc/editors/ — Config/blacklist editorssrc/pump/ — EnrichmentPump subprocesssrc/ files — Entry points, launcher, installation, updateAfter explore agents report back, validate every finding yourself before including it in the plan. Explore agents sometimes identify issues that are handled elsewhere in a larger context. Read the cited lines, trace the usage, and confirm it's genuinely dead.
Group findings by file. For each item:
| File | Lines | What | Evidence | Counter-argument |
|------|-------|------|----------|-----------------|
| file.ahk | 42–58 | _UnusedHelper() — 0 callers | query_function_visibility.ps1 shows no call sites | None — private function, safe to remove |
Then list the removals as action items. Order by risk (safest first). Note any removals that should be tested together because they're interdependent.
Ignore any existing plans — create a fresh one.
tools
Create a new git worktree and switch the session into it
tools
Spawn agent to trace code flow via query tools — answer only, no context cost
tools
Commit, push, and create a PR for the current branch
tools
Retire a shader by moving its files to legacy/shaders_retired