Agent code leftover cleanup checker
Problem
Developers using AI coding agents report a recurring failure mode: when an agent changes implementation approach mid-task, it writes new code but rarely removes the abandoned code, leaving stale branches, unused helpers, redundant logic and dead data fields. After a few iterations the codebase works but is polluted with leftovers nobody has time to untangle.
Opportunity
A tool that hooks into the agent workflow (git commit / PR stage) and diffs what the agent changed versus what it abandoned, flagging and auto-removing dead code from rejected approaches — dead-code detection specialized for AI agent edit sessions rather than legacy codebases.
Market analysis
Real and growing pain, but generic dead-code tooling is already pivoting to serve it: Fallow (Rust CLI) ships agent skills and CI integrations explicitly marketed against AI code slop, and Codegen sells automated dead-code deletion PRs. The defensible wedge is session-scoped analysis — diffing what the agent abandoned during an edit session — rather than whole-repo static analysis.
Market · AI-agent-first developers and teams; dev-tooling segment with strong organic demand signal (dead code polluting agent context is a widely repeated complaint).
Pricing · Free/OSS comparables (Fallow CLI) cap willingness to pay; realistic ceiling is a small team SaaS or GitHub Action in the $10-20/dev/month range.
Pros
- + Clearly felt pain that worsens with every agent iteration.
- + Session-scoped abandonment diffing is a genuine technical differentiator vs whole-repo linters.
- + Natural git-hook / CI distribution channel.
Cons
- − Fallow already covers much of the surface for free, with first-party agent skills.
- − False-positive risk: distinguishing 'abandoned' from 'upcoming work' is hard without agent telemetry.
- − Best results require hooking the agent loop itself, which varies per tool.
Existing / similar tools
Source
Hacker News (Ask HN)
The subtle trap here is that generic dead-code detection and abandonment detection are different problems. A linter sees the final tree; it cannot tell whether an unused helper is leftover from a rejected approach or scaffolding for the next commit. Getting that judgment right requires access to the agent’s edit history — which means the product really is an agent-session analyzer, not a fancier knip. The strongest moat would be a persistent per-session memory of what the agent tried and discarded, surfaced as a pre-commit gate; without that, you are competing with free static analysis on accuracy alone.