Auto-fix

Let Claude Code fix your production errors and open the pull request

When Errilo reports a new error or a regression, a GitHub workflow starts Claude Code. The agent reads the issue over MCP, reproduces the error with a failing test and fixes it. The workflow opens a pull request and marks the issue resolved in the next release. One workflow file to copy, nothing to install.

Updated

Errilo is in development. The workflow runs today against app.errilo.com: we tested it end to end on 18 November 2026 on a demo repository. The source is on GitHub: geterrilo/examples.

How it works

Three services talk to each other: Errilo, which catches the error and serves it over MCP; GitHub Actions, which runs the workflow in your repository; and Claude Code, the agent, which runs inside the workflow.

From the alert to the pull request
  1. From Errilo to GitHub Actions: New issue or regression: the alert sends a repository_dispatch with the issue ID.

  2. From GitHub Actions to Errilo: Reads the issue with the project token and checks that it should be fixed.guard

  3. From GitHub Actions to Claude Code: Starts Claude Code with the fix_issue prompt and a read-only GitHub token.fix

  4. From Claude Code to Errilo: Reads over MCP the stack trace, the events and the commit of the release.fix

  5. In Claude Code: Checks out that commit, writes a failing test, fixes the code, commits locally.fix

  6. From Claude Code to GitHub Actions: Hands back its commits and a summary, exported as a patch.fix

  7. In GitHub Actions: A job without the agent pushes errilo/fix-<id> and opens the pull request.pull-request

  8. From GitHub Actions to Errilo: Comments with the link and marks the issue “resolved in the next release”.pull-request

The workflow has three jobs, and the agent only runs in the middle one. guard decides whether the issue should be fixed. fix runs Claude Code with a GitHub token that can only read: it can neither push nor open a pull request. pull-request pushes the agent’s commits to a dedicated branch and opens the pull request, without the agent.

You review and merge the pull request like any other. If the error comes back once the fix is deployed, Errilo reopens the issue as a regression and alerts again: a new run starts.

There is no code of ours to install: one workflow file that uses anthropics/claude-code-action, maintained by Anthropic, and the Errilo MCP server. Copy it, read it, change it.

What you need

1. Send releases with their commit

The agent fixes the code at the version that crashed. Errilo knows that version when your Sentry SDK sends a release and the release has a commit. A release that is a commit SHA is enough:

Sentry.init()
Sentry.init({
  dsn: process.env.SENTRY_DSN,
  release: process.env.GIT_SHA,
});

Otherwise, record the commit when you deploy:

Deploy
sentry-cli releases set-commits "$RELEASE" --auto

Without a release, the agent works from the default branch, and Errilo can’t mark the issue “resolved in the next release”. The pull request is still opened.

2. Create an Errilo token for the project

In Errilo, open Settings, API tokens, New token. Choose the project of this repository and tick issues:read and issues:write.

The token only sees this project. The workflow reads the issue with it, the agent reads the stack trace and the events, and the last job writes the comment and the status. It is shown only once: keep it for step 4.

3. Add the workflow

Copy the workflow to your repository, on the default branch: GitHub only starts repository_dispatch workflows from there.

At the root of your repository
mkdir -p .github/workflows
curl -o .github/workflows/errilo-auto-fix.yml \
  https://raw.githubusercontent.com/geterrilo/examples/main/auto-fix/errilo-auto-fix.yml

Then add your project’s setup to the fix job, where the commented block after the checkout is, so that the agent can install the dependencies and run your tests:

.github/workflows/errilo-auto-fix.yml
      # Your project's setup, after the checkout of the fix job
      - uses: actions/setup-node@v6
        with:
          node-version: 24
      - run: npm ci

4. Add the secrets

In the repository, open Settings, Secrets and variables, Actions:

Secrets and variables of the auto-fix workflow
NameKindValue
ANTHROPIC_API_KEYSecretYour Anthropic API key. Or, instead, the next one.
CLAUDE_CODE_OAUTH_TOKENSecretA Claude subscription token (Pro or Max), created with claude setup-token.
ERRILO_TOKENSecretThe Errilo token from step 2.
ERRILO_ORGVariableYour organization slug: the first segment of your Errilo URLs (app.errilo.com/<slug>/…).
ERRILO_AUTOFIX_GITHUB_TOKENSecretRecommended: the token that opens the pull request, see below.
ERRILO_MAX_PRS_PER_DAYVariableOptional. Cap on pull requests opened in 24 hours, 3 by default.

Also turn on Settings, General, Automatically delete head branches. The workflow skips an issue while its errilo/fix-<id> branch exists: a branch left after a merge would block the next attempt on a regression.

Why ERRILO_AUTOFIX_GITHUB_TOKEN? Without it, the pull request is opened with the workflow’s GITHUB_TOKEN. GitHub then only lets it open pull requests if Allow GitHub Actions to create and approve pull requests is on (in the organization, then in the repository), and doesn’t run your CI on that pull request. A fine-grained token on this repository only, with Contents and Pull requests in read and write, avoids both. Only the last job receives it, never the agent.

5. Connect the Errilo alert

On GitHub, create a fine-grained personal access token for this repository only, with Contents in read and write (GitHub requires it to send a repository_dispatch), and a short expiry. For a repository of an organization, choose the organization as Resource owner; otherwise GitHub answers 404.

In Errilo, open the project, then Alerts, Create a rule, channel GitHub: the repository (owner/name), the token, and the triggers New issue and Regression. The workflow ignores spikes.

Click Send a test alert: a run appears in the Actions tab of the repository and stops at once with “test alert received”. The wiring works.

6. Try it on one issue

You don’t have to wait for a new error. In Actions, Errilo auto-fix, Run workflow, enter the ID of an issue (the number at the end of its Errilo URL).

The run opens a pull request named fix: Errilo issue <id>, with the diagnosis, the fix and the test the agent added. In Errilo, the issue shows a comment with the link and the status “resolved in the next release”.

Tested on 18 November 2026 on a demo repository with two bugs (an unknown discount code and an empty cart), each sent to Errilo by a real crash. Each run reproduced its bug with a test, opened the pull request and resolved the issue in Errilo.

If the agent can’t reproduce the error, or isn’t sure of its fix, it opens nothing and writes why in the run summary.

Safeguards

What it costs

Errilo charges nothing for the MCP server or for this workflow, on every plan, the free one too. The agent runs on your Anthropic account: billed by token with an API key, or counted against your plan’s limits with a Claude subscription. Runs also use GitHub Actions minutes.

For scale: on the demo bug (an unknown discount code that crashes a cart function), a run took 7 agent turns, 30 seconds, and the action reported $0.08. A real code base costs more: the agent reads more code and runs a longer test suite.

Three settings bound the cost: the daily cap on pull requests, --max-turns in the fix job (80 by default) and timeout-minutes (45).

Limits

Want another model or another agent? Set --model in the claude_args of the fix job. Or replace Claude Code with any agent that speaks MCP: give it the same MCP configuration and instructions, and keep the read-only token. The guard and pull-request jobs don’t depend on the agent.

To use the MCP server from your editor instead, read Agents and MCP. Comparing with Sentry’s AI agent? Read Errilo as a Sentry Seer alternative.

Early access

We’re opening a private beta in summer 2027 for a handful of teams running Node.js or TypeScript in production. Join the waitlist and we’ll write when it opens.