Guide
Get a coding agent to report its own failures
Coding agents read the files in your repository before they write code. One block in AGENTS.md or CLAUDE.md is enough for them to add BugBeacon reports to what they build, and to use it in the scripts they run.
Add a block to AGENTS.md
Paste this into the instructions file your agent reads: AGENTS.md for Codex and many others, CLAUDE.md for Claude Code, .cursor/rules for Cursor.
## Error reporting (BugBeacon)
- Report caught and uncaught errors to BugBeacon with one HTTP POST:
POST https://bug-beacon.net/api/v1/notify
Header: X-Api-Key: read it from the BUGBEACON_API_KEY environment variable. Never hard-code it.
Body (JSON): {"error": {"name", "message", "stacktrace", "unhandled"}, "app": {"platform", "version",
"releaseStage"}, "fingerprint"?, "breadcrumbs"?, "metadata"?, "user": {"id"}?}
- The full field list: https://bug-beacon.net/openapi.json
- For tool and job failures, set "fingerprint" to "tool:{name}:{error kind}" and "unhandled" to false.
- Put changing values (ids, durations, inputs) in "metadata", never in "error.message".
- Never put secrets, tokens or personal data in a report.
- A 202 answer has "issueId" and "isNewIssue". Log the issueId next to the failure.
Point it at llms.txt
/llms.txt is a short plain-text description of the API, written for language models: the endpoint, the headers, the fields and an example. Agents that browse can be told to read it:
Read https://bug-beacon.net/llms.txt and add BugBeacon error reporting to the job runner.
Use the OpenAPI spec for generated clients
/openapi.json is an OpenAPI 3.0 file with the request schema and the answers. Tools that generate clients, and agents that read specs, can use it as it is.
What the agent can and cannot do today
- It can send reports and read the answer: the issue id and whether the issue is new.
- It cannot list or read issues yet: there is no read endpoint. You read them in the dashboard and paste the stack trace into the chat when you want the agent to fix one.