Code Health
Error Sweep
A daily reliability pass that traces your real production errors to root cause and opens a PR per verified fix.
Moderate setupShort cycleOpen loopVisible first run
How a run flows
Before first run
Verify an error source
On schedule
Every day · 6am
Step 1 · Sweep
Group into incidents
Step 2 · Triage
Actionable vs. noise
Isolated git worktree · off main
Step 3 · Fix
Root-cause & fix
Step 4 · Ship
One PR per fix
Report
Newest report
Metric
Actionable errors
open loop — repeats on the next tick, picking up where it left off
How this loop works
- Suggested schedule
- Daily · ~6am
- 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
- As soon as real production errors exist, the first sweep root-causes them into PRs.
The prompt this runs
Set up a daily loop that sweeps this project's production errors. Before creating anything, verify a concrete way to read them exists on this machine - logs, an error tracker, a URL, or gh - smoke-test it once, propose the source and sweep window, and confirm it with me; never create a blind loop. Every morning around 6am my local time, sweep the agreed window, group repeated symptoms into incidents, and separate actionable errors from noise and upstream failures. Trace each to root cause, make the smallest verified fix 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; open one pull request per fix, never while a previous Error Sweep PR is unmerged. Never copy credentials, tokens, or personal information into reports or PRs. Write one dated report per run with front matter `type: report`, a `title`, and `date`; report the actionable-error count as a metric; nothing actionable is a clean stop. Set up the loop's dashboard at creation: an embed of the newest report plus a chart of that count.
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.