On-call is where operational tooling gets tested for real. It's 2am, you're half asleep, something is on fire, and the tools either help or get in the way. Fancy features that seem valuable in a demo become annoying in an actual incident. Simple features that seemed unremarkable become the ones you're grateful for.
This post is what actually stuck in our on-call runbook after six months of iteration. Not the whole runbook — just the parts that involve Claude Code, and specifically the parts that survived contact with real 2am reality.
What we didn't automate
Worth stating first: some parts of on-call don't belong in AI-assisted workflows. Deciding whether an incident is customer-impacting. Deciding when to escalate. Deciding when to declare an incident resolved. These are human judgment calls, and pushing them into AI-assisted flows makes them worse, not better.
Claude Code helps with the mechanical parts of on-call — the "gather this data, run this query, format this output" work that fills the gaps between judgment calls. It's not the judgment itself. The runbook we'll walk through reflects this: Claude does the mechanical work; humans do the judgment work; the runbook makes the split explicit.
The runbook, from page to postmortem
Step 1: The page arrives
A page comes in at 2:14am. Sentry alert on the checkout service. The on-caller is now awake, on their laptop, and needs to figure out what's happening. Before Claude Code, this involved: opening Sentry, reading the alert, opening Datadog, looking at metrics, checking recent deploys, opening the codebase. Fifteen minutes of tab-switching before the actual investigation could start.
What we changed: the alert now includes a link to a pre-populated Claude Code investigation. Clicking it opens a session with the @incident-investigator subagent already invoked, given the alert ID as context. By the time the on-caller is fully awake, the initial investigation is complete and waiting.
The pre-population is a webhook on PagerDuty that creates a Claude Code session with a specific starting prompt. Not fancy — a webhook that expands a template. The value is that the on-caller doesn't have to construct the investigation command at 2am; it's already running.
Step 2: The initial context brief
By minute 5, the on-caller has an initial context brief. What the alert says. What Datadog shows. What deploys happened in the last 24 hours. Which services are downstream of the failing one. A first-pass hypothesis about what's going on.
This is the payoff: 20 minutes of context-gathering compressed to 5 minutes. The on-caller starts investigation with a fully briefed picture instead of tab-hunting for the first quarter hour of the incident.
The single biggest change on-call felt from Claude Code integration was the compression of "what's happening" from twenty minutes to five. That time doesn't sound like much until you're the one experiencing it at 2am.
Step 3: The interactive investigation
With context in hand, the on-caller drives the investigation interactively. This is the part that's always going to require judgment — is the initial hypothesis right? What does the stack trace actually say? Is this a bug or a config issue?
Claude helps with the mechanical parts of this too. "Show me the code path that's throwing the error." "What changed in this file in the last 3 days?" "Is this pattern used anywhere else in the codebase?" The on-caller doesn't have to remember file paths, grep patterns, or query syntax at 2am — they can describe what they want in natural language and Claude does the mechanical retrieval.
What doesn't work at this stage: asking Claude "what should we do?" The question requires judgment about business impact, customer visibility, and risk that Claude doesn't have context for. The on-caller decides what to do; Claude helps execute.
Step 4: The mitigation
When the on-caller decides on a mitigation, the actual execution goes through normal channels. Rollback via the deployment tool. Hotfix via a normal PR. Feature flag via the flag management system. Claude Code helps prepare the mitigation — drafts the PR, writes the query, formats the flag change — but a human executes.
This is the compliance-adjacent pattern from the previous post: humans touch production, AI helps prepare. The 2am on-caller benefits from having a well-drafted PR to click "merge" on rather than typing it from scratch, but the accountability for the merge is human.
Step 5: The status update
Every 20-30 minutes during an active incident, the on-caller posts a status update. What's known, what's not, what's being tried, what's the ETA. Writing this at 2am is annoying. Claude drafts it from the investigation session context: "the checkout service is throwing NPEs after the payments-svc deploy; rolling back payments-svc; expected resolution in 10 minutes."
The on-caller reviews and posts. Costs 30 seconds instead of 3 minutes. Cumulatively over a two-hour incident, that saves 15+ minutes of status-writing that's better spent on the actual incident.
Step 6: The postmortem draft
Once the incident is resolved, the on-caller triggers the postmortem draft workflow. The session that ran the investigation has the full context — the timeline, the hypotheses, the mitigation. Claude drafts the postmortem from that context using our postmortem template.
The draft covers the mechanical parts: timeline, technical root cause, immediate mitigation, code changes made. The human adds the parts that require judgment: customer impact assessment, communication log, action items with owners, lessons that generalize beyond this specific incident.
Postmortem quality improved noticeably after this. Not because the AI-drafted parts are better than human-written — they're about the same. Because postmortems get written more consistently and completed sooner, while the incident is still fresh. Two-day-old postmortems are worse than same-day ones no matter who writes them.
The commands, agents, and hooks involved
For teams considering this pattern, the specific pieces of our setup:
Everything above is in cctk's catalog. The webhook integration with PagerDuty is custom to our setup but conceptually simple — any incident routing system can be configured to open a Claude Code session with a specific prompt.
What we learned along the way
The pre-populated session is the killer feature
Of everything we built, the single most valuable piece is the "click the link, arrive at a running investigation" pattern. This is because on-call cognition is impaired — you're tired, stressed, and possibly half-awake. Any friction between "page arrives" and "investigation starts" gets multiplied by that cognitive load. Removing that friction pays back every incident.
Voice mode helps at unexpected moments
Not for the investigation itself — for the walk to the desk. Voice mode read out the initial context brief while the on-caller walked from bed to laptop. By the time they were sitting down, they knew what the incident was. Small thing; noticeable difference.
Not everything belongs in the runbook
Some engineers wanted more AI involvement. "Have Claude auto-open the rollback PR." "Have Claude execute the mitigation if it's in the standard playbook." We rejected all of these. The runbook stops short of AI-driven action for the same reason we stopped short of it in regulated environments: the accountability model is worth more than the small time savings.
The template matters more than the AI
The postmortem drafting works because our postmortem template is specific. Sections with named headers. Explicit prompts about what each section should contain. When we tried the same drafting workflow with a vague template ("write a good postmortem"), the output was mediocre. The AI is following the template; a better template produces better output regardless of who's filling it in.
What we'd tell another team starting this
A few things worth knowing before you build:
- Start with one integration point (probably the pre-populated investigation session). Don't try to build the whole runbook at once.
- Test the workflow during business hours before relying on it at 2am. What works at 2pm doesn't always work at 2am.
- Keep human checkpoints for anything consequential. The productivity gain from removing them is small; the cost when something goes wrong is large.
- Iterate based on real incidents, not imagined ones. Some parts of the runbook we thought would matter didn't; some parts we hadn't considered turned out to.
- Document what's AI-driven and what's human-driven explicitly. Ambiguity here creates confusion during incidents.
The best measure of whether this is working: is the on-caller's stress level lower during incidents than it was before? If yes, keep iterating. If no, something in the workflow is adding friction instead of removing it. Watch that signal more than any productivity metric.
Get cctk running in one command
85 slash commands, 12 subagents, 12 MCP integrations, 12 hooks. All the patterns from this post are shipped in cctk.