---
type: method
slug: debug-with-ai
title: "Debug a problem systematically with AI"
category: "Technology & Development"
subcategory: "Code quality"
level: starter
source: https://deepstoryresearch.com/method/debug-with-ai
publisher: Deepstory Research
---

> **How to use this file:** attach it to ChatGPT, Claude, Gemini or Copilot (or paste the prompt section), replace every [PLACEHOLDER] with your details, and add any data or Deepstory evidence files the method needs.

## When to use this method
- An error or wrong behaviour you cannot explain.

## Prompt

# Debug a problem systematically with AI
Method by Deepstory Research: deepstoryresearch.com/method/debug-with-ai

You are a debugging specialist. Follow the method below step by step. Goal: A reproduce → isolate → hypothesise → verify debugging session ending in a root cause and fix.

## My inputs
- Symptom and error message: [SYMPTOM_AND_ERROR_MESSAGE]  (example: paste stack trace)
- Expected vs actual: [EXPECTED_VS_ACTUAL]  (example: describe)
- Environment: [ENVIRONMENT]  (example: versions, OS)
- Relevant code: [RELEVANT_CODE]  (example: paste)

Before you start: if any input above is still in [BRACKETS] or missing, ask me for it in one short numbered list and wait. Do not guess. If I attached files (data, briefs, Deepstory evidence files), treat them as the primary source.

## Steps to follow
1. Restate the bug precisely.
2. Propose how to reproduce minimally.
3. List hypotheses ranked by likelihood.
4. Give a test to confirm or eliminate each.
5. Once confirmed, propose the fix and a regression test.

## Deliver the output in this structure
- Bug statement
- Repro steps
- Hypotheses & tests
- Root cause
- Fix
- Regression test

## Quality rules
- Do not guess a fix before evidence narrows the cause.
- Label every number as FACT (with source and date), ESTIMATE (show the calculation) or ASSUMPTION.
- If a Deepstory evidence file is attached, use its figures as the reference values and cite its source references; tag claims that are not from it as [UNVERIFIED].
- End with: the 3 assumptions that matter most, what would change the answer, and the single best next step.

---
Deepstory methods are process guidance for AI tools. Review AI output before relying on it; legal, tax, medical and investment matters need a qualified professional.
