dead-code-sweep
Skill1 starsChanged 12 days agoMITView on GitHub
Prove code unconsumed before deleting — and unnecessary.
3 other projects use a version of this.
Adopted by
Most recently taken up by
- tejastn10/workbenchtheir own version, first seen Oct 13, 2026
- ceptln/quota-burnertheir own version, first seen Sep 8, 2026
- ccpowerpack/claude-code-skillstheir own version, first seen Jul 3, 2026
Other versions3 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 3
- ceptln/quota-burner★ 18same name
- tejastn10/workbench★ 1same name
- ccpowerpack/claude-code-skills★ 0same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository10 other files it gives its agents.
- agent-regressionSkill
- dedup-sweepSkill
- hermes-cron-stuck-job-recoverySkill
- live-probeSkill
- measure-firstSkill
- probe-firstSkill
- prose-hygieneSkill
- repo-organizeSkill
- verbose-code-trimSkill
- verification-gatesSkill
The file
We split this skill into the rules it gives an agent
4 rules. 0 are common, 3 are distinctive, and 1 is very specific to this project.
0
Common
Most of the 3 edited versions we read keep these.
3
Distinctive
This author's own choices. Worth a look.
1
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 36
Don't use for: features behind flags scheduled for enable, plugin/extension surfaces consumed externally (check the ecosystem, not just the …
- Distinctive: line 47
Check the indirect consumption vectors: before trusting zero: string references (dynamic dispatch, DI registration, reflection), …
- Very specific: line 50
Delete in one commit per tier-1 batch: Run the full suite before and after (verification-gates Gate 2).
- Distinctive: line 68
Completion criterion: every deletion has its consumption proof recorded (zero references, or the necessity analysis).
“Common” is measured: kept by at least 6 in 10 of the 3 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Dead Code Sweep
Find and remove code nothing needs — in two escalating proofs. Most dead-code checks stop at "has zero references." Real cleanup starts there:
- Unconsumed — nothing references it (the easy proof).
- Unnecessary — it's referenced but shouldn't be: wrappers that only forward calls, compatibility APIs kept for history, defensive branches hiding impossible states, stale defaults, duplicate state sources, public surfaces nobody should depend on.
Adapts the used-vs-necessary distinction of danhuaxiansheng/claude-code-cleanup-skills (MIT) with this library's baseline gates: every deletion lands with the suite proven green before AND after.
When to Use
- Post-refactor residue: old paths a migration left behind
- "Is this module still needed?" — audits before big refactors
- Wrappers/compat layers that only exist because other wrappers exist
- Review comments: "nobody calls this anymore" — verify, then delete
Don't use for: features behind flags scheduled for enable, plugin/extension surfaces consumed externally (check the ecosystem, not just the repo), or anything exported by a public API contract (semver constraints).
Procedure
Tier 1 — Unconsumed:
- Enumerate candidates — exports, functions, files, components, types:
search_filesfor each identifier; vulture/knip/language-native analyzers for breadth. Record every reference site. - Check the indirect consumption vectors before trusting zero: string references (dynamic dispatch, DI registration, reflection), re-exports, test fixtures, codegen targets, scripts/CI files, documentation examples.
- Delete in one commit per tier-1 batch. Run the full suite before and
after (
verification-gatesGate 2). Lint the touched files.
Tier 2 — Unnecessary (referenced but hollow):
- Wrapper audit: a function that only forwards calls with no added value (no validation, no defaults, no logging, no naming) — inline it. One exception: intentional seams for testing or future dispatch.
- Compatibility audit: APIs kept "for history" with zero external consumers — delete with the changelog note, or file for a deprecation cycle if the repo is a library.
- Defensive-branch audit: branches guarding impossible states (post- validation re-validation, can't-happen type checks). Prove impossibility from the call graph before removing — if the proof needs a comment longer than the branch, keep the branch.
- Duplicate state: two sources claiming the same fact — one becomes canonical, the other derived or deleted.
Completion criterion: every deletion has its consumption proof recorded (zero references, or the necessity analysis); suite green before/after; nothing behind a public-API contract was touched without a deprecation note.
Pitfalls
- Dynamic references are invisible to grep: string-keyed dispatch,
reflection, DI containers,
__getattr__, codegen. Search strings too. - "Referenced" ≠ "needed": tier 2 is where the real debt lives — but it's also where wrong deletions hurt. Prove necessity per finding, never batch-delete tier 2.
- External consumers: plugins, extensions, downstream forks. A public export's reference count inside the repo proves nothing about the world.
- Test-only consumers count as dead-adjacent: a function only tests exercise is a candidate for deletion WITH its tests — but only after confirming no production path was about to adopt it.
Verification
Runnable check: full suite before and after each deletion batch, plus a reference re-scan of the deleted identifiers:
search_files --pattern '<deleted-identifier>' . # expect: zero non-history hitsExpected: suite green both sides; re-scan returns zero live references (git history/changelog hits don't count).
Evidence to capture: per-batch before/after suite outputs, the consumption proofs, and the post-delete re-scan.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

