Incident postmortem draft
When an incident is resolved, label the issue postmortem (or post the timeline from incident.io or PagerDuty). Claude Code reads the timeline, digs through the commits and deploys in the window to find the change that caused it, and writes a blameless postmortem with action items. A reviewer checks it for blame and gaps, you approve, and it lands as a PR in your repo.
- Investigate Claude Code · Opus
- Write postmortem Claude Code · Sonnet
- Blameless review Claude API · Opus 5
- Approve postmortem You
- Open pull request Shell
What each step does
Investigate
Claude Code · OpusReads the timeline, finds the commits behind the incident and explains the failure. Changes nothing.
Write postmortem
Claude Code · SonnetWrites the blameless postmortem into the repository and commits it.
Blameless review
Claude API · Opus 5Checks the draft for blame, gaps and vague action items, and sends it back until it passes.
Approve postmortem
YouShows you the postmortem. Reject with a comment and it is rewritten.
Open pull request
ShellPushes the branch and opens a pull request.
From copy to first run
- Copy the pipeline JSON with the button above.
- In Jimothy, open Pipelines → New pipeline, paste it under “Or import a pipeline JSON” and click Import.
- Under Workspace, set Local repository to your clone of the service’s repository.
- Fill in the variables below under Pipeline settings → Variables.
- Triggers → Add trigger → Linear, Jira or GitHub, filtered to a postmortem label. Or a Webhook trigger your incident tool calls on resolve, with the timeline as the description.
What to fill in
The prompts and commands read these as {{vars.<name>}}. The examples are placeholders: replace them with your own.
| Variable | What to put in it | Example |
|---|---|---|
postmortemDir | Folder in the repository where postmortems live. | docs/postmortems |
Show the pipeline JSON
{
"jimothyPipeline": 1,
"name": "Incident postmortem draft",
"description": "Traces an incident to the commits behind it, writes a blameless postmortem, and opens it as a pull request.",
"icon": "bug",
"color": "#f97316",
"repo": {
"mode": "worktree",
"localPath": "",
"baseBranch": "main",
"branchTemplate": "postmortem/{{issue.key | slug}}"
},
"concurrency": 2,
"variables": {
"postmortemDir": "docs/postmortems"
},
"steps": [
{
"id": "investigate",
"name": "Investigate",
"type": "agent",
"description": "Reads the timeline, finds the commits behind the incident and explains the failure. Changes nothing.",
"harnessId": "claude-code",
"model": "opus",
"timeoutMinutes": 30,
"prompt": "Incident {{issue.key}}: {{issue.title}}\n{{#if issue.url}}Link: {{issue.url}}{{/if}}\n\nTimeline and notes:\n{{issue.description}}\n\nInvestigate the repository in the current directory. Do not modify any files.\n1. Use git log (with dates) to list the commits and merges in the 48 hours before the incident started.\n2. Identify the change or changes most likely to have caused it, and read the code involved.\n3. Explain the failure mechanism: what the code did, under what conditions, and why tests and review didn't catch it.\n\nReport your findings in Markdown with commit SHAs and file paths. Separate what you confirmed from what you suspect."
},
{
"id": "draft",
"name": "Write postmortem",
"type": "agent",
"description": "Writes the blameless postmortem into the repository and commits it.",
"harnessId": "claude-code",
"model": "sonnet",
"dependsOn": [
"investigate"
],
"timeoutMinutes": 20,
"prompt": "Write a blameless postmortem for incident {{issue.key}}: {{issue.title}}\n\nTimeline and notes:\n{{issue.description}}\n\nInvestigation:\n{{steps.investigate.output}}\n\nCreate {{vars.postmortemDir}}/<YYYY-MM-DD>-{{issue.key | slug}}.md (today's date; create the folder if needed) with these sections: Summary, Impact (who, how many, how long), Timeline (times with time zone), Root cause, Contributing factors, What went well, What went poorly, Action items (a table: action, type prevent/detect/mitigate, priority, owner \"TBD\"). Describe systems and decisions, never individuals' mistakes. Commit it with the message \"Postmortem: {{issue.key}} {{issue.title}}\". Then answer with the file's contents.{{#if steps.review.output}}\n\nA reviewer checked your previous draft. Fix every point in the same file and amend the commit:\n{{steps.review.output}}{{/if}}{{#if steps.approve.output}}\n\nYour previous draft was rejected with this feedback. Rewrite it:\n{{steps.approve.output}}{{/if}}"
},
{
"id": "review",
"name": "Blameless review",
"type": "agent",
"description": "Checks the draft for blame, gaps and vague action items, and sends it back until it passes.",
"harnessId": "anthropic-api",
"model": "claude-opus-5",
"dependsOn": [
"draft"
],
"timeoutMinutes": 10,
"passPattern": "VERDICT:\\s*APPROVE",
"loopBackTo": "draft",
"maxLoops": 2,
"prompt": "Review this postmortem.\n\n{{steps.draft.output}}\n\nCheck that it is blameless (no sentence assigns fault to a person), the root cause explains the timeline, every contributing factor has at least one action item, action items are specific enough to be ticketed, and impact is quantified. List each problem with the sentence it applies to. End with exactly one line: VERDICT: APPROVE or VERDICT: CHANGES_REQUESTED."
},
{
"id": "approve",
"name": "Approve postmortem",
"type": "approval",
"description": "Shows you the postmortem. Reject with a comment and it is rewritten.",
"dependsOn": [
"review"
],
"loopBackTo": "draft",
"maxLoops": 3,
"approvalMessage": "Open a pull request with this postmortem for {{issue.key}}?\n\n---\n\n{{steps.draft.output}}"
},
{
"id": "pr",
"name": "Open pull request",
"type": "shell",
"description": "Pushes the branch and opens a pull request.",
"dependsOn": [
"approve"
],
"timeoutMinutes": 5,
"command": "git push -u origin HEAD && gh pr create --base {{run.baseBranch}} --title \"Postmortem: $FACTORY_ISSUE_KEY $FACTORY_ISSUE_TITLE\" --body \"Blameless postmortem drafted by Jimothy run #$FACTORY_RUN_NUMBER. $FACTORY_ISSUE_URL\""
}
]
}More for engineering, and beyond
Flaky test hunter
Runs your test suite several times overnight. If some runs fail and others pass, an agent finds the cause, fixes it properly and opens a PR.
EngineeringRelease notes from a tag
When you push a release tag, writes release notes from the commits since the last one and publishes them to the GitHub release.
EngineeringSecurity advisory triage
Runs your dependency audit weekly, works out which advisories actually affect your code, and opens a PR fixing the ones that do.