Let Your AI Fix Its Own Broken Automation: Building an Unattended Watchdog A developer built an unattended watchdog system that lets an AI detect, repair, and verify broken automation scripts, pushing changes to production only when verification passes. The system, called self-repair.sh, uses separate health and verification scripts to prevent the AI from committing broken fixes or secrets. The key design principle is to never trust the AI's self-report and instead run an independent verification step before deploying any changes. If you ship enough side projects, something in your automation is always quietly on fire — and you usually find out days too late. This is the next installment in my "automation foundation for mass-producing side projects" series, following "How I split Claude Code's memory into four layers" and "Running Claude Code and Codex together on one machine." This time I'll walk through the design and implementation of an unattended watchdog that lets an AI detect, repair, and verify broken automation scripts, and pushes changes to production without approval only when verification passes . Using real code as the anchor, I'll explain how to stack guardrails so the AI runs safely instead of "rampaging without limits." When you mass-produce side projects, the number of always-on automation scripts keeps growing. Auto-posting affiliate articles, scrapers, delivering briefs to Discord, checking the review status of iOS apps. Each runs under launchd or cron, so when one breaks, days can pass without anyone noticing . Monitoring and fixing everything by hand hits its limit quickly. But just "letting the AI fix it" carries risks: unintended code rewrites, committing secrets, or reporting a repair as done when it's actually still broken and pushing that to production. So I designed self-repair.sh . The idea is simple. Detect → Claude identifies the cause and fixes it → the watchdog independently runs verify → commit/push/deploy only when it passes → roll back the edits and notify a human if it fails Don't trust Claude's self-report is the key point. Even if Claude says "I fixed it," the watchdog runs the verification script itself, and reflects the change only when it exits 0. The files are laid out like this. ~/.claude/self-repair/ ├── registry.tsv list of monitored projects ├── checks/ │ ├──