explain-workflow

A command that maps what happens when a Claude Code command, skill, or agent workflow runs. It produces a step-by-step text diagram from the user's input to the final result.

In plain words
What is it for?
Use it to understand, document, or troubleshoot an existing command, skill, agent, hook, or workflow description.
Why use it?
It makes hidden or complicated execution paths easier to inspect. This helps reveal which files, tools, components, and handoffs are involved.

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/bengous/claude-code-plugins/explain-workflow
Clone the repo
git clone --depth 1 https://github.com/bengous/claude-code-plugins
Per session 17 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,720 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.00017 $0.01720
Opus 5 $0.00009 $0.00860
Sonnet 5 $0.00003 $0.00344
Haiku 4.5 $0.00002 $0.00172

Measured yesterday against content hash 4bfe4897f125, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

explain-workflow 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 yesterday.

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.

claude-meta-tools/commands/explain-workflow.md · 176 lines

How it starts

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

Workflow Trace

Target: $ARGUMENTS

Your Task

Trace the complete execution flow of the target and produce ASCII workflow diagrams showing every step from user input to final output.

This is NOT a concept explanation. Do NOT explain what the target "is" or "why it exists." Instead, trace what HAPPENS -- step by step -- when it executes.

Step 1: Resolve the Target

Determine what kind of target was provided:

Plugin component (command, skill, agent, hook):

  • Search for matching .md files in commands/, skills/, agents/, hooks/ directories across all plugins
  • Use Glob: **/commands/$ARGUMENTS.md, **/commands/$ARGUMENTS/*.md, **/skills/$ARGUMENTS/SKILL.md, **/agents/$ARGUMENTS.md
  • If target contains :, split on : as plugin:component (e.g., orchestration:orc -> orchestration/commands/orc.md)

File path:

  • If target contains / or ends in .md, .sh, .py, .ts, .js, treat as a direct file path and Read it
  • The file may be a command, skill, agent definition, OR a plan/design document that describes a Claude Code agent workflow
  • In all cases, extract the Claude Code components (commands, skills, agents, tools, hooks) described or referenced in the file

Workflow description:

  • If neither above matches, Grep the codebase for relevant keywords
  • Identify the primary entry point(s) that match the description

Step 2: Trace the Execution Path

Starting from the resolved file(s), systematically trace the Claude Code agent workflow.

If the target is a plan or design document that describes an agent workflow (rather than being an executable command/skill itself): extract the Claude Code components it references -- commands invoked, agents spawned, skills used, tools called, hooks involved -- then trace each component by reading its source file. The plan describes the intended flow; the component files contain the actual implementation to trace.

For each file in the workflow, identify:

  1. Entry point: What triggers this? (slash command, agent spawn, hook event, function call)
  2. Argument handling: How are inputs parsed or interpreted?
  3. Sequential steps: Walk through the instructions/code in order
  4. Tool calls: What tools does it invoke? (Read, Glob, Grep, Bash, Agent, Write, Edit, AskUserQuestion, Skill, etc.)
  5. Decision branches: Where does flow split? What conditions determine the path?
  6. Delegations: Does it spawn sub-agents (Agent tool)? If so:
    • Read the agent definition file
    • Trace the agent's own execution path
    • Note what the agent returns
  7. Script executions: Does it call external scripts? If so:
    • Read the script file
    • Trace the script's logic
  8. Skill invocations: Does it invoke skills (Skill tool)? If so:
    • Read the SKILL.md
    • Summarize the skill's workflow steps
  9. Hook triggers: Are there hooks that fire during this workflow?
    • Search for hook definitions that match relevant events
  10. Data flow: What data is passed between steps? (files written, variables, piped output)
  11. User interaction points: Where does it stop and ask the user? (AskUserQuestion, approval gates)
  12. Terminal state: What does the user see when it finishes?

Read the full file on GitHub · 176 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. yesterday First seen · 176 lines · 17 tokens per session scan A 4bfe4897f125

Subscribe to this mod's changes

explain-workflow is a command published in the GitHub repository bengous/claude-code-plugins (4 stars, last pushed 2d ago), licensed MIT. It adds 17 tokens to every session and 1,720 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-08-31.