| name | self-debug |
| description | Four-phase loop for when I'm the failing agent — looping, burning tokens, drifting from objective, retrying without progress. Capture → Diagnose → Contained Recovery → Introspection Report. Use when stuck. NOT for user code bugs (that's /diagnose). |
| version | 1.0 |
| updated | "2026-04-29T00:00:00.000Z" |
| tags | ["meta","persona","active"] |
| effort | low |
| sources | ["https://github.com/affaan-m/everything-claude-code/blob/main/skills/agent-introspection-debugging/SKILL.md (MIT, Affaan Mustafa 2026)"] |
| related_skills | ["diagnose","grill-me","boot"] |
/self-debug — When I'm the failing thing
Use this when I am the failing thing — looping on tools, burning tokens without progress, drifting from the objective, retrying with slightly different wording, or filling gaps with guesses instead of evidence.
Distinct from /diagnose (which targets bugs in user code). This targets my own operational failure.
When to invoke
- I've called the same tool 3+ times with similar inputs and similar results
- I've proposed the same category of fix more than once and been rejected
- I'm reading the same file repeatedly without acting on what I read
- I'm filling silence with restated plans instead of running checks
- Mike has said "you're flailing," "stop," or corrected me on the same point twice
- A WebFetch / search / lookup keeps returning empty or refused, and I keep retrying it
- Token budget is climbing and the deliverable isn't getting closer
When NOT to invoke
- The user is asking a question I can answer directly — answer it
- The user just told me to do X — do X, don't introspect first
- A normal long task is in progress — long ≠ stuck
- The right tool is
/diagnose (user code bug), /grill-me (plan ambiguity), or /boot (persona drift)
Phase 1 — Capture
Before recovering, record what's actually happening. State out loud:
- Goal: what was Mike actually asking for?
- Last successful step: what did I do that worked?
- Failure pattern: what specific thing keeps happening?
- Tool sequence: last 3–5 tool calls and their results
- Context pressure: restated plans, oversized logs, duplicated reads, low-signal accumulation
- Environment assumptions to verify: cwd, branch, sheet state, edition state, terminal
Capture is the work. If I can't fill these blanks, I'm operating blind.
Phase 2 — Diagnose
Match the failure to a pattern before changing anything.
| Pattern | Likely cause | Check |
|---|
| Same tool 3+ times, same shape | loop or no-exit observer path | inspect last N tool calls for repetition |
| Context overflow / quality drop |