postmortem

postmortem is a command for coding agents from ilyasibrahim/claude-agents-coordination. It costs 16 tokens per session (1,200 once invoked), scanned A, original, Unlicense.

A command for writing a blameless incident postmortem, a record of what went wrong, why, and how to prevent it happening again.

In plain words
What is it for?
Use it to create postmortems from an incident description or logs, generate a template, and track urgent technical action items.
Why use it?
It organizes incident evidence into a timeline, root causes, impact, and follow-up work without assigning personal blame.

Command

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add commands/ilyasibrahim/claude-agents-coordination/postmortem
Clone the repo
git clone --depth 1 https://github.com/ilyasibrahim/claude-agents-coordination

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for postmortem

README.md
[![agentmods](https://agentmods.dev/badge/commands/ilyasibrahim/claude-agents-coordination/postmortem.svg)](https://agentmods.dev/commands/ilyasibrahim/claude-agents-coordination/postmortem)
Your own site
<a href="https://agentmods.dev/commands/ilyasibrahim/claude-agents-coordination/postmortem"><img src="https://agentmods.dev/badge/commands/ilyasibrahim/claude-agents-coordination/postmortem.svg" alt="Measured on agentmods" height="20"></a>
Per session 16 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 1,200 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00016 $0.01200
Opus 5 $0.00008 $0.00600
Sonnet 5 $0.00003 $0.00240
Haiku 4.5 $0.00002 $0.00120

Measured 4d ago against content hash a5ac8c28269e, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

postmortem scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 4d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

claude-user/commands/postmortem.md · 228 lines

How it starts

The opening of the file, as written. The whole thing — 228 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Postmortem Command

Invoke sre agent in incident mode for blameless postmortem generation.

Usage

/postmortem [incident-description]
/postmortem --from-logs [log-path]
/postmortem --template               # Generate blank template

Default Mode

Task(sre, "
Mode: incident

Incident: [description from user]

Generate blameless postmortem:

1. Incident Summary
   - Severity classification (SEV1-4)
   - Duration and impact
   - Detection method

2. Timeline Reconstruction
   - First indication
   - Detection time
   - Response actions
   - Resolution steps
   - Recovery confirmation

3. Root Cause Analysis
   - Technical root cause
   - Contributing factors
   - Why detection was delayed (if applicable)

4. Impact Assessment
   - Users affected
   - Business impact
   - Data implications

5. Action Items
   - Prevent recurrence
   - Improve detection
   - Process improvements
   - Each with owner and priority

6. Lessons Learned
   - What went well
   - What went wrong
   - What we'll do differently

Output: .claude/reports/sre/postmortem-[incident-slug]-YYYYMMDD.md

After generating postmortem:
- Add P0/P1 action items to .claude/reports/_tech-debt.md as Critical/High priority
- Format: TD-NNN with link to postmortem
")

From Logs Mode

When analyzing existing logs/alerts:

/postmortem --from-logs [path-to-logs]
Task(sre, "
Mode: incident

Analyze logs at: [path]

Extract from logs:
- Error patterns
- Timeline of events
- Affected components
- Recovery indicators

Reconstruct incident narrative and generate postmortem.

Output: .claude/reports/sre/postmortem-[extracted-title]-YYYYMMDD.md
")

Template Mode

Generate blank postmortem template:

/postmortem --template

Creates:

# Postmortem: [TITLE]

## Incident Summary

| Field | Value |
|-------|-------|
| Severity | SEV1 / SEV2 / SEV3 / SEV4 |
| Duration | HH:MM to HH:MM (X hours Y minutes) |
| Impact | [Users affected, revenue impact] |
| Detection | Alert / Customer Report / Internal |
| Resolution | [How it was fixed] |

## Timeline (All times UTC)

| Time | Event |
|------|-------|
| | First signs of issue |
| | Issue detected |
| | Incident declared |
| | Root cause identified |
| | Fix implemented |
| | Service restored |
| | Incident closed |

## Root Cause

[Technical explanation of what caused the incident. Be specific about the chain of events.]

## Contributing Factors

1. [Factor that made the incident worse or more likely]
2. [Factor that delayed detection]
3. [Factor that complicated response]

## Impact

### User Impact
- [Number of users affected]
- [User-visible symptoms]
- [Duration of impact]

### Business Impact
- [Revenue impact if applicable]
- [Reputation impact]
- [SLA implications]

### Data Impact
- [Any data loss or corruption]
- [Recovery status]

## Response Analysis

### What Went Well
- [Effective monitoring/alerting]
- [Quick response time]
- [Good communication]
- [Effective mitigation]

### What Went Wrong
- [Detection gaps]
- [Response delays]
- [Communication issues]
- [Missing runbooks]

## Action Items

| Priority | Action | Owner | Due Date | Status |
|----------|--------|-------|----------|--------|
| P0 | [Prevent recurrence] | | | Open |
| P1 | [Improve detection] | | | Open |
| P1 | [Add missing test] | | | Open |
| P2 | [Update documentation] | | | Open |
| P2 | [Process improvement] | | | Open |

## Lessons Learned

### Technical
- [Technical insight gained]

### Process
- [Process improvement identified]

### Communication
- [Communication improvement]

## Related

- Previous similar incidents: [links]
- Related documentation: [links]
- Monitoring dashboards: [links]

Read the full file on GitHub · 228 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 4d ago First seen · 228 lines · 16 tokens per session scan A a5ac8c28269e

Subscribe to this mod's changes

postmortem is a command published in the GitHub repository ilyasibrahim/claude-agents-coordination (83 stars, last pushed 3mo ago), licensed Unlicense. It adds 16 tokens to every session and 1,200 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.