explain

explain is a command for Claude Code from josix/agent-flow. It costs 44 tokens per session (2,614 once invoked), scanned A, original, MIT.

A command that creates a single interactive HTML explainer about a codebase topic. It coordinates exploration, lesson planning, authoring, and assembly into an index.html file.

In plain words
What is it for?
Use it to explain how a system or feature works, run a full explainer workflow, or revise an existing explainer module.
Why use it?
It provides a repeatable path from a technical question to a browser-openable teaching page, using existing deep-dive context when available.

Command for Claude Code

Written for Claude Code: argument-hint in frontmatter.

Runs only inside its plugin — its command needs a path that Claude Code sets for a plugin’s own hooks and for nothing else. Install the plugin, not this.

Part of the agent-flow plugin — 11 skills, 5 commands, 6 agents, 7 hooks shipped together

Good fit Use it to explain how a system or feature works, run a full explainer workflow, or revise an existing explainer module.

Compare 6 commands from other repositories ↓
Install

Getting it into your agent

This one installs as part of its plugin. Adding the marketplace and installing the plugin brings it with everything else the plugin ships.

Claude Code
/plugin marketplace add josix/agent-flow
Claude Code
/plugin install agent-flow

Made for: Claude Code.

Or install agent-flow, the plugin that ships this one along with the rest of its 11 skills, 5 commands, 6 agents, 7 hooks.

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 explain

README.md
[![agentmods](https://agentmods.dev/badge/commands/josix/agent-flow/explain/github.svg)](https://agentmods.dev/commands/josix/agent-flow/explain)
Your own site
<a href="https://agentmods.dev/commands/josix/agent-flow/explain"><img src="https://agentmods.dev/badge/commands/josix/agent-flow/explain/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 explain

Your own site · 80×15
<a href="https://agentmods.dev/commands/josix/agent-flow/explain"><img src="https://agentmods.dev/badge/commands/josix/agent-flow/explain.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 44 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,614 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.00044 $0.02614
Opus 5.5 $0.00018 $0.01046
Sonnet 5.5 $0.00009 $0.00523
Haiku 4.5 $0.00004 $0.00261

Measured 18d ago against content hash 39616e42decb, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, 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 18d 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 · 238 lines

How it starts

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

Explain Command

Generate an interactive HTML explainer for a codebase topic. Riko gathers the relevant code scope, Senku designs a 3–5 screen teaching arc, Speedwagon authors the module brief and HTML fragment, and the assembler concatenates everything into explain-out/index.html — a file you can open directly in a browser.

Uses .claude/deep-dive.local.md when present (richer context); without it, Riko orients from the README and entry points. The graphify knowledge graph (graphify-out/graph.json) is used if present; absent it degrades gracefully.

Argument Parsing

$ARGUMENTS is the raw argument string passed to this command.

  • If $ARGUMENTS is empty → print usage error and stop:
    Usage: /agent-flow:explain <topic>
    Example: /agent-flow:explain how does orchestration work
    Tip: run /deep-dive first for richer context.
    
  • If $ARGUMENTS starts with --revise → revise mode: extract the slug from the argument (e.g. --revise orchestration-pipeline) and skip Phase 1–2 if the brief exists.
  • Otherwise → normal mode: $ARGUMENTS is the full topic string.

Slug derivation (compute once, use throughout all phases):

slug=$(echo "$ARGUMENTS" | tr '[:upper:]' '[:lower:]' | tr ' ' '-' | LC_ALL=C tr -cd 'a-z0-9-' | sed 's/--*/-/g; s/^-//; s/-$//' | cut -c1-40)
if ! echo "$slug" | grep -q '[a-z0-9]'; then
  # Topic has no ASCII a-z0-9 chars (e.g. CJK topics) — fall back to a deterministic hash slug.
  slug="topic-$(printf '%s' "$ARGUMENTS" | cksum | cut -d' ' -f1)"
fi

Reader language: READER_LANG is the BCP-47 tag of the language the topic ($ARGUMENTS) is written in (for example en or zh-TW), defaulting to en. Decide it once here and pass it to Phases 2–3.

Precondition Checks

Run these checks before dispatching any agents:

if [[ ! -f ".claude/deep-dive.local.md" ]]; then
  echo "Note: .claude/deep-dive.local.md not found. Continuing without it. For richer context run /deep-dive first."
fi

if [[ ! -f "graphify-out/graph.json" ]]; then
  echo "Note: graphify-out/graph.json not found. Continuing in degraded mode (no graph context)."
fi

Read the full file on GitHub · 238 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. 18d ago Changed · +39 lines scan B → A 39616e42decb
  2. 1mo ago First seen · 199 lines · 44 tokens per session scan B c49edb9f0b48

Subscribe to this mod's changes

explain is a command published in the GitHub repository josix/agent-flow (7 stars, last pushed 17d ago), licensed MIT. It adds 44 tokens to every session and 2,614 once invoked, about $0.0002 per session on Opus 5.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.