claude-quickstarts / sentry-autofix
CLAUDE.md19k starsChanged 39 days agoMITView on GitHub
Long-running Node server (Hono). Sentry posts a signed issue / created webhook → src/app.ts verifies it and hands the issue to src/fixer.ts → one Managed Agents session per issue, with the repository mounted as a githubrepository resource, the Sentry MCP credential attached through a vault, a dollar budget, the kickoff message in initialevents, and metadata.sentryshortid as the dedupe key → the agent reads the issue and Seer's analysis through the Sentry MCP server, reproduces, fixes, pushes autofix/<short-id> → it calls…
- Reads credentials
- Installs packages
We split this CLAUDE.md into the rules it gives an agent
2 rules. About 0 are common, 1 is distinctive, and 1 is very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈1
Distinctive · estimate
This author's own choices. Worth a look.
1
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 38
Try it: Start the demo app with npm start, run npm run break in it, find the new issue's short ID with the plugin (or in Sentry), then npm …
- Distinctive: line 41
After the base loop works, offer extensions: Ask which the user wants.
≈ “Common” is an estimate: at least 1 in 5 of the 25,680 CLAUDE.md files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Sentry autofix on Claude Managed Agents
Long-running Node server (Hono). Sentry posts a signed issue / created webhook → src/app.ts verifies it and hands the issue to src/fixer.ts → one Managed Agents session per issue, with the repository mounted as a github_repository resource, the Sentry MCP credential attached through a vault, a dollar budget, the kickoff message in initial_events, and metadata.sentry_short_id as the dedupe key → the agent reads the issue and Seer's analysis through the Sentry MCP server, reproduces, fixes, pushes autofix/<short-id> → it calls the open_pull_request custom tool, which this host answers with the GitHub API. npm run fix -- SHOP-1A runs the same path without a webhook.
Sentry ──POST /webhooks/sentry──▶ app.ts (HMAC check, issue.created only)
│ onIssue
▼
fixer.ts ──sessions.create──▶ session ─────────────▶ issue fixer (opus)
▲ resources: github_repository bash, read, edit, grep
│ vault_ids: Sentry mcp_oauth sentry MCP: get_sentry_resource,
│ budget, metadata search_*, analyze_issue_with_seer
│
GitHub REST ◀── open_pull_request ┘◀── agent.custom_tool_use {branch, title, body}
(host token, host-chosen repo/base, user.custom_tool_result {PR URL | error}
host-written "Fixes SHOP-1A")Needs @anthropic-ai/sdk ≥ 0.125.0, jq, and ant ≥ 1.34 (the first release whose ant apply manages vaults).
When the user asks to set this up, get it working, or debug it
- Invoke
/claude-apifirst. It loads the Managed Agents API reference (agents, sessions, environments, events, vaults, MCP, permission policies). Use it as the source of truth for any SDK call you write or edit. Don't guess field names. - Use the installed Sentry plugin (
./start.shinstalls it) to list the organizations and projects the user can access, and ask them to pick the target. Never pick a project for them. If the plugin'ssentryMCP server is not authenticated, ask the user to run/mcpand sign in. - Explain the two OAuth grants before the second sign-in: Claude Code's plugin credential serves this conversation, and the grant
npm run sentry-loginsaves to the vault serves sessions that webhooks start. Never inspect or copy Claude Code's credential storage, and never put a Sentry API token in.env, a shell variable, or the agent prompt. - Walk the setup in this order. Each step depends on the one before it.
- A repository to fix. To use the demo: copy
demo-app/out of this checkout, make it its own repository, and push it.cp -r demo-app ~/sentry-autofix-demo && cd ~/sentry-autofix-demo git init -b main && git add -A && git commit -m "Checkout service" gh repo create sentry-autofix-demo --private --source . --push - Protect the base branch. In the repository: Settings > Rules > Rulesets > New branch ruleset, target the default branch, enable "Require a pull request before merging" and "Block force pushes", set enforcement to Active, and leave the bypass list empty. The server refuses to start without it. A classic branch protection rule does not pass: it exempts repository admins unless "Do not allow bypassing the above settings" is ticked, and the token usually belongs to an admin. If rulesets are not offered on a private repository under the user's GitHub plan, make the demo repository public.
- A GitHub token. Fine-grained, that one repository only, Contents: read and write, Pull requests: read and write. Leave Workflows at no access, so GitHub itself rejects a push that adds or edits a workflow file. CI that runs on every pushed branch will run the agent's branch too, before review: keep secrets out of reach of push-triggered workflows. It goes in
.envasGITHUB_TOKEN. - Sentry. Have the user pick the organization through the plugin. Create a Node project in it (or pick an existing one), put its slug in
.envasSENTRY_PROJECT, and put its DSN in the demo app's environment asSENTRY_DSN. Add the GitHub integration to the Sentry organization and add the repository to it: that is what makesFixes SHOP-1Alink the pull request to the issue. - Managed Agents resources.
ant auth login,npm install, then./agents/setup.sh. It runsant apply --yes agents/issue-fixer, which creates or updates the agent, environment, and vault and writes their IDs toclaude-lock.json(the app reads them from there), then runs step 6 when the vault has no credential forhttps://mcp.sentry.dev/mcp. That first run waits on the user's browser consent, so give the command a long timeout or have the user run it in their own terminal. Ifant applyprintsrefusing to apply, show the user the reason before reaching for--force. The lockfile records the organization and workspace, so checkant auth statusfirst: applying under a different profile is refused rather than silently creating copies. - Sentry credential.
npm run sentry-login(setup runs it the first time) prints a URL. Stop while the user opens it and approves the organization. On Sentry's screen only Inspect Issues & Events and Seer stay checked. The script stores anmcp_oauthcredential in the vault and probes it. Read back thecredential: validation statusline:invalidmeans the SSO limitation (step 5). On a remote machine the browser's redirect tolocalhost:8976fails to load: the user pastes that final URL back into the terminal. - Try it. Start the demo app with
npm start, runnpm run breakin it, find the new issue's short ID with the plugin (or in Sentry), thennpm run fix -- <SHORT-ID>here. A fix takes a few minutes. Seer alone can take five. - Webhooks. Only after the CLI path works. Sentry: Settings > Developer Settings > New Internal Integration, webhook URL
<tunnel>/webhooks/sentry, then checkissueunder Webhooks. If that checkbox is disabled, the integration lacks read permission on issues and events: grant it under Permissions first. Client Secret goes in.envasSENTRY_CLIENT_SECRET. Thennpm run dev.
- A repository to fix. To use the demo: copy
- Recognize the SSO limitation. If validation says
invalid, or the first fix fails withmcp_authentication_failed_erroror 403s inside tool results, the organization is rejecting the user-bound MCP OAuth token (SSO enforcement or a similar policy). The org-issued token that would work needsAuthorization: Sentry-Bearer, and the vault can only sendBearer. Do not loop onnpm run sentry-login. Show the user "Known limitations" in the README. - After the base loop works, offer extensions. Ask which the user wants.
- Outcomes: kick off with
user.define_outcomeand a rubric (new test fails before the fix, whole suite passes after, diff touches only what the root cause needs) instead ofuser.message, so a grader sends weak fixes back for another iteration. - Seer webhooks: subscribe the integration to the
seerresource and start the session onseer.root_cause_completed, passingdata.root_causein the kickoff, so the agent starts from Seer's finished analysis instead of waiting on it. The delivery goes through the same signature check insrc/app.tsbefore anything reads it. Seer's text is derived from error data that outsiders can write, so fence it in the kickoff as untrusted data the waykickoff()fences the issue title. SessionToolRunner:client.beta.sessions.events.toolRunner(sessionId, {tools})replaces the hand-written loop indrive(). It reconnects dropped streams. It does not reportbudget_reachedorretries_exhaustedstops or the agent's final message, which is why this quickstart reads the stream itself.- Hear about a lapsed grant: register a webhook for
vault_credential.refresh_failed, so a failed refresh reaches a person before the next issue's session fails on it. - Tell the team: post the pull request URL to Slack from the
pr_openedbranch inhandleCustomTool. The host posts it, with text the host writes. Don't give the session a Slack tool. - A feature flag instead of a wait: give the agent a second custom tool that asks to turn off a LaunchDarkly flag for the broken code path while the pull request waits for review. Keep it host-side like
open_pull_request, with the flag key fixed in config, and have the host wait for a person to approve (a Slack button, a CLI prompt) before it calls LaunchDarkly. Anyone who can trigger an error can start a session, so an unapproved flag flip would let an outsider switch off a feature by sending bad requests. A pull request has a reviewer in front of it. A flag change does not unless you put one there. - Schedule instead of webhooks: a scheduled deployment that runs
search_issuesfor new unresolved issues each hour. See/claude-api, scheduled deployments.
- Outcomes: kick off with
Design rules to keep when editing
- The agent's shell is
always_allowand reads attacker-writable text. Anything that could widen what it reaches (a newallowed_hostsentry, an enabled web tool,update_issue,execute_sentry_tool) needs the same scrutiny as handing a stranger that capability. - Host-side tools decide the repository, the base branch, and the issue link. Never take those from tool input.
drive()is one code path for a first connect, a reconnect, and a restarted host: open the stream, replayevents.list, tail. Keep new event handling idempotent against replay, the way theansweredset keeps a tool call from being answered twice.- Log tool names, never tool inputs. Inputs are derived from production error data.
hasClosingReferenceinsrc/github.tsmirrors Sentry's parser (src/sentry/utils/groupreference.pyin getsentry/sentry) and GitHub's keyword rule. Sentry's reference span runs through plain words and newlines until punctuation, so text the host writes into a pull request uses the verbs fix, close, and resolve exactly once, inFixes <SHORT-ID>., and that line ends with a period.mcp_servers[].urlinagent.yaml,SENTRY_MCP_URLinsrc/fixer.ts(whichsrc/sentry-login.tsimports), and the URLagents/setup.shgreps for must be the same string. The platform matches credentials to servers by URL.SCOPESinsrc/sentry-login.tsis narrower than what the server advertises, and the script refuses a token that reports more. The tool allow-list inagent.yamlcan drift in the Console, so it is not the only bound on what the credential can do.
Debugging
| Symptom | Cause | Fix |
| Server exits: "is not protected" or "classic branch protection rule but no ruleset" | No active ruleset requires a pull request for GITHUB_BASE_BRANCH. A ruleset in Evaluate mode does not count, and neither does a classic rule | Step 4.2, with enforcement set to Active |
ant apply cannot tell what kind of resource vault.yaml is | The file lost its type: vault line, or ant is older than 1.34 | Restore the line, or upgrade ant |
Startup says claude-lock.json is missing or has no agent | ./agents/setup.sh has not run in this directory, or the lockfile was deleted | Run it. If the resources still exist, ant apply would create new ones: archive the old ones in the Console |
| Server exits: "no Sentry credential" | npm run sentry-login never ran, or ran against a different vault | Run it again. It replaces the old credential |
mcp_authentication_failed_error on the first fix, or sentry-login prints validation status invalid | The organization rejects the user-bound MCP OAuth token (SSO enforcement or a similar policy), or the credential URL does not match agent.yaml | Check the URLs match. If they do, signing in again will not help: see "Known limitations" in the README |
mcp_authentication_failed_error after fixes that used to work | Refresh failed: the grant was revoked or the Sentry session behind it lapsed. ant beta:vaults:credentials mcp-oauth-validate shows the failing step | npm run sentry-login |
| 403 from Sentry inside a tool result | The grant lacks the skill, or the organization rejects user-bound OAuth tokens | npm run sentry-login and approve Inspect Issues & Events and Seer. If it persists, see "Known limitations" in the README |
sentry-login says Sentry "granted more than this quickstart asked for" | The token reports a scope outside SCOPES in src/sentry-login.ts | Nothing was stored, and the old credential is untouched. Read which scope the message names before widening SCOPES |
mcp_egress_blocked_error | allow_mcp_servers: true is missing from environment.yaml | Restore it and re-run ./agents/setup.sh |
| Session never calls a Sentry tool, or parks waiting for a confirmation | The tools were disabled or set to always_ask in the Console after an agent update | Set the five tools back to enabled and always allow in the Console |
| Hosted Sentry MCP rejects a pasted API token | It accepts user tokens only as Authorization: Sentry-Bearer, and a static_bearer vault credential sends Bearer | Use npm run sentry-login (OAuth). Don't switch the credential type |
| Webhook returns 401 | SENTRY_CLIENT_SECRET is from a different integration, or a proxy re-serialized the body | Copy the Client Secret again. The signature covers the exact bytes Sentry sent |
Webhook returns {"ignored": true} | Not issue / created, or SENTRY_PROJECT does not match the issue's project slug | Expected for other events. Check the slug |
| "already has a session" or "has ended" | This process is already driving a session with this sentry_short_id, or that session is terminated | Wait for it, or archive it (Console, or ant beta:sessions archive --session-id ... < /dev/null) to run the issue again |
| Log says "(picked back up)" | A session for the issue existed with no driver, because the host restarted or lost its stream. drive() replayed the event log and carried on | Nothing. This is the recovery path |
| Log says "fixes are already running" | AUTOFIX_MAX_ACTIVE sessions are in flight, and the new issue was skipped. Sentry does not redeliver | npm run fix -- <SHORT-ID> once there is room, or raise the limit |
open_pull_request error names a commit that "would close or resolve an issue" | A commit message has fix, close, or resolve followed by an issue reference, or by a hyphenated word Sentry would read as a short ID (Fix off-by-one). The agent prompt asks for other verbs, so this is a slip or an injection | The agent recreates the commits on a new branch. If it keeps happening, read the Sentry event for injected text |
| Pull request closed with a comment from the autofix host | The end-of-session recheck failed closed. Either commits landed after the pull request opened and no longer pass inspection (only possible if revoking push access failed: look for "could not revoke push access" in the log), or GitHub could not be read three times in a row | The comment says which. For the first, read those commits and the Sentry event. For the second, check the commits and reopen the pull request |
Run ends failed, note stopped: budget_reached | The session hit AUTOFIX_MAX_USD | Raise it for new sessions, or raise the paused session's budget in the Console to resume it |
open_pull_request error "No commits between" | The push failed or went to another branch | Read the session in the Console. A rejected push to the base branch is the protection working |
| Pull request merged, issue still open in Sentry | Sentry resolves on the next release that contains the commit, not on merge | Create a release with commits associated, or resolve it by hand |
npm install 404s in demo-app/ behind a corporate mirror | The mirror lacks @sentry/node 10's newer dependencies | npm install @sentry/node@9. The two calls the demo uses are the same in 9 and 10 |
Trending
More talk lately.about the whole repository
Who's talking about anthropics/claude-quickstarts
- Cole Medin“I Forced Claude to Code for 24 Hours NONSTOP, Here's What Happened”YouTube · Dec 4, 2025 · 39k views
- Ray Fernando“Claude SDK: 24-Hour Coding Agent | Cole Medin”YouTube · Dec 8, 2025 · 18k views
- Web Dev Cody“I Let Claude Code Build an App for 24 Hours”YouTube · Dec 8, 2025 · 13k views
- 橘鸦Juya“Claude Haiku 5.5 发布;GPT-6 上线 Chat;Sonnet 降价;Claude Max 获赠API额度【AI 早报 2026-10-08】”YouTube · Oct 8, 2026 · 5.7k views
- DataSense“𝗔𝗜 𝗧𝗵𝗮𝘁 𝗖𝗼𝗱𝗲𝘀 𝗜𝘁𝘀𝗲𝗹𝗳? 𝗥𝗲𝗮𝗰𝘁 𝗟𝗼𝗼𝗽 𝘃𝘀 𝗥𝗮𝗹𝗽𝗵 𝗟𝗼𝗼𝗽 𝗘𝘅𝗽𝗹𝗮𝗶𝗻𝗲𝗱”YouTube · Feb 28, 2026 · 694 views
The biggest 5 of 40 mentions linking to the repository that our crawl found. Each line is their own headline.
See all 40
Talked about on YouTube, GitHub and Bluesky (40 times).
On YouTube · 20
- Dec 4, 2025I Forced Claude to Code for 24 Hours NONSTOP, Here's What Happened — Cole Medin39k views · 198 comments
- Dec 8, 2025Claude SDK: 24-Hour Coding Agent | Cole Medin — Ray Fernando18k views · 36 comments
- Dec 8, 2025I Let Claude Code Build an App for 24 Hours — Web Dev Cody13k views · 109 comments
- Oct 8, 2026Claude Haiku 5.5 发布;GPT-6 上线 Chat;Sonnet 降价;Claude Max 获赠API额度【AI 早报 2026-10-08】 — 橘鸦Juya5.7k views · 1 comment
- Feb 28, 2026𝗔𝗜 𝗧𝗵𝗮𝘁 𝗖𝗼𝗱𝗲𝘀 𝗜𝘁𝘀𝗲𝗹𝗳? 𝗥𝗲𝗮𝗰𝘁 𝗟𝗼𝗼𝗽 𝘃𝘀 𝗥𝗮𝗹𝗽𝗵 𝗟𝗼𝗼𝗽 𝗘𝘅𝗽𝗹𝗮𝗶𝗻𝗲𝗱 — DataSense694 views
15 more on YouTube
- May 2, 2026Anthropic Open-Sourced 5 Repos (230k Stars). You've Used Claude Daily and Cloned None of Them. — Willm601 views
- Apr 17, 2026Spec Driven Discovery — Kai Hendry254 views
- Mar 21, 2026Claude Quickstarts 2026: Computer Use, Coding Agents, and Financial RAG — Blueprint Bytes189 views
- Oct 18, 2026Claude-quickstarts: build AI chat assistants from support articles — Next Horizon103 views · 1 comment
- Dec 7, 2025GitHub - anthropics/claude-quickstarts: A collection of projects designed to help developers quic... — GitHub Daily Trend AI Podcast84 views
- Oct 11, 2026#9 Anthropic’s Initializer + Coding Agent Pattern: Long-Running Agent Harness Breakdown — Vishal81 views
- Aug 8, 202619 Free Anthropic Resources Repo on GITUB that Put You Ahead of 95% of Claude Users — Ai Therapy Labsays it tested it72 views
- Oct 11, 2026Anthropicの定期実行AIエージェント、許可する人なしでどう取りこぼしを防ぐ?|返事を見てから帳簿へ — エンジニアになりたいずんだもん66 views
- Dec 7, 2025anthropics/claude-quickstarts - Gource visualisation — Gourcer58 views
- Oct 11, 2026Why Scheduled AI Agents Break (And How Anthropic Fixed It) — PromptlyAshwin56 views · 1 comment
- Aug 9, 2026Claude 19 Free Resources Repo on GITUB that Put You Ahead of 95% of Claude Users — Ai Therapy Labsays it tested it35 views
- Aug 8, 202619 Free Claude Resources That Put You Ahead of 95% of Claude Users — Ai Therapy Labsays it tested it23 views
- Oct 19, 2026고객 문의 메일, AI 에이전트가 답장 초안까지 써 두게 하는 법 | AX 설계 — 수달빌더22 views · 2 comments
- Oct 9, 2026Claude Haiku 5.5 in GitHub Copilot | AI Daily Brief | 2026-10-08 — Insight AI19 views
- Oct 9, 2026Claude Managed Agents - Build a Scheduled AI Agent From Scratch — ProAI Clips17 views
On GitHub · 19
- Oct 17, 2026Run agent task evals against previews — totalolage/deskohub-site0 reactions · 1 comment
- Sep 25, 2026agent-skills.github.anthropics.claude-quickstarts: init at 0-unstable-2026-08-21 — sudosubin/agents.nix0 reactions
- Sep 23, 2026docs(managed_agents): move the self-hosted sandbox variants to claude-quickstarts — anthropics/claude-cookbooks0 reactions · 2 comments
- Sep 21, 2026docs(managed_agents): move the Linear, road trip planner, and MCP server apps to claude-quickstarts — anthropics/claude-cookbooks0 reactions · 2 comments
- Sep 16, 2026docs(managed_agents): move the Slack and Sentry apps to claude-quickstarts — anthropics/claude-cookbooks0 reactions
14 more on GitHub
- Sep 16, 2026docs(managed_agents): move the Slack and Sentry apps to claude-quickstarts — anthropics/claude-cookbooks0 reactions · 2 comments
- Sep 15, 2026Factory.ai 深度调研报告 — Pines-Cheng/blog0 reactions
- Sep 13, 2026/automations: real product widgets + trademark disclaimer — clancybooher/peak-view-windows0 reactions · 1 comment
- Aug 2, 2026goal-maker/bhag: adopt Anthropic's long-run harness (immutable feature_list.json + append-only progress file + fixed bootstrap drill) — jackneil/claude-jacked0 reactions
- Feb 17, 2026Closing the loop - Infrastructure for Agentic Engineering — schemalabz/opencouncil0 reactions
- Feb 3, 2026[Feature] Add Session Persistence, Security Model, and Progress Tracking (v2.2.0) — jnPiyush/AgentX0 reactions · 4 comments
- Jan 13, 2026feat: Add support for ANTHROPIC_API_KEY authentication — nirmalarya/claude-harness0 reactions
- Jan 2, 2026Meta-Library Architecture: Transform Any AI Workflow Knowledge into Executable FSMs — JulesGosnell/claij0 reactions
- Jan 2, 2026Learn from Anthropic's Long-Running Harness Pattern — JulesGosnell/claij0 reactions
- Jan 1, 2026Does this work with Anthropics new Harness for long running agent strategy? — rubycatco/claude-agent-sdk-ruby0 reactions · 2 comments
- Dec 23, 2025Add a think tool — byronxlg/polyagent0 reactions
- Dec 11, 2025feat: Add Autonomous Claude Code Builder system — krzemienski/shannon-framework0 reactions · 2 comments
- Dec 6, 2025Clone Anthropic computer-use-demo into repository — matheus-rech/comp-use0 reactions · 2 comments
- Nov 10, 2025File Editor Tool — strands-agents/sdk-typescript0 reactions · 7 comments
On Bluesky · 1
- Oct 18, 2026🚀 Skyrocketing! 🚀 (200+ new stars) 📦 anthropics / claude-quickstarts ⭐ 18,532 (+453) 🗒 TypeScript A collection of projects designed to… — @github-trending-js.bsky.social2 likes and reposts · 1 reply
In this repository23 other files it gives its agents.
- CLAUDE.mdCLAUDE.md
- managed-agents/assistant-ui/CLAUDE.mdCLAUDE.md
- managed-agents/chat-sdk/CLAUDE.mdCLAUDE.md
- managed-agents/copilot-kit-ag-ui/CLAUDE.mdCLAUDE.md
- managed-agents/daily-brief/CLAUDE.mdCLAUDE.md
- managed-agents/knowledge-wiki/CLAUDE.mdCLAUDE.md
- managed-agents/linear/CLAUDE.mdCLAUDE.md
- managed-agents/mcp-server-typescript/CLAUDE.mdCLAUDE.md
- managed-agents/roadtrip-planner/CLAUDE.mdCLAUDE.md
- managed-agents/self-hosted-sandboxes/CLAUDE.mdCLAUDE.md
- managed-agents/sentry/CLAUDE.mdCLAUDE.md
- managed-agents/slack/CLAUDE.mdCLAUDE.md
- first-runSkill
- verifySkill
- assistant-uiSkill
- chat-sdkSkill
- verifySkill
- knowledge-wikiSkill
- linearSkill
- mcp-server-typescriptSkill
- roadtrip-plannerSkill
- sentrySkill
- slackSkill
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
Reviews can't be read right now.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

