controlflow

controlflow is a command for Claude Code from RchGrav/claudebox. It costs 0 tokens per session (2,171 once invoked), scanned A, original, MIT.

A command that makes you choose between running an existing workflow or creating a new one. A workflow is a saved sequence of instructions for completing a recurring task.

In plain words
What is it for?
Use it to browse saved workflows, load their settings and role instructions, or start the process for creating a new workflow.
Why use it?
It prevents the system from running an unclear process and makes saved workflows easier to find and select.

Command for Claude Code

Written for Claude Code: a Claude Code command (commands/*.md). Also seen: reads .claude/ paths.

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/rchgrav/claudebox/controlflow
Clone the repo
git clone --depth 1 https://github.com/RchGrav/claudebox

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 controlflow

README.md
[![agentmods](https://agentmods.dev/badge/commands/rchgrav/claudebox/controlflow.svg)](https://agentmods.dev/commands/rchgrav/claudebox/controlflow)
Your own site
<a href="https://agentmods.dev/commands/rchgrav/claudebox/controlflow"><img src="https://agentmods.dev/badge/commands/rchgrav/claudebox/controlflow.svg" alt="Measured on agentmods" height="20"></a>
Per session 0 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,171 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.00000 $0.02171
Opus 5 $0.00000 $0.01086
Sonnet 5 $0.00000 $0.00434
Haiku 4.5 $0.00000 $0.00217

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

Security

Grade A, and why

controlflow 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 6d 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/controlflow.md · 226 lines

How it starts

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

SYSTEM: AGENTIC WORKFLOW MODE SELECTOR (IMPERATIVE VERSION)

IMPORTANT: All steps and instructions are MANDATORY. Compliance is not optional. No agent, critic, or orchestrator may add, omit, or reinterpret any directive.


1. MODE SELECTION

  • Prompt (MANDATORY, NO VARIATION):

    "Select operation:

    1. Run an existing workflow
    2. Create a new workflow
      (All workflows indexed at ~/.claudebox/meta/workflows/index.md)"
  • Await user selection.

  • If selection is ambiguous or invalid, repeat prompt until valid input.

  • Branch to Section 2 ("existing") or Section 3 ("new") based on selection.


2. RUN EXISTING WORKFLOW

  • Check for ~/.claudebox/meta/workflows/index.md.
    • If missing or empty, notify user: "No workflows available." Immediately proceed to Section 3.
  • Read and display all workflows from index as:

{number}. {workflow\_name}: {description}

  • Require user to select by name or number. Do not proceed on ambiguity.
  • For chosen workflow:
  • Load from:
    • Config: ~/.claudebox/meta/workflows/{workflow_name}/config.md
    • Role prompts: ~/.claudebox/meta/workflows/{workflow_name}/roles/{agent}.md
    • Any templates/phases as needed
  • Enforce absolute immutability of workflow—NO modifications.
  • Initialize output directory:
    ~/.claudebox/outputs/{workflow_name}_{timestamp}/
    
  • For each phase N:
    • Prepare per-phase directory:
      ~/.claudebox/outputs/{workflow_name}_{timestamp}/phase{N}/
      
    • For each agent in phase:
      • Create task file:
        ~/.claudebox/outputs/{workflow_name}_{timestamp}/phase{N}/{agent}_task.md
        
      • Agent receives ONLY:
        • Persona prompt: ~/.claudebox/meta/workflows/{workflow_name}/roles/{agent}.md
        • Context injected via:
          <task_path>~/.claudebox/outputs/{workflow_name}_{timestamp}/phase{N}/{agent}_task.md</task_path>
          
      • Agent outputs to:
        ~/.claudebox/outputs/{workflow_name}_{timestamp}/phase{N}/{agent}_output.md
        
    • If critic present for phase:
      • Spawn stateless critic; provide ONLY:
        • Output to review: .../{agent}_output.md
        • Workflow spec: from contract in config
      • Critic outputs to:
        ~/.claudebox/outputs/{workflow_name}_{timestamp}/evaluations/phase{N}_{agent}_eval.md
        
      • MANDATORY LOOP:
        • If critic verdict is "ITERATE," the corresponding agent MUST revise.
        • No upper limit on iterations unless explicitly set in config. Loop continues until critic returns "APPROVE" or hard stop as per workflow contract.
        • All loop artifacts (every iteration) are logged as:
          ~/.claudebox/outputs/{workflow_name}_{timestamp}/phase{N}/history/{agent}_output_iter{I}.md
          ~/.claudebox/outputs/{workflow_name}_{timestamp}/evaluations/history/phase{N}_{agent}_eval_iter{I}.md
          
    • After final phase, copy or symlink final outputs to:
      ~/.claudebox/outputs/{workflow_name}_{timestamp}/final/
      
      and optionally
      ~/.claudebox/meta/workflows/{workflow_name}/roles/final_{timestamp}/
      
  • At completion, display:
    ✅ Workflow {workflow_name} executed successfully.
    Final outputs: ~/.claudebox/outputs/{workflow_name}_{timestamp}/final/
    
  • TERMINATE.

Read the full file on GitHub · 226 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. 6d ago First seen · 226 lines · 0 tokens per session scan A eb3adc877538

Subscribe to this mod's changes

controlflow is a command published in the GitHub repository RchGrav/claudebox (1,143 stars, last pushed 1y ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 2,171 tokens. 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-30.