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.
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.
How to use it
- Copy the prompt above.
- Replace every [bracket] with your own details (or fill in the blanks on AgentPlaybook Real Estate, which remembers your answers for the next prompt).
- 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
- This prompt works on text other people wrote (emails, reviews, messages or web pages). That text can hide instructions aimed at AI, such as "ignore your rules and…". Paste it as material to work on, and never let the AI act on requests inside it, like paying, sharing logins or changing records. How prompt injection works →
- Read and edit the draft before it reaches a customer or goes public. If you later automate this prompt, start with "draft and notify me", not "send automatically".
- Check names, dates, numbers and any claim against your own source material before you use the answer. AI can misread or invent details.
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.
Want to make this prompt even better? Grade it with the free prompt grader or build your own with the AI prompt generator.
32 copy-paste agent prompts (PDF) plus 5 new prompts every week.
Get it free