# Step 14: Watch for errors and fix them with your agent

> Pagebee Academy, part 4 (Run). Most people who hit a bug never tell you. Your error tracker does. Check it daily, and hand each new error to your agent with the details already attached.

Time: Ten minutes a day. Cost: Free.

## Why it matters

For every person who writes in about a bug, many more just leave. Error tracking shows you what they hit: the error, the page, the browser, and how many times.

Because your error tool has an MCP server (step 11), your agent can read the error with its stack trace, find the line in your repo, write the fix, and open a pull request. You check it and merge. That's a loop that used to need a developer on call.

## Do this

1. Set up an alert for new errors, so a new problem reaches you the day it starts, not the week after.
2. Each morning, look at new errors and anything that's spiking. Ignore the noise from browser extensions and bots, and tell your tool to ignore them too.
3. For each real one, paste the prompt below. Read the fix in the pull request before merging. Ask the agent to explain it if it isn't obvious.
4. After the fix is deployed, mark the error as resolved. If it comes back, your tool tells you it regressed.

## Paste into Claude Code

```text
Look at the unresolved errors from the last 24 hours. For the one affecting the most people: read the stack trace, find the cause in this repo, and explain it to me in two sentences. Then fix it on a new branch with a test that would have caught it, open a pull request, and mark the error as resolved once I've merged and deployed.
```

## The trap: Letting the agent fix the symptom

Agents under pressure wrap the failing line in a try and catch, and the error disappears from your dashboard while the bug stays. Ask for the cause first and a test that fails without the fix. If the fix is "catch it and carry on", push back.

## Sources

- [Sentry MCP server](https://mcp.sentry.dev/)

Checked 24 November 2026. https://pagebee.ai/academy/fix-errors
