Use Better Stack with Claude

The Better Stack plugin puts our AI SRE in Claude, with its skills and every Better Stack tool. It runs on your Claude subscription with the latest Claude models, and it's free on every Better Stack plan.

Once it's connected, ask Claude to:

  • Investigate an incident, find its root cause in your logs, metrics, traces, errors, and code, and open a pull request with the fix.
  • Explain why a service got slow or started failing, and what changed around that time.
  • Set up monitors, heartbeats, dashboards, and alerts for a new service, or post a status page update.

You can also have Claude fix your errors on a schedule, with pull requests you review, or investigate every new incident as soon as it starts.

Connect Claude to Better Stack

Claude Code

Install the Better Stack plugin:

Install the Better Stack plugin in Claude Code
/plugin install better-stack

Claude web, desktop, and mobile apps

  1. Add the Better Stack plugin in Claude.
  2. On the plugin's Connectors tab, connect Better Stack and sign in with your Better Stack account.
  3. Start a new chat.

Using Claude Team or Enterprise?

An Owner adds the Better Stack connector in Organization settings β†’ Connectors before members can connect it.

Fix errors on a schedule with Claude

Add a Claude scheduled task that checks your errors in Better Stack every 4 hours and fixes the obvious ones with pull requests. It runs in Anthropic's cloud, so you can close your laptop and merge the pull requests later from your phone.

  1. Connect Better Stack to your Claude account.
  2. Open Claude Code in your app's repository.
  3. Paste this prompt:
Prompt to fix your errors on schedule
Set up a cloud scheduled task that fixes new errors Better Stack catches in this repository's app. It has to run in Anthropic's cloud, so it keeps working while my computer is off. If you're Claude chat, not Claude Code, stop and tell me to switch to the Code tab.

- Name: Fix new Better Stack errors
- Schedule: every 4 hours
- Repository: this repository
- Connectors: only Better Stack
- Prompt for each run:

  Fix the obvious new errors Better Stack caught in this repository's app.
  1. With the Better Stack tools, list the unresolved errors of this repository's Better Stack error tracking application seen in the last 4 hours, most occurrences first.
  2. Skip errors that already have an open pull request in this repository: look for the error's Better Stack link in the descriptions of open pull requests.
  3. Pick at most 3 errors whose root cause is in this repository's code and that a small, safe change fixes. Skip errors caused by outages, configuration or third-party services, and any fix you aren't confident about.
  4. Install the project's dependencies. For each error, start a new branch from the latest default branch, read the error's stack trace with the Better Stack tools, fix the root cause, add a test that fails without the fix, and run the tests.
  5. Push each fix and open a pull request. In the description, link the Better Stack error and say what caused it and how you tested the fix.
  6. End with one line per error you looked at: its pull request, or why you skipped it.

If you can use the Better Stack tools here, look up which error tracking application this repository belongs to and name it in the task's prompt. Otherwise ask me. Before you create the task, check that the Better Stack connector is connected to my Claude account. If it isn't, tell me to connect it at https://claude.com/connectors/betterstack.

Claude creates the task and gives you its link. To try it right away, ask Claude to run it now.

What will Claude change?

It only opens pull requests, and each one links the Better Stack error it fixes. Nothing is merged until you review it. Errors that already have an open pull request are skipped, and so are outages and configuration problems.

Page Claude for your incidents

Have Claude investigate every new incident the moment it starts, alongside the people on call or a few minutes before them. Better Stack wakes a Claude task in Anthropic's cloud, which comments on the incident with the likely cause and the next step.

  1. Connect Better Stack to your Claude account.
  2. Open Claude Code in your app's repository, in your terminal or at claude.ai/code.
  3. Paste this prompt:

    Prompt to put Claude on call
    Put Claude on call for my Better Stack incidents. If you're Claude chat, not Claude Code, stop and tell me to switch to the Code tab. Start by telling me the two things you'll need from me: adding an API trigger to the task, which takes a few clicks, and choosing which incidents and escalation policies page Claude.
    
    1. Create a Claude Code scheduled task that runs in Anthropic's cloud, named "Investigate new Better Stack incidents": daily, latest Opus model, this repository, only my Claude account's Better Stack connector. Its prompt:
    
       Investigate the Better Stack incident in this run's routine-fire-payload block. If there's no payload, only check that you can read my Better Stack incidents, and stop. Read the incident, its monitor, and the logs, metrics, traces, errors, and releases around its start, and compare them with this repository's code and recent commits. Comment on the incident with the likely cause, the evidence with links, the next step, and a link to this session. If a small, safe change fixes it, open a pull request and link it. Never acknowledge, resolve, or escalate an incident.
    
    2. Send me the task's link and ask me for its API trigger: I click the arrow next to the task's name, Edit, + in Trigger, then API, and paste the Fire URL and the token from Generate token (or write the token to a file and tell you where it is). Wait for both.
    3. Create an outgoing webhook named "Page Claude" that fires only when an incident starts, with acknowledged, resolved, reopened, and new comment off, so Claude's own comments don't wake it again. It sends a POST to the Fire URL with the headers "Authorization: Bearer <token>", "anthropic-beta: experimental-cc-routine-2026-04-01", "anthropic-version: 2023-06-01", and "Content-Type: application/json", and the body {"text": "Better Stack incident $INCIDENT_ID started at $STARTED_AT_ISO8601: $NAME. Cause: $CAUSE. $INCIDENT_URL"}.
    4. Run the task once and check in its log that it could read my incidents in the organization where you created the webhook. If it couldn't, send me to https://claude.com/connectors/betterstack to connect that organization, then run it again.
    5. Incidents without an escalation policy already reach the webhook. Look at my escalation policies: which ones monitors and other integrations actually use, their severities, and who they notify. Suggest a few sets for Claude to join that fit my account, such as all policies in use, the high-severity ones, or the ones that notify a given team or on-call rotation, and ask me which, and whether Claude starts alongside the people or a few minutes before them. Then add the "Page Claude" webhook to each: to the first step, or as a new first step of its own, with the people's step waiting the minutes I chose.
    
  4. When Claude asks, add the task's API trigger:

    1. Open the task's link.
    2. Click the arrow next to the task's name and choose Edit.

      Edit in the scheduled task's menu

    3. In Trigger, click + and choose API.

      API in the Trigger row's + menu

    4. Copy the Fire URL, then click Generate token and copy the token.

    5. Paste both into the chat.

Claude creates the Page Claude webhook in Better Stack, so incidents without an escalation policy wake Claude. It then asks which escalation policies Claude joins, alongside your people or a few minutes before them, and adds the webhook there.

Need help?

Please let us know at hello@betterstack.com.
We're happy to help! πŸ™