Debuggingprompt onlyIntermediate

Root Cause Finder

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.

← all loops
debuggingroot-cause-analysisinvestigationsystematiccode-review

Goal

Identify root cause

How to Run

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.

  1. 01

    Step 1: Describe the Problem

    Explain the bug, issue, or unexpected behavior you're experiencing including error messages, symptoms, and affected components.

  2. 02

    Step 2: Provide Context

    Share relevant code snippets, recent changes, environment details, and any initial hypotheses about the cause.

  3. 03

    Step 3: Let Agent Investigate

    The agent will perform systematic investigation steps, asking follow-up questions and analyzing findings.

  4. 04

    Step 4: Confirm Root Cause

    When the agent identifies the root cause, verify accuracy and request documentation of findings.

Workflow Steps

  1. 01

    Define and clarify the problem statement with user input

  2. 02

    Gather relevant context including codebase, recent changes, and environment

  3. 03

    Perform initial code investigation and hypothesis formation

  4. 04

    Run diagnostic checks and tests to validate hypotheses

  5. 05

    Analyze results and narrow down potential root causes

  6. 06

    Document findings and propose root cause with evidence

  7. 07

    Confirm with user and finalize documentation if correct

    iteration_check

  8. 08

    Check if root cause is documented and iterations under limit

    If documented, exit; else return to step 3

Kickoff Prompt

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.

Guardrails

hardcoded
  • ·Do not make code changes without fully understanding the problem first
  • ·Focus on identifying underlying causes, not just treating symptoms
  • ·Stop immediately once root cause is documented and confirmed
  • ·Limit investigation to 10 iterations to maintain focus

Flow Diagram

rendering…

Related loops — Debugging