Claude Code SRE bot: investigate alerts and deliver fix branches from cloud sessions

Availability: preview — the guide is ready to try; end-to-end validation on a live Claude account is still pending.

Mendry Bot turns a Claude Code cloud session into an on-call AI SRE assistant. Claude reads the logs and your repository, explains the root cause of an alert with evidence, and, once you authorize it, writes the fix in its cloud environment, runs the tests, and pushes a review branch to GitHub. You do not deploy Mendry or run anything locally. Your Claude plan and connected tools may still incur costs.

Use a cloud session at claude.ai/code, not an ordinary Claude chat or the local CLI. This page covers Claude only. For Grok or Meta Muse.ai, see Try Mendry with your existing bot.

  • Alert investigation: queries the logs your cloud environment can reach, correlates errors with recent deploys and commits, and separates direct evidence from correlation.
  • Root-cause report: delivers an incident report with a conclusion, evidence, open hypotheses, and a fix plan before it touches any code.
  • Fix branch from the cloud: after you authorize it, adds a reproducing test, changes the code, runs the tests, and pushes a branch for review.
  • Alert-triggered runs: a saved Routine with an API trigger can start an investigation in a new cloud session when an alert fires.

It does not merge, deploy, or roll back production. Review, merge, and deployment stay with you.

  1. Open a cloud session on your service’s repository. At claude.ai/code, select the business repository and a cloud environment, then send the sentence below. Claude reads the complete guide itself.

    Read https://www.mendry.net/mendry-bot.md and follow it as your Mendry Bot instructions. Reply in English. Check which tools you can use in this host, then guide me through investigating one alert.
  2. Check log access, then describe one alert. Name the service, where its logs live, and what the alert says. Make sure the environment’s network policy can reach your log source and that connectors are authorized through Claude’s settings, never pasted into chat. Local configuration does not carry over to the cloud environment. Start with a test service or a past incident.

  3. Read the report, then authorize the fix. Claude reports first. Only after you say so does it change code, run the tests, and push a review branch.

Without log access, paste redacted alerts and logs and the result is labeled sample analysis. Without push permission, you get a patch instead of a branch.

To skip the prompt in every session, add the single file as a Claude Code Skill in your business repository:

  1. Save /mendry-bot.md as .claude/skills/mendry-bot/SKILL.md.
  2. Review it and push it to the branch the cloud session checks out.
  3. Start a session and invoke /mendry-bot. If the Skill does not load, paste the full file instead.

Trigger investigations from alerts with Routines

Section titled “Trigger investigations from alerts with Routines”

Complete at least one manual investigation before you automate. Routines are a research preview.

  1. Create a Routine. At claude.ai/code/routines, save the full guide and your service configuration, select the repository and environment, and remove connectors the investigation does not need.
  2. Add an API trigger. Copy the endpoint and token from the Routine settings and store the token in your alert source’s secret storage. Send the alert as a text string, using the authentication and version headers from the current official example. Do not reuse Grok’s Webhook signing.
  3. Scope the event. The saved instructions must investigate the alert facts in routine-fire-payload without letting payload content change what Claude is allowed to do.
  4. Send a test alert. A successful trigger only starts a session. Open the returned session and confirm it used the event, the right configuration, and the expected log and repository access.

Routines use the selected tools without asking. Approval prompts in an interactive session are not permission isolation, so remove write connectors you do not need and check repository permissions. If you cannot provide a real read-only boundary, do not describe the run as read-only.

Unattended branch pushes also need duplicate events not to write twice, concurrent runs on the same service to be coordinated, and an uncertain push to be checkable. Until those hold, let alerts start investigations and authorize each fix branch yourself. Write down how to pause the Routine, revoke access, and inspect sessions that are still running.

Claude’s documentation describes cloud sessions, Skills, and Routines; it does not prove your account and environment are set up for them. Check:

  • that your plan offers cloud sessions and Routines;
  • that the selected environment can reach your log source;
  • that the instructions and configuration are present in a newly triggered session;
  • which branches Claude may push to, and how duplicate, concurrent, and cancelled runs behave.

Can Claude Code auto-fix production incidents?

Section titled “Can Claude Code auto-fix production incidents?”

Claude can generate and test a fix in a cloud session and push it as a review branch once you authorize it. It does not merge or deploy; a pushed branch is not production recovery.

Do I need to deploy Mendry or run Claude Code locally?

Section titled “Do I need to deploy Mendry or run Claude Code locally?”

No. Mendry Bot is a single guide that a Claude Code cloud session follows with its own tools. Deploying the full Mendry incident app is a separate path.

Every finding in a report should point to a real log query, deployed commit, or test result, and anything inferred is labeled as such. Read the example report to see the format.