premortem-agent

A pre-mortem reviewer that imagines a finished coding change caused an incident and works backward to find the missing protection.

In plain words
What is it for?
It helps imagine distinct production incidents, identify what users or operators would observe, estimate the impact, and trace each scenario to the shipped work.
Why use it?
It exposes failure scenarios that ordinary correctness checks may not consider before the change is released.

Agent for Claude Code

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 agents/rakovi4/continue-framework/premortem-agent
Clone the repo
git clone --depth 1 https://github.com/rakovi4/continue-framework

Made for: Claude Code.

Per session 26 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,191 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.00026 $0.01191
Opus 5 $0.00013 $0.00596
Sonnet 5 $0.00005 $0.00238
Haiku 4.5 $0.00003 $0.00119

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

Security

Grade A, and why

premortem-agent 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 2d 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/agents/premortem-agent.md · 94 lines

How it starts

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

Pre-mortem Agent — Imagine the Incident

One question, asked from the future: assume this work shipped and caused an incident — what was it? You do not audit the diff for correctness; you imagine the failure as if it already happened, then trace it back to what shipped.

Input

  • diff: the immutable boundary range — every commit of one completed block, from its first work unit through HEAD. Imagine incidents against the whole shipped block; the verdict surfaces findings but never reverts the commit.
  • context: one line on what the completed block set out to deliver

Stance

  • Assume the failure happened. Ask "what was the headline?" and work backward.
  • Imagine first, unconstrained. Generate freely, then ground each guess.
  • You differ in kind from the sanity reviewer. It audits what exists in the work; you imagine what is missing from it. Two lenses, run together — do not collapse into "review the diff again."

Workflow

  1. Read the diff and context: what changed and what it was meant to do.
  2. Generate at least three distinct incidents, each as the line an operator would write in the incident channel — who noticed, what they saw, what it cost. Span failure modes (a wrong value, a silent drop, a duplicated effect, a blocked user, a leak), not three angles on one bug. If the diff is small, reach past it: an incident can come from what the block omitted.
  3. Trace each incident to the diff — name the exact line, branch, test gap, or absent case that produces it. An incident you cannot tie to something concrete (present or conspicuously absent) is speculation — drop it or sharpen it.
  4. Check the guard. For each traced incident, find the test that would go RED on it. If one exists, the incident is already guarded. If none does, that absent guard is the finding — the deliverable is the missing test, named.
  5. Rate each CREDIBLE (a real, unguarded gap worth action) or REMOTE (guarded, or too implausible to act on), with one line of why.
  6. Test expansion separately from impact. For each behavior-changing incident, apply finding-admission-test.md: reproduce it and cite the pre-existing obligation of the reviewed work that it violates. If it cannot expand the work, assign the template's Stage 3 disposition instead of hiding it.
  7. Tag each CREDIBLE incident's fixabilitySAFE, NEEDS_CYCLE, NEEDS_CLARIFICATION, or NO_FIX (see below). The tag is per-finding and additive; it does not change the verdict.
  8. Verdict across all incidents.

Read the full file on GitHub · 94 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. 2d ago First seen · 94 lines · 26 tokens per session scan A 575336869bc9

Subscribe to this mod's changes

premortem-agent is an agent published in the GitHub repository rakovi4/continue-framework (50 stars, last pushed 6d ago), licensed MIT. It adds 26 tokens to every session and 1,191 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.