Functions, branches, fields, or imports that no static analysis or human reader can reach — last commented out, last touched years ago, or referenced only by code that itself was removed.
The agent finds code (functions, branches, fields) with no inbound references the type system or grep can locate; reasoning about reachability requires assuming static analysis is complete.
Every line in the codebase is reachable and used; readers don't waste cycles on phantom branches.
Every definition the agent encounters is reachable; reasoning about behavior doesn't have to consider phantom paths.
Before the refactoring
function legacyDiscount(order) { /* unused since 2018 */ }function modernDiscount(order) { /* the real one */ }
After the refactoring
function discount(order) { /* the real one */ }
Readers spend cycles understanding code that never runs; debuggers stop in places that look meaningful but aren't; refactoring proposals have to consider phantom users.
The agent's plan-and-execute loop has to consider dead branches as live until proven otherwise; tests pass while code-walking analyses include dead surface area.
The team gives up the option to revive without a git dive — and 'dead' under static analysis can still be reachable via reflection, dynamic dispatch, or external callers.
Deletion is one-way under static analysis but reachability can hide in reflection, dynamic dispatch, external callers, or runtime config — the agent that deletes without checking risks a regression nothing catches.
Smaller surface, faster reading, fewer false leads when debugging.
Dead tokens no longer load with the surrounding code; static analysis returns a complete picture because every branch in the window represents code that runs, and the agent edits against the reachable shape instead of paying tokens for paths that fire never.
Deleting code that looks dead but is reached via reflection, dynamic dispatch, external callers, or test fixtures — the cleanup ships a regression because static analysis lied.
Aggressive deletion based purely on grep/static-analysis evidence misses reflection-reachable, plugin-loaded, or externally-referenced code — the cleanup ships a silent regression the agent's tests don't catch.