Start your first response with the ✂️ emoji.
Absolute Prune
Cut dead growth from the repo: unused dependencies, unreferenced exports, unreachable code,
orphaned files. Evidence-based — every removal is backed by a tool that proves nothing
references it — applied in safe waves with tests green after each.
Runs the shared engine in references/health-engine.md — read it for the
DETECT → SCAN → TRIAGE → FIX → VERIFY → REPORT loop and the safety contract. This file
covers only what's specific to pruning.
When to use
- "Remove dead code", "clean up unused deps", "what can we delete?".
- Bundle/install bloat from packages nothing imports anymore.
- Post-refactor orphans: files and exports left behind after a feature was rerouted.
prune vs simplify: simplify polishes your working git diff. prune sweeps the
whole committed repo for things that are dead repo-wide. Use simplify mid-change;
prune as standing cleanup on green main.
What it scans
Dead dependencies — declared but never imported (and missing deps that are imported but
undeclared):
| Ecosystem |
Tool |
| JS/TS |
depcheck or knip (knip also covers exports/files) |
| Python |
deptry |
| Go |
go mod tidy (diff), unused module detection |
Dead code — unreferenced exports, unreachable branches, orphaned files:
| Ecosystem |
Tool |
| JS/TS |
knip (exports/files), ts-prune, eslint no-unused-vars |
| Python |
vulture, ruff unused rules |
| Go |
deadcode ./..., staticcheck (U1000) |
Prefer tools already in the project. Treat results as candidates — verify each isn't
reached via dynamic import, reflection, DI, public API, or a config string before removing.
Risk ranking (TRIAGE)
| Wave |
Removal |
Default |
| 1 |
unused devDeps, unreferenced local exports/functions |
fix now — lowest risk |
| 2 |
unused runtime deps, orphaned internal files |
fix this pass after confirming no dynamic ref |
| 3 |
anything reachable via public API, plugin system, dynamic require, reflection, or config |
gated / usually defer — high false-positive risk |
Static tools miss dynamic references. Anything in wave 3, or anything a tool flags but you
can't prove is dead, gets confirmed with the user or deferred — never auto-removed.
Fix & verify
- Remove in small, reversible waves. One category per wave (e.g. "unused devDeps", then
"orphaned files").
- After each wave: full test + build + typecheck. A green typecheck/build is the proof the
removed symbol truly had no references. If anything goes red, the symbol wasn't dead —
revert and reclassify.
- Removing a dep: drop it from the manifest, regenerate the lockfile, rebuild.
- Don't delete: generated files, vendored code, public-API surface, or anything load-bearing
for a config/plugin you can't trace. Report those as "suspected dead, needs human call".
Treat
preferences.health.protectedPaths from config as never-delete globs — anything
matching is out of scope even if a tool flags it.
Gotchas
- Trusting the tool blindly. Dynamic imports, DI containers, reflection, and string-keyed
lookups defeat static analysis. Confirm before deleting.
- Removing public API. A library's unused-internally export may be its whole point. Check
the package entry points /
exports map.
- Deleting generated or vendored files. They look orphaned but are rebuilt/checked-in on purpose.
- Big-bang prune. Deleting everything flagged in one commit makes regressions un-bisectable.
Wave it.
- Scope creep into refactor.
prune removes dead things; it does not restructure live code.
Restructuring → simplify or work.
Companion commands
/absolute simplify — for restructuring/clarity of live code in your diff.
/absolute upgrade — pairs well: prune unused deps, then upgrade what remains.
/absolute debt — pruning often clears a batch of lint/unused-var warnings too.
1---2name: absolute-prune3description: Dead code and dependency cleanup, repo-wide: unused deps, unreferenced exports, unreachable code, orphaned files — removed only with tool evidence, in reversible waves. Runs on green main. For diff-scoped cleanup use absolute-simplify. Triggers on "absolute prune", "remove dead code", "find unused deps/exports", "what can we delete", "clean up orphaned files".4license: MIT5---67> Start your first response with the ✂️ emoji.89## Absolute Prune1011Cut dead growth from the repo: unused dependencies, unreferenced exports, unreachable code,12orphaned files. Evidence-based — every removal is backed by a tool that proves nothing13references it — applied in safe waves with tests green after each.1415Runs the shared engine in **`references/health-engine.md`** — read it for the16DETECT → SCAN → TRIAGE → FIX → VERIFY → REPORT loop and the safety contract. This file17covers only what's specific to pruning.1819---2021## When to use2223- "Remove dead code", "clean up unused deps", "what can we delete?".24- Bundle/install bloat from packages nothing imports anymore.25- Post-refactor orphans: files and exports left behind after a feature was rerouted.2627**`prune` vs `simplify`:** `simplify` polishes *your working git diff*. `prune` sweeps the28**whole committed repo** for things that are dead repo-wide. Use `simplify` mid-change;29`prune` as standing cleanup on green `main`.3031---3233## What it scans3435**Dead dependencies** — declared but never imported (and missing deps that are imported but36undeclared):3738| Ecosystem | Tool |39|---|---|40| JS/TS | `depcheck` or `knip` (knip also covers exports/files) |41| Python | `deptry` |42| Go | `go mod tidy` (diff), unused module detection |4344**Dead code** — unreferenced exports, unreachable branches, orphaned files:4546| Ecosystem | Tool |47|---|---|48| JS/TS | `knip` (exports/files), `ts-prune`, `eslint no-unused-vars` |49| Python | `vulture`, `ruff` unused rules |50| Go | `deadcode ./...`, `staticcheck` (U1000) |5152Prefer tools already in the project. Treat results as *candidates* — verify each isn't53reached via dynamic import, reflection, DI, public API, or a config string before removing.5455---5657## Risk ranking (TRIAGE)5859| Wave | Removal | Default |60|---|---|---|61| 1 | unused devDeps, unreferenced *local* exports/functions | fix now — lowest risk |62| 2 | unused runtime deps, orphaned internal files | fix this pass after confirming no dynamic ref |63| 3 | anything reachable via public API, plugin system, dynamic require, reflection, or config | **gated / usually defer** — high false-positive risk |6465Static tools miss dynamic references. Anything in wave 3, or anything a tool flags but you66can't *prove* is dead, gets confirmed with the user or deferred — never auto-removed.6768---6970## Fix & verify7172- Remove in small, reversible waves. One category per wave (e.g. "unused devDeps", then73 "orphaned files").74- After each wave: full test + build + typecheck. A green typecheck/build is the proof the75 removed symbol truly had no references. If anything goes red, the symbol wasn't dead —76 revert and reclassify.77- Removing a dep: drop it from the manifest, regenerate the lockfile, rebuild.78- Don't delete: generated files, vendored code, public-API surface, or anything load-bearing79 for a config/plugin you can't trace. Report those as "suspected dead, needs human call".80 Treat `preferences.health.protectedPaths` from config as never-delete globs — anything81 matching is out of scope even if a tool flags it.8283---8485## Gotchas86871. **Trusting the tool blindly.** Dynamic imports, DI containers, reflection, and string-keyed88 lookups defeat static analysis. Confirm before deleting.892. **Removing public API.** A library's unused-internally export may be its whole point. Check90 the package entry points / `exports` map.913. **Deleting generated or vendored files.** They look orphaned but are rebuilt/checked-in on purpose.924. **Big-bang prune.** Deleting everything flagged in one commit makes regressions un-bisectable.93 Wave it.945. **Scope creep into refactor.** `prune` removes dead things; it does not restructure live code.95 Restructuring → `simplify` or `work`.9697---9899## Companion commands100101- **`/absolute simplify`** — for restructuring/clarity of *live* code in your diff.102- **`/absolute upgrade`** — pairs well: prune unused deps, then upgrade what remains.103- **`/absolute debt`** — pruning often clears a batch of lint/unused-var warnings too.