reflexion-analyze

reflexion-analyze is a command for Claude Code from axiomantic/spellbook. It costs 22 tokens per session (1,051 once invoked), scanned A, original, MIT.

A feedback-analysis step for an iteration process: it reads every feedback item, identifies underlying causes, saves lessons for later sessions, and creates guidance for the next attempt.

In plain words
What is it for?
Use it after a feature receives an ITERATE decision to analyze feedback, classify root causes, and prepare retry guidance.
Why use it?
It helps turn review feedback into persistent lessons instead of fixing only visible symptoms or forgetting what was learned.

Command for Claude Code

Written for Claude Code: a Claude Code command (commands/*.md).

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/axiomantic/spellbook/reflexion-analyze
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 reflexion-analyze

README.md
[![agentmods](https://agentmods.dev/badge/commands/axiomantic/spellbook/reflexion-analyze.svg)](https://agentmods.dev/commands/axiomantic/spellbook/reflexion-analyze)
Your own site
<a href="https://agentmods.dev/commands/axiomantic/spellbook/reflexion-analyze"><img src="https://agentmods.dev/badge/commands/axiomantic/spellbook/reflexion-analyze.svg" alt="Measured on agentmods" height="20"></a>
Per session 22 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,051 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.1 $0.00022 $0.01051
Opus 5 $0.00011 $0.00526
Sonnet 5 $0.00004 $0.00210
Haiku 4.5 $0.00002 $0.00105

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

Security

Grade A, and why

reflexion-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 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.

commands/reflexion-analyze.md · 124 lines

How it starts

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

Reflexion Analysis Pipeline

Invariant Principles

  1. Every feedback item is processed - Do not skip items regardless of severity; minor patterns compound into systemic failures
  2. Root causes, not symptoms - Categorize by underlying cause (knowledge gap, fabrication, process skip); surface-level fixes lead to repeated failures
  3. Reflections persist across sessions - Stored lessons must be retrievable by future attempts; a lesson learned but not stored is a lesson wasted

Inputs

Input Required Description
feature_name Yes Feature that received ITERATE verdict
feedback Yes List of feedback items from roundtable
stage Yes Stage where iteration occurred
iteration_number Yes Current iteration count

Step 1: Parse Feedback

Each feedback item has: source (archetype), stage, return_to, critique, evidence, suggestion, severity, iteration.

Parse every item. Extract all structured fields.

Step 2: Categorize Root Cause

Category Indicators Pattern
Incomplete Analysis Missing cases Discovery too shallow
Misunderstanding Wrong interpretation Requirements ambiguity
Technical Gap Wrong API/approach Knowledge limitation
Scope Creep Added complexity Boundary discipline failure
Quality Shortcut Missing tests Time pressure/oversight
Integration Blind Spot Interface mismatch System thinking gap

Fractal exploration (optional): When the same root cause category appears in 2+ feedback items, invoke fractal-thinking with intensity explore and seed: "Why does [failure pattern] keep recurring despite [previous corrections]?". Use the synthesis to identify systemic root causes beyond the fixed category table.

Read the full file on GitHub · 124 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 · 124 lines · 22 tokens per session scan A fc8547110d5b

Subscribe to this mod's changes

reflexion-analyze is a command published in the GitHub repository axiomantic/spellbook (10 stars, last pushed 2d ago), licensed MIT. It adds 22 tokens to every session and 1,051 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-09-03.