AI help with alarms
An alarm is what KeepSnappy raises when a place gets Worse or Slightly worse on your pull request. This page is for anyone who wants an AI to look at one. Pick the route that fits where you work. Every route uses your own Claude or Codex, on your own account or AI key, and all of them are optional.
| Route | Where it runs | What you get |
|---|---|---|
| Review in CI | keepsnappy review, in your KeepSnappy job | An AI answer next to each alarm it thinks is a false alarm. |
| Investigation in CI | keepsnappy act, in your KeepSnappy job | The same review, then the likely cause of the alarms your policy (the on_alarm settings) selects, as comments on the pull request. It can also propose a fix. |
| On your Mac | keepsnappy investigate, in your checkout | The likely cause of one alarm, shown on the dashboard. |
| In your coding agent | the KeepSnappy MCP server | Claude Code or another coding agent reads your results while you work. |
In every route, your AI provider receives the code it reads. KeepSnappy receives the AI’s answers as text (what leaves your CI).
On your Mac
investigate runs your own claude or codex on one alarm. It checks out the measured commit in a separate worktree of your app repo and runs the agent there, read-only. What it finds shows on the alarm in the dashboard.
You need:
- your app repo on your Mac, with its dependencies installed, so that
npx --no-install keepsnappyruns; claude2.1.308 or newer, orcodex, installed and logged in once;- no symlink in the repo that points outside it, or
investigatestarts nothing; - a read key in
KEEPSNAPPY_KEY, for example the one from In your coding agent.
In your app repo, keepsnappy findings lists your branch’s alarms. Copy the id of one: each id starts with f_. Check the setup without calling a model, then run it:
npx --no-install keepsnappy findings --branch my-featurenpx --no-install keepsnappy investigate f_… --branch my-feature --repo . --preflightnpx --no-install keepsnappy investigate f_… --branch my-feature --repo .The run ends with one line: the tokens it used and what they would cost on an API key. By default it stops after 26 turns (steps of the agent) or 15 minutes. Every flag is in the CLI reference.
In your coding agent
The KeepSnappy MCP server lets a coding agent ask what got slower on a branch, where and why. It reads results and never starts a measurement. It also stores an AI’s hypotheses about an alarm, or an answer that an alarm is a false alarm, shown next to the unchanged result. Its tools are in the MCP reference.
- On Setup in the dashboard, choose Connect a coding agent. Name it, and copy its read key. You see it once.
- Put the key in your shell, not in the repo, for example in
~/.zshenv:
export KEEPSNAPPY_KEY=<the read key>~/.zshenv sets KEEPSNAPPY_KEY for every shell. If it holds a read key, keepsnappy run --upload fails: the API refuses the key with insufficient_scope. Set the CI key with export in the one shell where you measure (Keys).
- Add
.mcp.jsonat the root of your app repo:
{ "mcpServers": { "keepsnappy": { "command": "npx", "args": ["-y", "@keepsnappy/mcp"], "env": { "KEEPSNAPPY_KEY": "${KEEPSNAPPY_KEY}" } } }}Claude Code fills in ${KEEPSNAPPY_KEY} from your shell. Then ask it, for example, whether your branch is ok. Another coding agent takes the same command, arguments and KEEPSNAPPY_KEY in its own MCP settings.
The MCP server calls no AI of its own, so the cost is your coding agent’s usual use. To stop it, choose Disconnect on the agent, on Setup.