Code Health
Tech Debt Cleanup
A daily janitor that finds one provably safe cleanup in your codebase and lands it as a PR.
Moderate setupShort cycleOpen loopBuilds over runs
How a run flows
On schedule
Every day · 7am
Step 1 · Survey
Find housekeeping debt
Step 2 · Prove
Pick one, prove it safe
Isolated git worktree · off main
Step 3 · Fix
Smallest change
Step 4 · Ship
Open a PR
Board
Cleanup board
Metric
Cleanups landed
open loop — repeats on the next tick, picking up where it left off
How this loop works
- Suggested schedule
- Daily · ~7am
- Loop type
- Open loop — an ongoing monitor with no finish line.
- Exit condition
- Runs indefinitely (no finish line).
- Notifications
- On by default — you're alerted on each run's outcome (completion or failure). Silence with notify: never.
- Ease of starting
- Some setup and context are needed before the first useful run.
- When you see value
- One proven cleanup a day; the codebase gets visibly tidier over a week or two.
The prompt this runs
Set up a daily loop that keeps this codebase tidy, one proven cleanup at a time. Every morning around 7am my local time, survey for housekeeping debt - dead code, stale files and comments, unused dependencies, duplication, inconsistent names - while protecting active, uncommitted, generated, and uncertain work. Pick one candidate, prove it genuinely low-risk with concrete evidence before touching it, then make the smallest coherent change in a fresh git worktree off the main branch and located outside the loop folder - the loop folder is a synced content home, not a workspace - so neither my working checkout nor the sync is polluted, and keep it only if the build, tests, and runtime checks stay green. Open a pull request - but if a previous Housekeeper PR is still open (unmerged), don't open another one that day; just refresh the existing PRs' statuses. Uncertain candidates go into a deferred-candidates file, listed, never deleted. Track each cleanup PR as a markdown card with front matter `type: open` or `type: merged`, and report cleanups landed as a daily metric. Set up the loop's dashboard at creation: a kanban of the cleanup cards plus a chart of cleanups landed over time.
This is the exact intent appended to the bootstrap when you create the loop — your coding agent reads it, then proposes cadence and config and confirms with you before creating anything.