# Find which change caused a regression

Creates a systematic plan to pinpoint the commit, deploy, or config change that broke something that used to work.

- Topic: Software Development
- Framework: Chain-of-Thought
- Level: Standard
- Tags: Coding, Explain & Teach, Code, Fill-in Template, Step-by-step
- Source: https://www.thinkwithprompt.com/prompts/find-which-change-caused-a-regression

## Prompt

```text
Help me track down which change caused a regression.

**What broke:** [BEHAVIOR NOW vs. BEFORE]
**When it was last known to work:** [DATE, VERSION, OR COMMIT]
**When it was first noticed:** [DATE, VERSION, OR COMMIT]
**What changed in between:** [COMMITS, DEPLOYS, DEPENDENCY BUMPS, CONFIG OR FEATURE FLAG CHANGES, INFRASTRUCTURE OR DATA CHANGES - paste what you have]
**Can I reproduce it?** [YES, HOW / SOMETIMES / ONLY IN PRODUCTION]
**Version control and build:** [e.g. "git, monorepo, 10-minute build"]

Steps:
1. List all the categories of change that could explain it, not just code: dependencies, lock files, environment variables, flags, infrastructure, data, third-party APIs, browser or OS updates.
2. Rank the suspects using the evidence I gave.
3. Write a reliable, ideally automated, check that returns pass/fail for the bug, so it can drive a bisect.
4. Give the exact `git bisect` workflow, including `git bisect run` with my check script, how to skip commits that don't build, and how to handle merge commits.
5. If the cause may not be in code, give an equivalent way to bisect config, dependency versions, or deploys.
6. Once found: how to confirm it's really the cause (revert locally and retest) and how to write a regression test so it can't return.

Return the ranked suspect list, the check script, the step-by-step commands, and a short note I can post to the team once I find the culprit.
```

## What to fill in

- BEHAVIOR NOW vs. BEFORE
- DATE, VERSION, OR COMMIT
- YES, HOW / SOMETIMES / ONLY IN PRODUCTION
- e.g. "git, monorepo, 10-minute build"

Free to copy and use. From ThinkWithPrompt (https://www.thinkwithprompt.com/), a library of 2,663 curated AI prompts.
