Debugging with Escalation
Process
Phase 1: Understand Before Fixing
Do NOT propose a fix until you have:
- Read the complete error message (full stack trace, exit code, line numbers)
- Identified the failing line and the actual vs expected values
- Traced backward through the call stack to find the origin of the bad value
- Checked recent changes (
git diff) that might have caused it
If the user reports an error: Ask for specific input/output before guessing.
Phase 2: Single Hypothesis
- Form ONE hypothesis: "I think X happens because Y"
- Test with the SMALLEST possible change
- Verify: did it work? Check the actual output.
- If it didn't work, form a NEW hypothesis — do NOT layer another fix on top
Phase 3: Escalation
Track your fix attempts. After each failed attempt, note what you tried and why it failed.
After 3 failed fix attempts: STOP.
This means your mental model is wrong. Do not attempt a 4th fix. Instead:
- Summarize what you've tried and why each failed
- State what this tells you about the actual problem
- Ask: "This might be an architectural issue rather than a simple fix. Here's what I've found — how do you want to proceed?"
Escalation Signals from User
If the user says any of these, change your approach IMMEDIATELY:
- "Stop guessing"
- "That's not it"
- "Try something different"
- "Why does this keep happening?"
- Any sign of frustration with repeated attempts
When you hear these: stop, summarize findings, ask for direction.
Logging (MANDATORY)
When invoked, and on escalation (3rd failure), log via Bash:
echo '{"ts":"'$(date -u +%Y-%m-%dT%H:%M:%SZ)'","skill":"debug-escalation","project":"<project>","attempt":<1|2|3>,"escalated":<true|false>,"task":"<brief description>"}' >> ~/vault/logs/workflow.jsonl
Example Walkthrough
Error: TypeError: Cannot read properties of undefined (reading 'map') at Dashboard.tsx:42
Phase 1 (Understand):
- Line 42:
data.items.map(...)—datais defined butdata.itemsis undefined - Check the API response shape — the endpoint returns
{ results: [...] }, not{ items: [...] } git diffshows the API was recently changed fromitemstoresults
Phase 2 (Hypothesis):
- Hypothesis: "The frontend still expects
itemsbut the API now returnsresults" - Smallest fix: change
data.itemstodata.resultson line 42 - Run the app → works
If instead the fix didn't work, form a NEW hypothesis — don't add a fallback on top.
Anti-Patterns
| Pattern | Fix |
|---|---|
| Stacking fixes without verifying each | One change at a time, verify between each |
| "Let me try one more thing" after 3 failures | STOP. Escalate. |
| Guessing without reading the error | Read the full error message first |
| Changing multiple things at once | Isolate: one variable at a time |
| Assuming the fix worked without running it | Run the command. Read the output. |