Trace a production alert to the change it blames
The incident correlator follows a production alert to the deploy, the commit, the line and the captured agent session behind it, and gives every link a confidence band instead of a verdict. This page shows how to feed it, read it, and push back when it names the wrong person.
Watch it
Read the narration
- 0:00 An alert names a line. Someone has to find the change behind it.
- 0:06 Follow the deploy, the commit and the session.
- 0:09 Each edge names its mechanism and confidence.
- 0:13 The Impact line says how many users it hit and the revenue at risk.
- 0:17 Agent spend and user impact sit side by side, never added.
- 0:23 A fixed error that comes back reopens its case.
- 0:26 An armed guard queues the same fix.
Synthetic example. Read the guide
How to
RepoOps on this machine, tracking a repository that is a git checkout.
A token for one production source (Sentry, Vercel, PostHog or GitHub), a slow-query log, or nothing at all: the local receiver takes a plain post from any crash handler.
Claude Code sessions captured in that repository in the last seven days. Without them the chain stops at the commit.
- Arm a source.
Open Setup, then Production integrations. Under Turn on an adapter, pick your source and repository and press Turn on. Under Token and project, pick the same row, paste the token and press Save token (it goes into this machine's data directory .env under the variable the row names), then fill in the project and press Save project. Press Test connection on its row. Every source is off until you do this. Vercel anchors deploys rather than reporting errors, so arm an error source beside it.
- Or post a test event instead.
Open localhost:4000/api/prod-events/snippets?repo= followed by the repository's id. Copy one of the three snippets the server builds (a curl, an uncaughtException handler, and a CI step that reports what shipped) and run it. A post to the local receiver correlates at once, so you do not wait for the nightly pass.
- Install the Session-Id hook in the repository.
Run npx repoops install inside the checkout. It installs the prepare-commit-msg hook, sets core.hooksPath to .githooks, and stamps each commit with the session that made it. Claude Code exports CLAUDE_CODE_SESSION_ID itself; REPOOPS_SESSION_ID wins when both are set; REPOOPS_NO_SESSION_TRAILER=1 skips one commit. Without the trailer no chain can reach exact.
- Let the pass run.
Sentry, Vercel and GitHub are pulled every 15 minutes, PostHog hourly and the slow-query log every 5 minutes. Correlation runs in the nightly pass at 02:00 local over the newest 500 production events. An event that names its commit, such as a failed build or a failed post-deploy check, is traced through that commit. An event with a file and line is blamed as the deploy serving the error had it, not as the code reads today. A Sentry event whose stack names only a minified chunk, or an error that carries a page URL and no stack, is matched to the page, route handler or middleware behind that URL, under the App Router or the Pages Router. When your recent Sentry events arrived without source maps, the Sentry row on Setup, Production integrations shows Source maps with the steps to fix it, and a release set to the commit sha names the deployed commit. An event that names only a route is traced to the last change to that route's page or handler that was live. Each commit is then matched to a session in the last seven days, by its Session-Id trailer first, then by the session's own commits, then by time and files.
- Open the case from Production.
Production in the sidebar opens on the Findings tab. A production incident is listed there once it has a case. The open-by-rule pass opens one after three sightings by default (REPOOPS_AIR_PROD_RECURRENCE), on the hourly tick when REPOOPS_AIR_OPEN_SCHEDULE=1, or when you press Open cases by rule in the Session signals card on AI Security's Risky commands and enforcement tab. Each row shows the severity, the site, the status and the title, and opens the case page. The top finding sits above the list with Diagnose and fix.
- Read the evidence chain.
Under Diagnosis: what caused it and why, seven steps run in order: Symptom, What changed, Change record, Deploy, Commit, Agent session and Prompt. A step with nothing behind it reads none and says why. Press a step to read it; on the deploy, commit and session steps, Open in the change record shows that stage of the change.
- Read the band in the case record.
Press Case record in the header, then Attribution. One row per hop (Deployment, Commit, Changed line, Session, Prompt turn, Developer) names the mechanism that found it, its confidence and its review state, or reads No edge for this hop. The Band row carries the case's band. Exact means the commit names its session through a Session-Id trailer or a recorded graft, and that session is on this machine. Strong is one clean match on time and file. Weak is a rename, a squash, several candidate sessions, or a commit that landed in the 30-minute grace window around a session. None means no hop links the case to a change.
- Review an edge.
In the same section, open Review an edge, pick the edge, choose confirm, dispute or withdraw, type your name and, if you like, one line of why, then press Record review. The hop keeps the mechanism and confidence it was found with, and a later recompute does not overwrite your review.
- Save a lesson from a cause you trust.
Open Prevention in the case record. When this machine drafted a lesson for the case, a Lesson draft row says what happened and where, and Write the lesson sits under it. Type the fix in your own words, add a guard pattern if you want one, and press Save the lesson. The guard is armed at warn, so it reports on a future tool call and blocks nobody until a person promotes it on the Lessons tab.
Use cases
A Sentry error that blames cleanly
- Situation
- Sentry is armed, the Session-Id hook is installed, and an error arrives naming src/checkout/total.ts line 42, edited by a Claude Code session yesterday.
- You do
- Open the case from Production's Findings tab, then Case record and Attribution. Confirm the Session hop under Review an edge with your name, then write the lesson under Prevention with the fix you made.
- You see
- The Band row reads exact, the Commit hop reads the line's last change, by git blame, and the Session hop names the trailer. Your review stays on the edge, the lesson appears on the Lessons tab, and the guard warns on the next tool call that repeats the pattern.
Signups fall after a deploy
- Situation
- PostHog is armed with signup in posthog.eventAllowlist. Three hours after a production deploy, signups are 40 percent below the same hours on the previous week.
- You do
- Open the case that appears on Today and read its After the deploy row.
- You see
- The row names the deploy, the hourly rate after it against the same hours of the previous days, the percent change, and partial while the six-hour window fills, then measured. It closes with An association with the deploy, not a shown cause. A metric carries no source line, so no commit or session is blamed.
Expected outcome
Next step: No production incident has a case yet. Arm Sentry, GitHub or PostHog, or post a test event with the curl from the snippets, then let the open-by-rule pass run: set REPOOPS_AIR_OPEN_SCHEDULE=1, or press Open cases by rule.
Next step: Check that the file still exists at that path and that a session was captured in the last seven days. A blame failure prints one line naming the file in the server log.
Next step: Run npx repoops install in the repository and commit again. A commit with no trailer, or one naming two sessions, stops at strong.
Next step: This machine has no lesson draft for the case. A Lesson draft row that says it could not be read means the draft did not load: reopen the section.
Next step: Press Test connection on its row in Setup, Production integrations. The banner that named a stale pull went with the old Incidents page, and no page draws it now.
Next step: Its Evidence section reads the coverage only: retrieval runs from the hosted case, where an owner or admin can ask an enrolled installation. Open the case on repoops.ai and choose Evidence in its case record.
What else to consider
What a band does not say
The blamed commit is the last change to that line in the deployed code, which is not always the change that introduced the defect, and a matched session is a candidate, not a culprit. A commit chosen from a route, or from the Sentry release where an issue first showed, reads weak at most. A change dated after the error first showed is never named. With no session, the row still names the commit and its developer. A browser security report is not a crash in your code: it points at the change that added the blocked host when that host is in your source, or at the last change to your security policy when the blocked host is one of your own deploys, and otherwise reads as a browser report rather than a failure to trace. Every row that names no change says why. Changes outside your code are recorded too, once their source is set up: an environment variable edited in Vercel or shared in Railway (its name and time, never its value), a PostHog feature flag turned on or off or its rollout moved, an applied Drizzle or Prisma database migration, a Railway deploy, a merged Dependabot bump, and an outage on the Vercel, GitHub, Stripe, Anthropic or Resend status page. When the site sends OpenTelemetry client spans, an outage at a provider the failing route never calls is ruled out and the case says why. The host the site runs on is never ruled out this way. With no spans the case reads Dependencies not measured for this site. An error that comes just after one shows it as changed just before, which is a suspect to check, not proof of the cause. PostHog metrics and slow-query rows carry no source line, so they stay unattributed by design. Under the evidence chain, Is this right? lets you mark the change the case names Right, or press That's wrong to correct it (see Correcting a claim below). It works in the desktop app and on repoops.ai. Once a rule has 20 labels on a repository, or 50 across your repositories, a rule right less than 90 percent of the time shows one band lower, and less than 70 percent two bands lower. A band is never raised. If your team decides through promptcompute, a decision on a request RepoOps made from a case labels that case too: an approved rollback of the suspect deploy marks it right, a rollback or fix denied as the wrong cause marks it wrong, and a lesson retired as wrong marks the cases it came from wrong. An approved fix counts half, like a merged one, and your own Right or Wrong always wins. The Accuracy view counts labels by where they came from. The Commit step says so, for example Band lowered from strong: this rule was right 14 of 21 times here. npm run score-attribution scores each rule against these labels.
Correcting a claim
That's wrong under the evidence chain, and on each active lesson in Memory, opens a correction. Pick what is wrong: the fact, the ranking (another cause comes first) or the recommendation. For a case, say what caused it instead: a commit, not a code change, or unknown. Add a note if you like, and your name. In the desktop app the correction keeps the original claim and marks it contradicted, then follows what was built on it: each lesson whose evidence cites it goes back to review and out of the instructions agents read, a wrong fact or ranking counts as a wrong label against the rule that named the change, the change-risk lines of open pull requests that used it read stale and stop being sent to promptcompute, and each task that cites it records the correction. A case you sealed to aisourceoftruth.com gets an erratum offered beside its record, under the publish setting this machine already has; your note never leaves the machine. What the correction changed lists every effect. Undo reverses all of them for 10 minutes. After that, Revoke takes a reason and records a new statement; lessons stay in review until someone approves them again. On repoops.ai a correction is a wrong label on the case, and it says which effects live on the desktop app; mark the attribution Right to reverse it.
When no rule names the change
A case the rules could not trace can get a suggestion from the model. Turn on AI investigation in the desktop app's Settings (it is off by default), then press Run investigation on the case page, or let the next open pass pick up new cases, at most three per repository. RepoOps sends the error, up to 20 log lines from around it, up to three recent diffs of the failing file and the changes outside git, with secrets removed, to Anthropic on your own key, once per case. It sends the session transcript only when a transcript grant allows it. The answer shows under Suggested by AI, not verified: up to three possible causes, each with the lines it relied on and a low or medium confidence, never a band. A line the inputs do not contain is dropped, and an answer that is not in the expected shape reads Investigation returned no usable answer. Nothing runs while this month's LLM budget is held or after 20 investigations in a day, and each run's cost is recorded on its case. Mark right on a suggestion is scored on its own row by npm run score-attribution, never as a rule. The hosted case page shows the suggestions the desktop sent, without the commit or any transcript text.
Every change in the six hours before
Beside the rules, RepoOps lists every change in the six hours before an error first showed: each commit a production deploy shipped, each deploy, and each change outside git, such as an environment variable, a feature flag or a provider outage. Each one faces the same six tests. A change that landed after the error first showed, or was never live where the error happened, is ruled out and the case says which test it failed. The rest are ranked by whether a revert of it was followed by the error stopping and whether the error began while it was live, then by whether it touched the failing route's files and reached the sites that errored, then by how close it came to the error. Ties stay tied. When a rule named the change, it stays the answer and the case page lists the others under Other changes considered, with why each is less likely. When no rule named one and a single change ranks first with support, the case page shows it under Most likely change (search), with a weak band at most. The hosted case page shows the same list with each test's result; a commit's sha and the evidence lines stay on the desktop.
A map of each case
Under the evidence chain, the case page draws the case as a map: the error, the route it hit, the deploy that served it, the commit, and the agent session that wrote the commit, joined left to right, or top to bottom on a narrow screen. Beside the chain sit the changes outside git from the six hours before and the outside services the route calls. Below it, each change that was ruled out is greyed and struck through, with the test that ruled it out, and so is an outage at a provider the route never calls. The confidence band sits on the arrow into the change the case names. A piece the case does not name is a dashed box that says not known and why, for example No deploy record joins this case. Each box opens its own page: the error and the route open the site in Production, the deploy and the commit open the change record, and the session opens its trace in Attribution. The map shows only what the case already records and adds nothing to it. The hosted case page draws the same map; a deploy, commit or session repoops.ai only joined, without its id, reads found, with no link.
Roll back to the previous deploy
When a case names the deploy that broke production, the map's header carries Roll back to the previous deploy. It opens Fix with the rollback picked. RepoOps reads the project's deploys from Vercel with the site's own credential and promotes the newest ready production deploy created before the suspect; it refuses when a newer deploy went live since, because that one would be undone too. A person approves it first. If your team routes deploys through promptcompute, the rollback is a production deploy request there, with the case as its first piece of evidence and the change risk card of the suspect's change beside it, and only the deploy the approver allowed runs. Otherwise your name and reason in the app are the approval. Nothing starts a rollback on its own. The Slack case alert carries the same action as a link to the case page. Once it runs, the case keeps the rollback, the change page of the rolled back commit says so, the correlator reads the deploy put back as the one serving, and later errors list the rollback among the changes outside git. For 24 hours the case watches whether the error stopped and records stopped, still happening or not measured. On repoops.ai the button is off: the rollback runs in the desktop app, which holds the site's credential, and the hosted case shows what the desktop ran.
How often RepoOps is right, on every approval request
When your team routes approvals through promptcompute, each request RepoOps makes for a case (a rollback, a fix, the merge of a fix) carries how often the mechanism that named the case's suspect has been right: the mechanism, the band, how many labelled cases it has, how many of those were right, the share right over the last 90 days, and whether that is enough labels to mean anything. Under 5 labelled cases there is no share, only the count. The numbers are the ones on the Accuracy tab, read when the request is made, and they travel inside the signed request, so the approver sees them on the request in promptcompute, and a merge or deploy also shows them as a line of its change risk card. A case that named no change sends none. On the case page, beside the approval state, the rollback says what went with the request and whether promptcompute approved it on its own or asked a person, on the desktop and on repoops.ai.
Shared code the failing route imports
A change can break a route without touching the route's own file: it edits a helper the route imports. When a change touched none of the route's files, the desktop app follows the repository's import graph from the route up to two steps and checks whether the change edited a file on the way. If it did, the case names the path, for example "changed lib/db.mjs, which app/api/checkout/route.ts imports". That ranks the change below one that touched the route itself and above one that touched neither, and it never makes a change the answer on its own. With no import graph recorded, the test reads not measured rather than failed. The import graph stays on the desktop; the case it publishes carries only the file path the test found. A case repoops.ai builds itself says shared code was not checked there.
An activity drop after a deploy
A PostHog series on posthog.eventAllowlist that falls at least 30 percent in the six hours after a production deploy, against the same hours on the previous seven days, opens a case naming that deploy. It is judged once two hours have landed, and stays silent with fewer than three days of history, where the row reads measuring. It is an association with the deploy, not proof.
Evidence coverage and retrieval
Every case shows Evidence coverage: seven evidence families, the transcript among them, each captured, partial, not requested, unsupported, expired or restricted. On the hosted case an owner or admin of a repository under a managed capture policy can press Retrieve missing evidence, which checks stored content first, then asks the installations linked to the case's sessions. An offline installation keeps the request for up to 72 hours before it reads Expired.
API and MCP
GET /api/incident-attribution?repo=<id>&event=<prod.error id> returns the chain for one event; omit event for the newest. The MCP tool get_incident_attribution returns the same chain, its edges and any activity drop, and get_agent_blast_radius lists the incidents attributed to one session or commit. Both read the last seven days by default and never write.
Cost, egress and storage
The rules make no model call, including the guard draft. The one model call is AI investigation, off by default and on your own key. Outbound traffic is each armed source pulling its own service, the provider status pages read after each Vercel pull, and the Slack message a new production case sends when that alert is on. Incident rows, causal links and verdicts stay in the repository's brain directory under incidents/ and causal-links/, with no sweep and no delete route, so they grow. Production events stay in their day file for 30 days, then move to a gzipped monthly archive that is still read.
What an error cost
Each error case shows two dollar figures, side by side and never added together, on the case page, on its Today row and on Cost. Agent spend is the priced spend of the agent session attribution links to the error, plus the fix runs and builds recorded on the case. On the hosted dashboard the sessions are those of the repository in the 30 minutes before the error (or before the failed deployment that preceded it), a time match rather than a proven cause, and the page says so. A session with no price for its model is left out and named, so a case with nothing priced reads not priced, never $0. User impact is the users the source says the error reached (Sentry's user count, or the page views a web vitals regression measured), summed over a grouped case, times the value per affected user you set under What an affected user is worth in Settings. Until you set one it reads not set. The setting recommends $1, and its Use $1 button fills the field without saving it: most users an error reaches are visitors, not paying customers, so $1 ranks errors by reach without inflating the dollars, and once you know your monthly revenue per active user, use that. User impact is your judgement, not a measurement. A source with no user count, such as Vercel logs or PostHog, says so.
Which case to open first
Each production case also carries one Impact line: how many users the error hit and the revenue at risk. Users hit is Sentry's own user count on the issue; RepoOps keeps the number, never a user id or an email. Vercel, Railway and Cloudflare logs name no visitor, so their cases read users hit not measured. Revenue at risk is an estimate: the site's revenue per hour over the last 28 days, from the Stripe usage key on Connectors, times the hours the case has been open, times the share of the site's requests that failed while it was open. A case on a checkout or payment route uses the share of those routes' requests instead. The inputs sit under the figure. Only owners and admins on repoops.ai see it, because it tells the site's revenue; the desktop reads it as not measured. Today and the case list put the most revenue at risk first, then the most users hit, then the most severe, and a figure not measured sorts last, never as zero. The Slack message for a new case carries the same line with users hit only: a channel is not limited to owners, so it always reads revenue at risk not measured.
Fixed errors that come back
When an error you already fixed shows up again, from the source that first reported it or from any other connected source, its case reopens instead of a new case opening. Two errors count as the same when they come from the same repository, are the same kind of problem, and carry the same message once hostnames, ids and numbers are taken out, so a TypeError Sentry reported and Railway later logged is one error. Only a resolved case with a merged fix on its record reopens, and only for a sighting after it resolved. The case records the source that brought the error back, the pull request whose fix did not hold, and its lesson, and the finding page says how many times it recurred and the last fix. If the case has an admitted lesson, an armed guard or a promoted playbook, the same fix is queued for approval. Nothing builds until someone approves it, and nothing merges outside the auto-merge gate and your class settings. When a fixed case closes, RepoOps drafts its lesson and a guard on its error, arms the guard, and holds the lesson for your review.
Stopping it
Press Disable on the source's card to stop its pull, and revoke the token at the provider too. REPOOPS_BRAIN_DREAM=0 stops the nightly pass. The local receiver has no off switch; only the server's loopback gate stands in front of it. Nothing re-runs or rewrites an attribution; the dispute is the appeal.
On the hosted dashboard
On repoops.ai, /team/agent-traces opens the same v2 Attribution page, with its Changes, Agent sessions, Scorecards and Change risk tabs; the scorecards are built from what each desktop publishes with its brain. Production records a collector sends straight to the team are described in the production evidence guide.