Use cases · Claude Code

Sentry and Claude Code: connect the MCP server and triage errors daily

Sentry's hosted MCP server gives Claude Code the issues, events, stack traces and releases in your Sentry organization. One command adds it and a browser sign-in connects it; from then on Claude Code can read new errors, find the cause in your code and open a fix. This page covers the setup, the triage rules for CLAUDE.md and how to run triage twice a day without opening a session.

What Claude Code does for Sentry triage

  • Reads unresolved Sentry issues that are new or regressed since its last run.
  • Checks your board first, so a noisy error gets a comment instead of ten new issues.
  • Files each new error with its impact, first and last seen, the release it started in, the top stack frames and a likely cause, marked as a guess.
  • Fixes the small, obvious ones in a pull request with a test, and waits for review.

Claude Code features for Sentry triage

FeatureWhat it doesHow to start
Sentry MCP serverIssues, events, stack traces and releases from your Sentry organizationclaude mcp add --transport http sentry https://mcp.sentry.dev/mcp
/mcpShows connected servers and starts the OAuth sign-inRun it in a session after adding the server
claude -pRuns a triage pass and exits, for cron or CI--allowedTools "mcp__sentry" lets it use Sentry's tools
Scheduled tasksRun triage at set times without opening a session/schedule, or a desktop scheduled task

How to set up Claude Code for Sentry triage

  1. Connect the tools

    Add Sentry's hosted server, then run /mcp and sign in with your Sentry account in the browser. It uses OAuth, so there's no token to copy.

    # Add Sentry's hosted MCP server
    claude mcp add --transport http sentry https://mcp.sentry.dev/mcp
    
    # Then, in a session, sign in with OAuth
    /mcp
  2. Write the rules in CLAUDE.md

    Claude Code reads CLAUDE.md at the start of every session, claude -p runs included. Put the job's rules there, or in a skill under .claude/skills/ if they're long. See the CLAUDE.md guide.

    ## Sentry triage rules
    1. List unresolved production issues first seen or regressed
       since the last run.
    2. Search the board for the Sentry issue ID before filing.
    3. File new ones with users and events affected, first and last
       seen, the release, the top stack frames and a likely cause,
       marked as a guess.
    4. Urgent if it blocks sign-up, payment or data; High above 1%
       of sessions; otherwise Medium.
    5. Small, obvious fix: open a pull request with a test. Don't merge.
    6. Never resolve, ignore or delete anything in Sentry.
  3. Run it without the interactive interface

    claude -p runs one task and exits, so cron, CI or another tool can start it. Choose what it may do without asking with --allowedTools or --permission-mode; --output-format json returns the result with its cost.

    # A triage pass from cron, weekdays at 9:00 and 14:00
    claude -p "Triage new Sentry errors with the rules in CLAUDE.md" \
      --allowedTools "mcp__sentry" --output-format json
  4. Put it on a schedule

    Make it a cloud scheduled task with /schedule (Pro, Max, Ultra, Team and Enterprise), a desktop scheduled task, or /loop while a session stays open. See how to make Claude Code proactive.

Source: Claude Code documentation

Limits and safety

  • It needs to read Sentry issues, not change them. Leave resolving and ignoring to people.
  • Its cause is a guess from the stack trace. A person confirms it before a fix ships.
  • Errors can carry user data. Keep the issues it files on a private board or repository.
  • Since Claude Code v2.1.302, claude -p starts in Manual mode: an action that needs approval is denied unless a rule allows it. Allow only the tools the job needs.

Claude Code or Codex for Sentry triage?

The rules carry over. Write them once in AGENTS.md and put @AGENTS.md in CLAUDE.md, and both agents read the same file.

Step by step for the other agent: Sentry triage with Codex.

Claude CodeCodex
Rules fileCLAUDE.mdAGENTS.md
Connect toolsclaude mcp addcodex mcp add or config.toml
Run without youclaude -pcodex exec
Schedule/schedule, desktop scheduled tasks, /loopScheduled tasks in the ChatGPT app, cron
Built in for Sentry triageSentry MCP over HTTP, /mcp sign-inNative HTTP MCP, codex mcp login
With Crewmark

Make Sentry triage someone's job

Commands run when someone remembers to run them. Crewmark turns your own Claude Code into an AI employee with a role, a goal in numbers, working hours and a heartbeat, so the work happens on schedule and shows up on a board.

  1. Start from the role

    The AI software engineer, with these rules in its brief.

  2. Put the work on its board

    Add the job as a recurring issue. The employee wakes on its heartbeat, does it and reports in a comment.

  3. Related

    The Sentry error triage page has the full brief and priority rules.

FAQ

How do I connect Sentry to Claude Code?

Run claude mcp add --transport http sentry https://mcp.sentry.dev/mcp, then /mcp in a session to sign in with OAuth.

What can Claude Code do with Sentry?

Read issues, events, stack traces and releases, find the code behind an error, file issues on your board and open fix pull requests. Keep resolving and ignoring issues in Sentry with people.

Can Claude Code triage Sentry errors automatically?

Yes, on a schedule: run claude -p from cron or CI, create a scheduled task, or make triage a recurring issue for a Crewmark employee.

Checked against Claude Code's and OpenAI's Codex documentation on November 13, 2026.

Hand Sentry triage to an AI employee on Claude Code.

Crewmark turns Claude Code and Codex sessions into AI employees with roles, goals, working hours and a heartbeat.