Debugger
Start a forensic CRASH-RCA debugging session for systematic root cause analysis.
---
description: Start a forensic CRASH-RCA debugging session for systematic root cause analysis.
argument-hint: [issue description]
---
# CRASH-RCA Debugging Protocol
You are the ORCHESTRATOR for a forensic debugging session using the CRASH-RCA protocol.
## Protocol Overview
**CRASH-RCA** = **C**ollect, **R**eason, **A**nalyze, **S**ynthesize, **H**andle
This protocol enforces:
1. **Read-Only Mode**: Write/Edit tools are blocked during investigation
2. **Logged Steps**: Every investigation action is recorded
3. **Evidence-Based**: Conclusions require concrete proof
4. **Structured Report**: Final diagnosis follows standard format
## Pipeline Overview
```plaintext
init-explorer → debugger → crash.py start → investigation → crash.py diagnose
Your Execution Steps
Step 1: Initialize with Context
Invoke init-explorer agent to:
- Explore the target project structure
- Read progress file (
claude-progress.txt) for previous work - Read feature list (
feature_list.md) to understand what's been implemented - Invoke the
debuggeragent automatically
Task(subagent_type="init-explorer", prompt="
Explore this project and initialize context for the debugger workflow.
next_agent: debugger
task: $ARGUMENTS
After exploration:
1. Read claude-progress.txt to understand previous sessions
2. Read feature_list.md to understand implemented features
3. Update claude-progress.txt with this debugging session start
4. Invoke the debugger agent with the issue description
")
Wait for init-explorer to complete (it will invoke debugger internally).
Step 2: CRASH Session (handled by debugger agent)
The debugger agent will:
Start the CRASH session:
python3 .claude/scripts/crash.py start "$ARGUMENTS"Systematic Investigation - For EACH action:
python3 .claude/scripts/crash.py step \ --hypothesis "What you think might be causing the issue" \ --action "The specific tool/command you'll use to verify" \ --confidence 0.XExecute investigation using read-only tools:
Grep- Search for patterns in codeRead- Examine specific filesGlob- Find files by patternBash- Run read-only commands (ls, cat, git log, etc.)
Complete with Diagnosis (when confidence > 0.8):
python3 .claude/scripts/crash.py diagnose \ --root_cause "One sentence summary of the defect" \ --justification "Technical explanation of the failure mechanism" \ --evidence "file:line; description; file:line; description"
Step 3: Delegate if Needed
For complex investigations, use the Task tool to delegate:
Forensic Agent: For targeted search operations
Task(subagent_type="forensic", prompt="Search for all database connection handling in src/")Analyst Agent: For synthesizing findings into diagnosis
Task(subagent_type="analyst", prompt="Review the investigation and prepare diagnosis")
Investigation Patterns
Error Investigation
- Search for the exact error message
- Trace to the throw/raise statement
- Examine triggering conditions
- Identify the defect
Behavioral Issue
- Identify what changed (git log)
- Correlate changes with symptoms
- Examine suspicious code
- Verify with evidence
Performance Issue
- Look for bottleneck indicators
- Check resource usage patterns
- Find inefficient code paths
- Measure and verify
Critical Rules
MUST DO:
- Start with init-explorer for context
- Start every CRASH session with
crash.py start - Log every investigation step with
crash.py step - End with
crash.py diagnose - Include file:line references in evidence
MUST NOT:
- Use Write, Edit, or NotebookEdit (blocked in forensic mode)
- Skip logging investigation steps
- Draw conclusions without evidence
- End session without diagnosis
Quality Gates
- Every hypothesis logged before investigation
- Confidence tracked throughout
- Evidence includes specific file:line references
- Root cause is actionable (can be fixed)
- Justification explains the failure chain
Error Handling
If you encounter issues:
- Use
crash.py statusto check session state - Use
crash.py cancelif you need to abort - Invoke the
stuckagent for human guidance
Session Flow Diagram
/debugger "issue"
|
v
init-explorer
|-- Explore project structure
|-- Read claude-progress.txt
|-- Read feature_list.md
|-- Update progress file
|
v
debugger agent
|
v
crash.py start --> Forensic Mode ON
|
v
+-> crash.py step (hypothesis)
| |
| v
| Read/Grep/Glob/Bash (investigate)
| |
| v
| Evaluate findings
| |
| v
+-- Confidence < 0.8? --> Loop back
|
| Confidence >= 0.8
v
crash.py diagnose --> Report Generated
|
v
Forensic Mode OFF --> Session Complete
Example Session
User: /debugger "Login API returns 500 intermittently"
1. init-explorer runs:
- Explores project (Python Flask, PostgreSQL)
- Reads progress: previous session implemented AUTH-001 through AUTH-005
- Updates progress with debugging session start
- Invokes debugger agent
2. debugger agent runs:
crash.py start "Login API returns 500 intermittently"
3. Log hypothesis:
crash.py step --hypothesis "Exception not being caught in auth handler" \
--action "Search for try/catch in auth module" --confidence 0.3
4. Investigate:
Grep for "except\|catch" in src/auth/
5. Log next hypothesis based on findings:
crash.py step --hypothesis "Database timeout under load" \
--action "Check connection pool config" --confidence 0.6
6. Read database config files...
7. Continue until confident...
8. Diagnose:
crash.py diagnose \
--root_cause "Connection pool size of 5 exhausted under concurrent load" \
--justification "When >5 concurrent requests hit the login API, pool exhaustion causes timeout exceptions th
Maintain Debugger?
Let people know it's listed here — add the badge (live metrics, light/dark aware) or a plain link to your README or docs.
[Debugger on getagentictools](https://getagentictools.com/loops/leonj1-crash-rca-debugging-protocol?ref=badge) npx agentictools info loops/leonj1-crash-rca-debugging-protocol The second line is the CLI lookup for this page — handy in READMEs and docs.