Dead code cleanup for AI-built codebases
The idea
AI-assisted coding has an exhaust problem: every session that tries three approaches ships one and abandons two, leaving orphan components, duplicate utilities and dependencies nobody imports. Repos built heavily with Cursor or Claude Code accumulate this exhaust at a rate hand-written code never did, until the codebase is unnavigable and the AI itself starts editing the wrong copy of Button.tsx.
Knip already solves classical dead-code detection for people willing to configure it, which is precisely the boundary of the opportunity: the people drowning in AI exhaust are the people who will never write a knip config. The wedge is zero-config whole-repo analysis with framework-convention entry-point detection, plus near-duplicate component detection, which classic dead-code tools do not attempt and which is the signature failure mode of generated code. Delivering the result as reviewable deletion PRs, not a report, closes the loop.
Who pays
The buyer is a solo founder or small startup whose repo is largely AI-generated, paying 19 to 49 dollars a month; the free read-only scan is the hook, because the headline number (14 percent of your repo is unreachable) sells the subscription. Distribution lives where vibe-coders live: build-in-public Twitter, Cursor and Claude Code communities, and shareable scan-result cards.
MVP scope
- Zero-config import-graph analysis via ts-morph with framework-aware entry-point detection
- Findings for unreferenced files, unused exports and unimported dependencies, with confidence levels
- Near-duplicate React component detection with side-by-side diffs
- Selected findings turned into deletion PRs chunked at 15 files, each with per-item justification
- Free read-only scan, paid PR creation via Stripe
- Skip for v1: languages beyond TypeScript/JavaScript, auto-merging, CSS and asset dead-weight, scheduled rescans
Build Sweeper, a web app that finds dead code in TypeScript/React repos and opens deletion PRs. Stack: Next.js (App Router) dashboard, analysis worker using ts-morph, GitHub App for repo access and PR creation, Stripe for billing, Postgres for results. Core flow: user installs the GitHub App, picks a repo, and a worker clones it and builds a full import graph with ts-morph. Zero configuration is the product constraint: auto-detect entry points from framework conventions (Next.js app/ and pages/ routes, package.json main/exports and bin, config files like tailwind.config, test globs) rather than asking for config. From the graph, flag three categories: unreferenced files, exported symbols never imported anywhere, and package.json dependencies never imported. Near-duplicate detection, the differentiator: for React components, compare normalised structures (strip identifiers and literals, hash the JSX element tree and props shape) and flag sets above 85 percent similarity, e.g. three slightly different Button.tsx files, showing a side-by-side diff of each pair. Guard rails: treat dynamic import strings and template-literal requires as references; mark anything matched only by string search as low confidence and never auto-include it in a PR. Findings page groups results by directory with confidence badges. User ticks findings and clicks Open PR; Sweeper creates a branch deleting the selected files/exports, chunked into PRs of at most 15 files so review stays sane, each PR body listing why every item is believed dead. Pricing: free scan with read-only findings, 29 dollars a month to open PRs, 49 for unlimited repos.
// More Dev tool ideas
-
Deprecation countdowns for the APIs you use
Stripe and Shopify deprecations hide in changelogs until things break; this scans your code for affected calls and gives you a countdown.
Dev tool 1 month -
App store reviews filed as GitHub issues
Bug reports buried in app store reviews never reach the tracker; this clusters new reviews and files deduped GitHub issues nightly.
Dev tool 1 week -
Nightly restore drills for database backups
A backup you've never restored is a guess; this restores your Postgres dump to a scratch instance nightly and proves the data is intact.
Dev tool 1 week -
Hosted monitoring and alerts for BullMQ queues
A stuck BullMQ queue can silently eat jobs for days; hosted dashboards, dead-letter alerts and retry controls without running Grafana.
Dev tool 1 week