Cette page est affichée en anglais. Une traduction française est en cours.
SkillsApr 28, 2026·3 min de lecture

sentry-errors — Auto-Triage Subagent for Sentry

Open-source Claude Code subagent that pulls recent Sentry errors via MCP, groups by component, and suggests fix priorities. Inspired by Boris Cherny.

Introduction

sentry-errors is a Claude Code subagent that pulls recent Sentry errors via the official Sentry MCP, groups them by component and root cause, and emits a prioritized triage list. It is built for the morning-standup pattern: instead of you scrolling Sentry, the subagent reads it for you and tells you what actually matters.

Boris Cherny describes this exact pattern as part of his Claude Code setup — he names error triage as one of the things subagents handle for him while he works on something else. This entry packages that pattern.

Works with: Claude Code 1.x + Sentry MCP. Setup: under 2 minutes once Sentry MCP is configured.


How sentry-errors Works

Save to .claude/agents/sentry-errors.md:

---
name: sentry-errors
description: Pull recent Sentry errors, group them by component and root cause, suggest priorities. Use for morning triage or after a deploy.
tools: mcp__sentry__*, Bash, Read
---

You are the sentry-errors subagent. Your single responsibility is to triage Sentry — not fix bugs, not write code, just turn a noisy event stream into an ordered action list.

## Workflow

1. Fetch errors from the last 24h via Sentry MCP (`list_issues` or `list_events` with `dateFrom = 24h ago`).
2. Group by `culprit` (file + function) and root-cause hash.
3. For each group, capture: count, first/last seen, affected users, any new release link.
4. Score priority:
   - P0: > 100 occurrences AND > 10 affected users AND seen first in the last release
   - P1: > 100 OR new in the last release
   - P2: everything else
5. For P0 + P1 groups, attach a one-line hypothesis and the most-recent commit that touched the culprit file (`git log -1 --format='%h %s' -- <file>`).
6. Emit the report below.

## Output format

sentry-errors triage — last 24h
================================
Total events: N
Distinct issues: N
P0: N | P1: N | P2: N

P0:
1. <culprit> — N events, N users, first seen <release>
   Hypothesis: <one-line>
   Last touch: <commit_hash> <commit_subject>

P1:
1. ...

P2 (collapsed): N issues, see Sentry for details.

## Boundaries

- Do not open issues, file PRs, or fix bugs.
- Do not silence/ignore errors in Sentry without explicit user instruction.
- If Sentry MCP is not installed, escalate: "Install Sentry MCP first."

When to use

  • Daily morning standup (before you start coding).
  • Right after a production deploy (15-minute check).
  • During an incident — fastest grouped view of what is actually breaking.

When not to use

  • For a single specific error you are already debugging — just open Sentry.
  • For long-tail historical analytics (use Sentry's UI).

Example session

You:    "Run sentry-errors on overnight events."
Claude: -> Sentry MCP -> fetch 24h
        -> groups 1,247 events into 28 issues
        -> 1 P0, 4 P1, 23 P2
        -> reports:
           P0: src/checkout/charge.ts:88412 events, 87 users, first in v3.4.2
              Hypothesis: Stripe API key rotation broke production
              Last touch: a1b2c3d "Rotate Stripe key"

FAQ

Q: Does it require Sentry MCP? A: Yes — Sentry MCP is the data source. Install it first (TokRepo id 665).

Q: Will it suppress or ignore events? A: No — read-only by design. Triage only, no destructive writes.

Q: How is priority scored? A: Volume + user impact + release proximity. The rules are explicit in the Workflow section so you can tune them.

Q: Can I scope to a specific Sentry project? A: Yes — edit the Workflow's list_issues call to pass project=<slug>.

Q: Is this Boris Cherny's actual subagent? A: No — community-written equivalent based on his public description.


🙏

Source et remerciements

Inspired by Boris Cherny's "fetch and triage error logs autonomously" pattern on howborisusesclaudecode.com.

Citations:

Fil de discussion

Connectez-vous pour rejoindre la discussion.
Aucun commentaire pour l'instant. Soyez le premier à partager votre avis.

Actifs similaires