Before anyone fixes a bug, have an AI agent gather the evidence: the code most likely involved, what the user did just before the report, recent changes to those files and steps to reproduce it, posted on the ticket: AI agent prompt

Duolingo's engineering blog described on Nov 4, 2026 how its DevX AI team built AI STR Fix with the Claude Agent SDK to work through bug reports that admin and beta users file by shaking their phone. Instead of just asking Claude to fix the bug, the agent first does the investigation engineers used to do by hand: it finds the code most likely involved, turns a pre-filtered set of tracking events into a short timeline of what the user did, checks which A/B experiments were running, looks at recent pull requests that touched the relevant files, writes reproduction steps and suggests an engineer who knows the area, then posts this context to the Jira ticket. Later steps added a self-review, a stage that fixes failing CI checks and automatic beta builds so anyone can verify a fix. Duolingo says it has fixed release-blocking bugs and saves hours of manual work per ticket; it published no overall fix rate.

CodingBug report investigation and context gatheringintermediate

The prompt

1. Pick one bug ticket and gather what you have: the report text, screenshot, logs or error messages, the device or browser, and the date and time it happened.
2. Open a coding agent that can read your code (Claude Code, Codex or Cursor) in your project folder, on a new branch.
3. Ask: "Investigate this bug before changing anything. Write your findings to a file called bug-notes.md: (a) the 3 files most likely involved and why, (b) a short timeline of what the user did before the error, based only on the logs I gave you, (c) any feature flags or settings that could change the behaviour, (d) recent commits that touched those files, from git log, (e) numbered steps to reproduce it, and (f) whether it may already be fixed. Mark anything you are guessing."
4. Read bug-notes.md, try the reproduction steps yourself and correct anything wrong.
5. Then ask: "Using bug-notes.md, make the smallest fix that follows how this part of the code is already written, add or update a test, run the tests and review your own change for side effects."
6. Review the change, test it on a preview or beta build, and only then merge it.
Open in ChatGPT Open in Claude Perplexity Download as agent skill (SKILL.md)

How to use it

  1. Copy the prompt above.
  2. Replace every [bracket] with your own details (or fill in the blanks on AgentPlaybook Real Estate, which remembers your answers for the next prompt).
  3. Paste it into Claude Code, Codex or Cursor, Jira or GitHub Issues and review the answer before you use it.

Works with: Claude Code, Codex or Cursor, Jira or GitHub Issues, Git

Real-world example: blog.duolingo.com/ai-bug-fixing-agent/

Featured in: AI prompts for writing SOPs, reports, policies and checklists

Before you use it: what to check

Check yourself

Using an AI agent? Download this prompt as a SKILL.md agent skill with these checks built in, or get the .zip for Claude.ai. How to install skills.

Share:Post on XLinkedInFacebookRedditWhatsApp
</> Embed this prompt on your site

Paste this HTML into your blog or website. It's a plain card with no tracking scripts that links back to this prompt.

Want to make this prompt even better? Grade it with the free prompt grader or build your own with the AI prompt generator.

Get the free Solo Founder Stack pack

32 copy-paste agent prompts (PDF) plus 5 new prompts every week.

Get it free

More Coding prompts

Ship a small feature as a PRFeatures · intermediateBuild a simple internal toolNo-code apps · beginnerAutomation script for a boring taskScripts · beginnerCommit & PR assistantGit workflow · intermediateFix a failed pipelineCI fixes · intermediateCheckpointed long task setupLong-running tasks · intermediate

See all Coding prompts →

Related prompts from other teams

Competitor watch reportMarketing · beginner · worked exampleMarket size & trend reportResearch · beginnerWeekly status reportOperations · beginner · worked exampleWrite an SOP from a messy processOperations · beginner · worked example