analyze-cluster-postmortem

analyze-cluster-postmortem is a command for Claude Code from the-open-engine/zeroshot. It costs 19 tokens per session (2,281 once invoked), scanned A, original, MIT.

A command for examining failures in groups of agents and improving the instructions that led to those failures.

In plain words
What is it for?
Use it with a cluster ID, recent failures, or pasted logs to inspect agent messages, identify prompt gaps, and suggest prompt changes.
Why use it?
It helps distinguish weak prompts from infrastructure problems and turns repeated mistakes into clearer instructions.

Command 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 commands/the-open-engine/zeroshot/analyze-cluster-postmortem
Clone the repo
git clone --depth 1 https://github.com/the-open-engine/zeroshot

Made for: Claude Code.

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 analyze-cluster-postmortem

README.md
[![agentmods](https://agentmods.dev/badge/commands/the-open-engine/zeroshot/analyze-cluster-postmortem.svg)](https://agentmods.dev/commands/the-open-engine/zeroshot/analyze-cluster-postmortem)
Your own site
<a href="https://agentmods.dev/commands/the-open-engine/zeroshot/analyze-cluster-postmortem"><img src="https://agentmods.dev/badge/commands/the-open-engine/zeroshot/analyze-cluster-postmortem.svg" alt="Measured on agentmods" height="20"></a>
Per session 19 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 2,281 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.00019 $0.02281
Opus 5 $0.00010 $0.01141
Sonnet 5 $0.00004 $0.00456
Haiku 4.5 $0.00002 $0.00228

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

Security

Grade A, and why

analyze-cluster-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 3d 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/commands/analyze-cluster-postmortem.md · 329 lines

How it starts

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

PURPOSE: Find prompt weaknesses and FIX THEM so agents work out of the box for EVERY use case.

This is NOT about debugging infrastructure. This is about making prompts BULLETPROOF.

The Goal

Every cluster failure is a prompt improvement opportunity. Analyze what went wrong → Fix the prompt → Never see this failure pattern again.

Input

$ARGUMENTS can be:

  • Cluster ID: Analyze specific cluster
  • "recent": Find most recent clusters
  • "dump": User will paste logs directly

Step 1: Get the Data

# List recent clusters
zeroshot list --json | jq '.[-5:]'

# Get cluster status and logs
zeroshot status $CLUSTER_ID --json
zeroshot logs $CLUSTER_ID 2>&1

# Query ledger for agent messages
sqlite3 ~/.zeroshot/clusters/$CLUSTER_ID/ledger.db "
  SELECT timestamp, topic, sender, content_text
  FROM messages
  ORDER BY timestamp ASC;
"

Step 2: Identify What Agent Did Wrong

READ THE LOGS. What SPECIFICALLY went wrong?

Failure Pattern Evidence Prompt Gap
Wrong files edited Agent edited unrelated files Prompt doesn't scope file targets
Missed requirements Output missing key functionality Prompt doesn't emphasize requirements
Broke existing code Tests failed after changes Prompt doesn't enforce verification
Infinite loop Worker/validator cycle >5 iterations Validation criteria too strict or vague
Wrong approach Used deprecated API, bad pattern Prompt missing technical constraints
Incomplete work Partial implementation Prompt doesn't define "done" clearly
Hallucinated APIs Called non-existent functions Prompt doesn't ground in actual codebase
Ignored context Didn't read provided files Context injection not working
Over-engineering Added unnecessary complexity Prompt doesn't enforce simplicity
Under-testing No tests written Prompt doesn't require tests

Read the full file on GitHub · 329 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. 3d ago First seen · 329 lines · 19 tokens per session scan A 317c3e44525f

Subscribe to this mod's changes

analyze-cluster-postmortem is a command published in the GitHub repository the-open-engine/zeroshot (1,815 stars, last pushed 3d ago), licensed MIT. It adds 19 tokens to every session and 2,281 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.