explain

A command that creates a self-contained interactive HTML walkthrough of recently completed code changes. It explains what changed, how it works, and why it matches the specification and approved plan.

In plain words
What is it for?
Use it after implementation to document changes in docs/walkthroughs/, including the diff, specification, plan, decisions, lessons, and relevant domain rules.
Why use it?
A code diff shows edits but often leaves the original intent and trade-offs unclear. The walkthrough collects that context so a person can understand the finished work from one document.

Command

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/w00fx/spec-anchored-agentic-development/explain
Clone the repo
git clone --depth 1 https://github.com/w00fx/spec-anchored-agentic-development
Per session 46 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,945 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.00046 $0.01945
Opus 5 $0.00023 $0.00972
Sonnet 5 $0.00009 $0.00389
Haiku 4.5 $0.00005 $0.00194

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

Security

Grade A, and why

explain 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/explain.md · 141 lines

How it starts

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

Generate a complete reference walkthrough of the changes in the argument — the work just completed in this session by default, or a diff/branch/PR if given. The goal is a document the human can read end to end and come away knowing exactly what was built and why, with nothing material left out.

Gather the full context first

Do not walk the diff blind. Read, and use as the backbone of the explanation:

  • The diff of all changes (the what).
  • The capability spec and the approved plan (protocol Phase 3) (the intent — what was asked and which approach was committed).
  • The decisions captured in Phases 1.5 and 2, including the tradeoffs (the why, which the code does not contain).
  • The lessons and any low-confidence decisions from Phase 6.
  • The constitution (for the domain rules the change touches).

The intent artifacts are what make this more than a code re-narration: explain the change against what it was supposed to do, not in a vacuum.

When the target is work from another session (a diff, branch, or PR), the intent artifacts aren't in this conversation: pull the plan from the PR description (both implement skills put it there) or the run log under .claude/logs/. If an intent artifact is genuinely unavailable, say which dimensions lack it — do not reconstruct intent from the code and present it as the plan.

The bar: complete in coverage, not in granularity

Cover every dimension below — leave none out. But explain at the level of why and how it connects, not line by line. If a paragraph could be replaced by reading the code, cut it; spend the words on what the code does not say (the reason, the constraint, the cross-file flow, the edge case). "Exhaustive" means no dimension missing, not every line narrated. There is no length limit — let completeness set the length. And when behavior resists prose — a scheduler, a state machine, a data flow you can only feel by stepping through it — offer a throwaway comprehension tool alongside the document (a custom debugger, a step-through UI, a time-scrubber): agents can write code that helps humans understand code; keep the understanding, delete the tool. And for behaviors with state or permissions, cover the behavior-unit checklist: trigger → rule → state change → execution path (including failure) → edge cases, each step with its evidence link — prose explains; facts anchor.

Read the full file on GitHub · 141 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 · 141 lines · 46 tokens per session scan A 2be29632b4ef

Subscribe to this mod's changes

explain is a command published in the GitHub repository w00fx/spec-anchored-agentic-development (5 stars, last pushed 7d ago), licensed MIT. It adds 46 tokens to every session and 1,945 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.