audit-mirage-analyze

audit-mirage-analyze is a command for Claude Code from axiomantic/spellbook. It costs 41 tokens per session (5,858 once invoked), scanned A, original, MIT.

A command for checking software tests line by line, looking for assertions that appear to test something but do not actually prove it.

In plain words
What is it for?
Use it to review every test function, examine its setup and actions, classify misleading test patterns, and verify changes to test assertions.
Why use it?
It helps find tests that create false confidence and may let production defects go unnoticed. It also checks whether a proposed test fix really improves the test.

Command for Claude Code

Written for Claude Code: a Claude Code command (commands/*.md). Also seen: mentions subagents.

Good fit Use it to review every test function, examine its setup and actions, classify misleading test patterns, and verify changes to test assertions.

Compare 6 commands from other repositories ↓
Install with agentmods
npx agentmods add commands/axiomantic/spellbook/audit-mirage-analyze
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.

Clone the repo
git clone --depth 1 https://github.com/axiomantic/spellbook

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 audit-mirage-analyze

README.md
[![agentmods](https://agentmods.dev/badge/commands/axiomantic/spellbook/audit-mirage-analyze/github.svg)](https://agentmods.dev/commands/axiomantic/spellbook/audit-mirage-analyze)
Your own site
<a href="https://agentmods.dev/commands/axiomantic/spellbook/audit-mirage-analyze"><img src="https://agentmods.dev/badge/commands/axiomantic/spellbook/audit-mirage-analyze/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for audit-mirage-analyze

Your own site · 80×15
<a href="https://agentmods.dev/commands/axiomantic/spellbook/audit-mirage-analyze"><img src="https://agentmods.dev/badge/commands/axiomantic/spellbook/audit-mirage-analyze.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 41 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 5,858 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
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.1 $0.00041 $0.05858
Opus 5 $0.00020 $0.02929
Sonnet 5 $0.00008 $0.01172
Haiku 4.5 $0.00004 $0.00586

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

Security

Grade A, and why

audit-mirage-analyze 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 10d 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.

commands/audit-mirage-analyze.md · 542 lines

How it starts

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

Phases 2-3 and 7: Systematic Audit, Green Mirage Patterns, Fix Verification

Invariant Principles

  1. Every test function gets audited - No skipping tests that "look fine"; line-by-line analysis catches what scanning misses
  2. Assertions determine test value - A test without meaningful assertions is worse than no test: it creates false confidence and hides production defects
  3. Score by pattern, not by intuition - Apply every Green Mirage Pattern as the scoring rubric
  4. A fix is a new suspect - A remediated assertion gets the same adversarial treatment as the assertion it replaced

Phase 2: Systematic Line-by-Line Audit

For EACH test file, work through EVERY test function. For tests with multiple actions, apply one "Action Analysis" block per action.

### Test: `test_function_name` (file.py:line)

**Purpose (from name/docstring):** What this test claims to verify

**Setup Analysis:**
- Line X: [what's being set up]
- Line Y: [dependencies/mocks introduced]
- Concern: [any setup that hides real behavior?]

**Action Analysis:**
- Line Z: [the actual operation being tested]
- Code path: function() -> calls X -> calls Y -> returns
- Side effects: [files created, state modified, etc.]

**Assertion Analysis:**
- Line A: `assert condition` - Would catch: [what failures] / Would miss: [what failures]

**Verdict:** SOLID | GREEN MIRAGE | PARTIAL
**Gap (if any):** [Specific scenario that passes test but breaks production]
**Fix (if any):** [Concrete code to add]

Code Path Tracing

Trace the COMPLETE path for each test action:

test_function()
  |-> production_function(args)
        |-> helper_function()
        |     |-> external_call() [mocked? real?]
        |     |-> returns value
        |-> processes result
        |-> returns final
  |-> assertion checks final

Read the full file on GitHub · 542 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. 10d ago First seen · 542 lines · 41 tokens per session scan A c1f69fc7c5c1

Subscribe to this mod's changes

audit-mirage-analyze is a command published in the GitHub repository axiomantic/spellbook (10 stars, last pushed today), licensed MIT. It adds 41 tokens to every session and 5,858 once invoked, about $0.0002 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-31.