Skip to content

Coding agents

AI coding agents repeat old mistakes because they never saw the incident. Aftershock gives them that memory two ways: an MCP server they can ask while they work, and a lessons section in AGENTS.md they read at the start of every task.

MCP server

Turn on MCP server for coding agents in Settings → Labs, then create a read only API token in Settings → API tokens. The server is at https://aftershock-mk.vercel.app/api/mcp (Streamable HTTP, stateless).

ToolWhat it does
check_changePass the files you changed; returns the past incidents whose proven tests cover them, the correct behaviour to keep, and the test that will run on the pull request
list_lessonsLessons from production as markdown, optionally for one path
get_incidentOne incident: what happened, the fix, its test, health and Epicenter
list_incidentsIncidents and their status
askAsk a question about past incidents; answers come only from recorded incidents and cite them
run_checkRe-run a pull request's check (only offered to tokens with write access)

Claude Code

claude mcp add --transport http aftershock https://aftershock-mk.vercel.app/api/mcp --header "Authorization: Bearer as_live_..."

Cursor (.cursor/mcp.json)

{ "mcpServers": { "aftershock": { "url": "https://aftershock-mk.vercel.app/api/mcp", "headers": { "Authorization": "Bearer as_live_..." } } } }

VS Code / GitHub Copilot (.vscode/mcp.json)

{ "servers": { "aftershock": { "type": "http", "url": "https://aftershock-mk.vercel.app/api/mcp", "headers": { "Authorization": "Bearer ${input:aftershock-token}" } } }, "inputs": [{ "id": "aftershock-token", "type": "promptString", "password": true, "description": "Aftershock API token" }] }

A line like this in your agent instructions makes it a habit: Before committing, call the aftershock check_change tool with the files you changed and keep the behaviour it reports.

AGENTS.md

AGENTS.md is read by Codex, Cursor, Copilot, Claude Code and most other agents before they start. On the Memory page, Sync to AGENTS.md opens one pull request from the aftershock/lessons branch that writes your lessons into a marked section:

<!-- aftershock:lessons:start — generated by Aftershock, edits inside are replaced on the next sync -->
## Lessons from production (Aftershock)
### INC-3 · app/cart.py
Cart totals overflow on large orders.
Expected: totals use Decimal and never lose cents
Test: tests/aftershock/test_inc_3.py
<!-- aftershock:lessons:end -->

Everything outside the markers is yours and is never changed. Syncing again replaces only the section, and nothing is opened when it's already up to date. Nothing is pushed to your default branch; you merge the pull request. LESSONS.md (export on the Memory page or GET /api/v1/lessons) has the same content as a standalone file.

Safety

  • Tokens are scoped to one workspace. Read-only tokens can't start anything.
  • Requests are rate limited (120 per minute per token) and capped at 64 KB.
  • Incident text comes from people and alerts. Agents should treat it as information, not instructions.
Edit this page on GitHub