b-animate

b-animate is a command for Claude Code from punt-labs/z-spec. It costs 10 tokens per session (1,056 once invoked), scanned A, a copy of b-animate-dev, MIT.

A command for running ProB, a tool that steps through and checks B machines—formal mathematical models of software systems. It parses a selected machine, initializes it, animates operations, and performs model checking.

In plain words
What is it for?
Use it with a B machine file, or let it find one in `specs/`; choose the number of animation steps, set size, or detailed output.
Why use it?
It helps find invalid states and behavior that violates the model before implementation or release. It also provides a way to inspect how the machine behaves step by step.

Command for Claude Code

Written for Claude Code: allowed-tools in frontmatter.

Part of the z-spec-dev plugin — 42 commands, 1 hook shipped together

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/punt-labs/z-spec/b-animate
Clone the repo
git clone --depth 1 https://github.com/punt-labs/z-spec

Made for: Claude Code.

Or install z-spec-dev, the plugin that ships this one along with the rest of its 42 commands, 1 hook.

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 b-animate

README.md
[![agentmods](https://agentmods.dev/badge/commands/punt-labs/z-spec/b-animate.svg)](https://agentmods.dev/commands/punt-labs/z-spec/b-animate)
Your own site
<a href="https://agentmods.dev/commands/punt-labs/z-spec/b-animate"><img src="https://agentmods.dev/badge/commands/punt-labs/z-spec/b-animate.svg" alt="Measured on agentmods" height="20"></a>
Per session 10 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,056 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin 95% copy Near-identical to another mod 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.1 $0.00010 $0.01056
Opus 5 $0.00005 $0.00528
Sonnet 5 $0.00002 $0.00211
Haiku 4.5 $0.00001 $0.00106

Measured 6d ago against content hash 112756170b3c, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-06, from the pricing page.

Security

Grade A, and why

b-animate 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 6d 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.

Origin

This is a copy

95% identical to b-animate-dev — 2 lines differ, which has more behind it and is treated as the original. This page carries a canonical link to it rather than competing with it.

plugin/commands/b-animate.md · 184 lines

How it starts

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

Animate B Machine with probcli

Animate and model-check a B machine using probcli (ProB command line interface).

Input

Arguments: $ARGUMENTS

Parse arguments:

  • First positional argument: file path (or search in specs/)
  • -v or --verbose: Show full probcli output
  • -a N or --animate N: Animation steps (default: 20)
  • -s N or --setsize N: Default set size for model checking (default: 2)

Process

0. Check Prerequisites

Verify probcli is installed:

PROBCLI="${PROBCLI:-$HOME/Applications/ProB/probcli}"
if ! which probcli >/dev/null 2>&1 && [ ! -x "$PROBCLI" ]; then
    echo "PROBCLI_NOT_FOUND"
fi

If probcli not found: Stop and tell the user:

probcli is not installed. Run /z-spec:setup probcli first.

1. Locate the Machine

If a file path is provided, use it directly.

If no file specified:

  • Look in specs/ for .mch files
  • Present options if multiple files exist

2. Run Validation Checks

Execute these checks in sequence:

Check 1: Parse and Initialize
probcli <file>.mch -init

Verifies the machine parses and has valid initial state(s).

Look for:

  • Operation listings indicating available operations
  • Error messages indicating parse failures
  • INITIALISATION execution success
Check 2: Animation
probcli <file>.mch -animate 20

Randomly executes operations to verify they're executable.

Look for:

  • ALL OPERATIONS COVERED - all operations were executed
  • Partial coverage indicates some operations may have unsatisfiable preconditions
Check 3: Constraint-Based Assertion Check
probcli <file>.mch -cbc_assertions

Checks if any operation can violate assertions defined in the ASSERTIONS clause.

Look for:

  • No counter-example to ASSERTION exists - pass
  • No ASSERTION to check - no assertions defined
  • Counter-example found - potential assertion violation
Check 4: Constraint-Based Deadlock Check
probcli <file>.mch -cbc_deadlock

Read the full file on GitHub · 184 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. 6d ago First seen · 184 lines · 10 tokens per session scan A 112756170b3c

Subscribe to this mod's changes

b-animate is a command published in the GitHub repository punt-labs/z-spec (5 stars, last pushed 2d ago), licensed MIT. It adds 10 tokens to every session and 1,056 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it A with 0 findings. It is 95% identical to b-animate-dev, differing in 2 lines, and is treated as a copy.