An error shows up in Sentry. Someone has to read it, find the cause and fix it, and more and more often that someone is Claude Code. The question is how the error gets from Sentry to the agent, and what happens to it after that.
There are three common ways to connect the two. They suit different jobs, and plenty of teams use more than one. This page covers each, what goes wrong when every error goes straight to an agent, and how to set up a queue that keeps a person in charge of what gets fixed.
Three ways to connect Sentry and Claude Code
The Sentry MCP server. Add Sentry's MCP server to Claude Code and the agent can read issues, events and stack traces while you work. You ask, it looks. This is the right tool when you are already looking at one error and want the agent to dig into it with you. Nothing happens until you ask.
Sentry's own agent handoff. Sentry can hand an issue it has analysed to a Claude agent, which writes a fix and opens a pull request. It runs from Sentry's side, needs admin rights in your Sentry organisation, and is the shortest path from one issue to one proposed change.
A queue between them. Sentry sends each new issue to a task board as a piece of work. Claude Code takes work from the board, one piece at a time, and hands it back with evidence. This is the right shape when errors arrive faster than anyone reads them, when more than one agent or person fixes them, or when you want a record of what was fixed and how it was checked.
What goes wrong when every error goes straight to an agent
Sentry is good at noticing problems. An agent is good at fixing a well-described one. Wiring the two together with nothing in between causes predictable trouble:
- Noise becomes work. One bad deploy produces hundreds of events. An agent run per event is hundreds of runs for one bug.
- Two agents fix the same error. Nothing says it is taken, so both start, differently.
- Nobody decides what matters. A warning in a staging project gets the same attention as a crash on checkout.
- There is no record. A week later nobody can say which errors were fixed, by which run, or how the fix was checked.
- It comes back. An issue marked resolved returns, and nothing connects the second report to the first fix.
A queue fixes these by putting one piece of work per issue between Sentry and the agent, with a place for a person to look before anything is changed.
What each piece of work should hold
When an error becomes work, the agent needs enough to start without opening Sentry first:
- The issue's title and short id, so it can be found again.
- The level and the culprit: how bad it is and where it was thrown.
- The project, so the agent knows which repo to work in.
- Whether it is new or came back after being marked resolved.
- A link to the issue, for the stack trace and the events.
What done looks like is the agent's to work out from that, and the first step is the same every time: reproduce the error before changing anything.
Sentry to Claude Code with Passalong
Passalong is a task board built as an MCP server, and Sentry can post to it directly. Each new issue arrives as a piece of work, Ready, with the fields above and a plain summary.
To connect it, get your webhook address in the hub under Settings → Integrations, then in Sentry:
- Open Settings → Developer Settings → Custom Integrations and create an Internal Integration.
- Paste your Passalong address as its Webhook URL.
- Under Webhooks, tick issue, or turn on Alert Rule Action and add it to an alert rule.
From then on:
- One piece of work per issue. A new issue makes work. While that work is open, repeats add to it, with at most one note an hour on its thread, so a noisy error is not a flood. An issue that comes back after its work is finished arrives as new work, marked as come back.
- Sent to the right people. Work can go to one person, to a group such as
#backend, or to the whole team. - Claimed before it is worked. Claude Code takes a piece of work before it starts. Nobody else can take it while it is held, and everyone sees who has it.
- Finished with evidence. A hand-in is refused without something a person can check: the test that now passes, or the command that shows the error is gone.
- Fixing on its own only where you said so.
passalong work --watchon an always-on machine takes only work a person has marked Let an always-on agent take this on its own. Everything else waits for someone to start it.
With Passalong connected to your tools, an agent can run the whole loop itself: write down the bugs it finds, take work that is waiting, report progress, hand it in with evidence, and write what it learned into the project's documents. Nothing gets copied between tools by hand.
npm i -g passalong
passalong setup
passalong login
The full list of Sentry events Passalong reads is in Integrations. See also Claude Code task management and a bug report template for AI agents.