Auto Fix
Classifies runtime failures, locates root cause in the codebase, implements a targeted fix, runs tests, and redeploys. Full autonomous loop. No manual steps.
How It Works
- Bug report / failing service: Logs, errors, or a red health check
- Read logs & health endpoints: Surface the failure signal before any hypothesis
- Classify the failure: Crash · leak · dependency · config · network
- Locate root cause: Trace through wrappers to the originating line
- Implement targeted fix: Minimal change — no refactor, no architecture
- Test → redeploy → verify: Run tests, redeploy, re-check health & logs
- Incident report + PR: Timeline + 1 prevention rec → .incidents/{slug}.md
Invocation Triggers
/auto-fixauto fixruntime errorservice is brokenfix this automaticallyUse Cases
- Resolve a runtime crash or service failure without manual diagnosis
- Classify a failure type and trace root cause to the exact file and line
- Get an incident report with timeline and one prevention recommendation
The Problem
Your service fails at 2am. By morning it has been down for 6 hours. You spend an hour finding the cause, writing a fix, deploying, and verifying. The failure was 6 lines of code — but the diagnosis took 50 minutes. Runtime failures compound every minute they run. The cost is not the bug. It is the time between detection and fix.
What It Does
- 1Connect to logs and health endpoints
Reads recent error output, service status, and health check results. Surfaces the failure signal before any hypothesis is formed.
- 2Classify the failure
Crash / memory leak / dependency failure / config issue / network error. Each category has a different resolution path — classification determines where to look next, not just what the stack trace says.
- 3Locate root cause in codebase
Searches for the specific error pattern, reads the responsible code, traces to the actual failure point. Not just the stack trace surface — through indirection, through wrappers, to the originating line.
- 4Implement targeted fix
Minimal change. No refactoring. No architectural changes. Exactly what is needed to resolve the classified failure and nothing else.
- 5Test, redeploy, verify
Runs tests first, then redeploys, then checks health endpoints and logs to confirm recovery. Produces an incident report with timeline and one prevention recommendation — written to .incidents/{slug}.md.
What You Get / What It Doesn't Do
- Failure classified with confidence (crash / memory / dep / config / network)
- Root cause located with file:line reference
- Fix implemented and tested before deploy
- Service restored with health check evidence
- Incident report with timeline and one prevention recommendation
- Monitor continuously — trigger it on a specific failure
- Fix infrastructure or cloud-level issues (those require provider access)
- Make architectural changes or refactor unrelated code
- Handle failures that require a product decision
Tips
Vague symptoms produce vague diagnoses. Give it an error message, a log line, or a health check URL — not "something feels slow."
If this failure pattern appeared before, the fix may already be documented. /auto-fix checks lessons.md automatically before starting diagnosis.
Each run writes to .incidents/{slug}.md and lessons.md. Over time, your pattern recognition gets sharper. The fifth auto-fix is faster than the first.
Get the Skill
Unlock the full Auto Fix SKILL.md — drop it into ~/.claude/skills/ and trigger it by name.
- Failure classified with confidence (crash / memory / dep / config / network)
- Root cause located with file:line reference
- Fix implemented and tested before deploy
- Service restored with health check evidence
Commonly Used With
29 more production skills ready to install.