code-investigate¶
Systematic bug investigation through evidence-based analysis and hypothesis testing.
Synopsis¶
Description¶
The code-investigate command performs systematic investigation of bugs and issues. It follows an evidence-based approach: gathering information, forming hypotheses, testing them, and documenting findings without making permanent code changes.
Investigation Process¶
- Evidence Gathering - Collect logs, reproduction steps, symptoms
- Hypothesis Formation - Identify potential root causes
- Testing - Validate hypotheses through analysis and experiments
- Documentation - Record findings and recommendations
Output¶
Location: .rp1/work/investigation-report.md
Contents:
- Problem statement
- Evidence collected
- Hypotheses tested
- Root cause analysis
- Recommended fix
- Prevention suggestions
Examples¶
Investigate an Issue¶
The command will prompt you for:
- Bug description or symptoms
- Reproduction steps (if known)
- Relevant error messages or logs
Example output:
✅ Investigation Complete
Root Cause: Race condition in async handler
Evidence:
- Error occurs only under load
- Stack trace shows concurrent access
- Found unsynchronized shared state
Recommended Fix:
Add mutex to protect shared state in src/handlers/queue.ts:45
Report: .rp1/work/investigation-report.md
Related Commands¶
code-check- Run tests after fixingcode-audit- Find similar issues