Skip to main content

CLI for the Antemortem pre-implementation reconnaissance discipline — scaffold, run, and lint antemortem documents with Claude.

Project description

antemortem-cli

License: MIT Python Version Status

CLI for the Antemortem pre-implementation reconnaissance discipline.

An antemortem is what you do before you build. You put the planned change under stress on paper, use an LLM to read the existing code thoroughly, enumerate traps, classify each as REAL / GHOST / NEW with primary-source file:line citations, and revise your risk and your spec before writing a single line. This CLI automates the scaffolding, the classification pass, and the schema lint — so the discipline is a single command, not a workflow you have to remember.

The methodology lives at hibou04-ops/Antemortem. This repo is the tooling that runs it.

Install

pip install antemortem

Requires Python 3.11+ and an ANTHROPIC_API_KEY environment variable for run.

Three commands

antemortem init — scaffold a document

antemortem init my-feature
# → Created antemortem/my-feature.md (basic template)

antemortem init my-migration --enhanced
# → Created antemortem/my-migration.md (enhanced template)

Copies the official Antemortem template with YAML frontmatter (name, date, scope, reversibility, status: draft). Output path: ./antemortem/<name>.md.

antemortem run — LLM-assisted classification

antemortem run antemortem/my-feature.md --repo ../target-repo
# Reading 6 files from ../target-repo ...
# Calling claude-opus-4-7 (cached system prompt, 4.2k input / 1.1k output) ...
# Classified 7 traps: 3 GHOST, 3 REAL, 1 NEW
# Citations written with file:line references.
# Updated: antemortem/my-feature.md
# Artifact: antemortem/my-feature.json

Reads the doc, extracts spec + traps + files_to_read, loads files from --repo, calls Claude Opus 4.7 with prompt caching on the frozen system prompt (~90% cost reduction on repeated runs), writes classifications back with file:line citations. Also emits a JSON artifact for lint and downstream tooling.

antemortem lint — validate the schema and citations

antemortem lint antemortem/my-feature.md
# PASS — 7/7 traps classified, 7/7 citations present, 7/7 citations verify file:line.

antemortem lint antemortem/broken.md
# FAIL:
#   - trap#3: classification missing
#   - trap#5: citation format invalid ("see walk_forward.py" → expected "path:line")
#   - trap#6: cited file antemortem/ghost.py does not exist in --repo
# exit 1

Validates structured schema (all sections present, classifications complete) and verifies every file:line exists on disk. Exit 0 on pass, 1 on fail. Use in CI to block PRs with missing or fabricated citations.

Model and cost

Uses Claude Opus 4.7 via the Anthropic SDK. Typical cost per run:

Scenario Cost
First run (writes system prompt to cache) ~$0.18
Cached run (system prompt + files reused within 5 min) ~$0.11
100 iterations during development $11–18

Cache miss indicators are surfaced in the CLI output so silent invalidators (e.g. non-deterministic prompt state) fail loud, not silent.

Why a CLI (and not just "ask Claude to review my plan")

The discipline is two guardrails:

  1. Enumerate traps before the LLM sees them. Prevents anchoring on the model's framing. The CLI surfaces this as a required section in the scaffolded document.
  2. Require file:line citations. Prevents accepting the model's vibes. The CLI enforces this as a Pydantic schema field, and lint verifies the citations exist on disk (no hallucinated line numbers).

Without these guardrails, you have traded one form of hand-waving for another.

Project status

v0.2.0 is the initial release. Alpha — API and output formats may change in v0.2.x as prompts iterate on real repos. Semver applies after v1.0.

Full changelog: CHANGELOG.md.

Relation to other projects

  • Antemortem — the methodology, templates, and case studies. This CLI implements the docs/methodology.md protocol.
  • omega-lock — first shipped case study of the discipline (audit submodule built with a 15-minute antemortem recon). Cited in Antemortem v0.1's case studies.

License

MIT. See LICENSE.

Citing

Antemortem CLI v0.2 — tooling for the Antemortem pre-implementation reconnaissance discipline.
https://github.com/hibou04-ops/antemortem-cli, 2026.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

antemortem-0.2.0.tar.gz (25.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

antemortem-0.2.0-py3-none-any.whl (30.4 kB view details)

Uploaded Python 3

File details

Details for the file antemortem-0.2.0.tar.gz.

File metadata

  • Download URL: antemortem-0.2.0.tar.gz
  • Upload date:
  • Size: 25.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.2 {"installer":{"name":"uv","version":"0.11.2","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":null,"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for antemortem-0.2.0.tar.gz
Algorithm Hash digest
SHA256 abf217b6a628f90dd796f1619c79c4921ae0700f85411cce5cec391e123fd4e2
MD5 8404ebbc7e13c9046a783708a95ef6b5
BLAKE2b-256 16d133c3f1dd3754cc37494167da3a07cf24d28f61d1dc78eec2ef48516adf0f

See more details on using hashes here.

File details

Details for the file antemortem-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: antemortem-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 30.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.2 {"installer":{"name":"uv","version":"0.11.2","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":null,"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for antemortem-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 996e8bb3fd17fc5769225c95f203dfdf552228a2cbd152552272bc37e99805eb
MD5 8e777655190ae36a720082f3845efcfb
BLAKE2b-256 4c553b35351036a46cf9626c70df2fd2c5f04e600484707c063741a22d3db0b9

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page