bugsnap

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 claude in 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

  1. The report includes the URL, viewport, browser and the exact errors.
  2. Secrets are masked and scrubbed before the report leaves the browser.
  3. The report is plain Markdown with a fenced block, not a screenshot of text.
  4. Your prompt asks for the root cause, a fix and a test.
  5. Reports flow to GitHub Issues or a webhook, so nothing waits on you to copy them.

frequently asked questions

How do I send a user bug report to Claude Code, Cursor or Codex?

Copy the report as Markdown from the BugSnap inbox and paste it into your agent with a one-line instruction, such as asking for the root cause, a fix and a test. You can also have BugSnap open a GitHub Issue or fire a webhook automatically.

What should an AI-ready bug report include?

The visitor's note, the page URL, viewport, browser, timestamp and the exact console and network errors. BugSnap attaches all of these automatically, plus an optional masked screenshot.

Is it safe to paste user bug reports into an AI agent?

BugSnap scrubs Authorization and Cookie headers, tokens, passwords, card numbers and emails from error text, removes URL query strings, and masks sensitive fields before a screenshot exists. Still review reports before sharing them with any third-party service.

add bugsnap in one line.

Free and MIT open source. Hidden until a real bug, privacy masking always on.

<script src="https://getbugsnap.pages.dev/widget.js" data-project-key="YOUR_PROJECT_KEY" data-trigger="on-error" defer></script>