guide
How to turn live user bug reports into Markdown prompts for Claude Code, Cursor and Codex
AI coding agents fix bugs fast when the prompt has the page, the browser and the exact error. Visitors rarely give you that. This guide shows how to turn every live bug report into a prompt your agent can act on.
why most bug reports make bad prompts
"The button doesn't work" is not something Claude Code, Cursor or Codex can fix. An agent needs the page URL, the device, what the visitor tried and the console or network error. Without them it guesses, edits the wrong file or asks you questions you cannot answer.
1. capture context automatically
Add BugSnap with the on-error trigger. It stays hidden until a crash, failed API call, dead click, broken image or freeze, then asks the visitor one question: what happened? Everything else is attached for them.
<script src="https://getbugsnap.pages.dev/widget.js" data-project-key="YOUR_PROJECT_KEY"
data-trigger="on-error" defer></script>
Each report includes the visitor's note, the page URL (query strings removed), viewport, browser, timestamp, up to 20 recent errors and an optional masked screenshot. Secrets are scrubbed from error text before anything is sent.
2. get the report as Markdown
Every report in the inbox has a Copy as Markdown button. The output is a short, fenced block that agents read reliably:
## BugSnap report (bug)
```text
Checkout button does nothing after I enter my card
Page: https://app.example.com/checkout
Viewport: 390 × 844
Browser: Mozilla/5.0 (iPhone; CPU iPhone OS 18_1 like Mac OS X) ...
Captured: 2026-12-06T09:14:02.511Z
Status: open
Console errors:
TypeError: Cannot read properties of undefined (reading 'total')
POST /api/orders 500
```
Testing a bug yourself, without the widget? Paste your notes into the free bug report to AI prompt generator to get a prompt in the same shape.
3. paste it into your agent with a short instruction
The report says what broke. Add one line that says what you want. These prompts work well:
- Claude Code: run
claudein your repo, paste the report, then add: "Find the root cause of this production bug, fix it, and add a test that fails without the fix." - Cursor: open Agent chat, paste the report, and add: "Locate the code for this page, explain the cause in two sentences, then apply the fix." Mention the likely file with
@if you know it. - Codex: start a task in your repo, paste the report, and add: "Reproduce this from the error, fix it, and run the test suite."
4. skip the copy-paste with GitHub Issues
Connect a repository in the BugSnap dashboard with a fine-grained token that has Issues: Read and write. Each new report opens an issue titled [BugSnap] <first line> with the Markdown report and the labels bugsnap and the category. From there, assign it to GitHub Copilot coding agent, or trigger Claude Code Action or Factory Droid on the label to get a fix pull request.
5. or send it to your own agent with a webhook
Every new report is POSTed as JSON with a ready-made markdown field:
{ "event": "report.created", "projectId": "…", "projectName": "…", "report": { … }, "markdown": "## BugSnap report (bug) …" }
Pass markdown straight into your agent's prompt. Slack and Discord webhook URLs get a formatted message instead.
checklist for agent-ready bug reports
- The report includes the URL, viewport, browser and the exact errors.
- Secrets are masked and scrubbed before the report leaves the browser.
- The report is plain Markdown with a fenced block, not a screenshot of text.
- Your prompt asks for the root cause, a fix and a test.
- Reports flow to GitHub Issues or a webhook, so nothing waits on you to copy them.