A systematic loop for identifying the root cause of code issues, bugs, or unexpected behavior through iterative investigation and analysis, ensuring developers address foundational problems rather than surface-level symptoms.
Identify root cause
Run this prompt in your coding agent to begin systematic root cause investigation. The agent will iterate through investigation steps until the root cause is identified or maximum iterations are reached.
Step 1: Describe the Problem
Explain the bug, issue, or unexpected behavior you're experiencing including error messages, symptoms, and affected components.
Step 2: Provide Context
Share relevant code snippets, recent changes, environment details, and any initial hypotheses about the cause.
Step 3: Let Agent Investigate
The agent will perform systematic investigation steps, asking follow-up questions and analyzing findings.
Step 4: Confirm Root Cause
When the agent identifies the root cause, verify accuracy and request documentation of findings.
Define and clarify the problem statement with user input
Gather relevant context including codebase, recent changes, and environment
Debugging
This loop guides you through reproducing a reported bug, identifying its root cause, implementing a fix, and verifying the solution through automated testing. The agent will iteratively work to resolve the issue while maintaining system integrity.
Debugging
This loop analyzes application error logs to identify and fix recurring errors, reducing their frequency over time through iterative debugging and targeted code improvements.
Debugging
A coding agent loop designed to diagnose and resolve production incidents through iterative investigation, targeted fixes, and continuous health monitoring until system stability is restored.
Perform initial code investigation and hypothesis formation
Run diagnostic checks and tests to validate hypotheses
Analyze results and narrow down potential root causes
Document findings and propose root cause with evidence
Confirm with user and finalize documentation if correct
iteration_check
Check if root cause is documented and iterations under limit
If documented, exit; else return to step 3
Start the "Root Cause Finder" loop. Goal: Identify root cause Max iterations: 10 Between iterations run: investigation review Exit when: Root cause documented I'm experiencing an issue where [describe specific problem - e.g., 'my API returns 500 errors when processing POST requests']. The error occurs in [component/context] and started happening after [recent changes or timeline if applicable]. I suspect it might be related to [initial hypothesis], but want to systematically identify the root cause. Can you investigate this step by step? Self-pace this loop. After each iteration, run `investigation review` and evaluate the output, and only continue if the exit condition is not met (Root cause documented). Stop when the exit condition passes or 10 iterations are reached. Give a short status update each pass.