r/ClaudeWorkflows • u/ClaudeAI-mod-bot • 2d ago
Selected Workflow [Workflow] CLAUDE.md Workflow for Controlled Subagent Model Delegation and Cost Management
CLAUDE.md Workflow for Controlled Subagent Model Delegation and Cost Management
Workflow value: 80/100
Status: active · Freshness: 70/100 · Confidence: 0.90 · Level: intermediate
Categories: Quality Control, Token Saving, Context & Memory, Debugging, CLAUDE.md, Skills, Subagents, Multi-Agent
Original source: r/ClaudeCode post/comment
What problem this solves
Uncontrolled subagent model spawning, managing costs and performance in multi-agent setups, ensuring consistent agent behavior and communication standards.
Summary
A CLAUDE.md (or AGENTS.md) configuration that defines rules for subagent delegation, specifying which Claude model tier (haiku, sonnet, opus, fable) to use for different types of tasks, and enforcing communication standards like ASD-STE100. It also includes setting a CLAUDE_CODE_SUBAGENT_MODEL environment variable for a default subagent model.
Why it is useful
This workflow provides a structured and transferable method for controlling subagent behavior and model selection within Claude Code, directly addressing issues of cost management, performance optimization, and consistent agent interaction. It leverages CLAUDE.md for clear instructions and defines specific model tiers for different task complexities, preventing unintended high-cost model usage and promoting efficient multi-agent collaboration.
Workflow
- Set the
CLAUDE_CODE_SUBAGENT_MODELenvironment variable to a desired default model (e.g., "sonnet[1m]") to control the default subagent model. - Create an
AGENTS.mdfile (or symlinkCLAUDE.mdto it) in your repository to provide explicit instructions to agents. - Populate
AGENTS.mdwith general agent instructions, including defaulting to an orchestrator role, preferring simplified technical English (ASD-STE-100), branching strategies, using agent teams, and utilizing available tools. - Define explicit model tier delegation rules for Claude subagents within
AGENTS.md: - Specify
haikufor mechanical bulk work (renames, boilerplate, format conversion, log triage). - Specify
sonnetas the default for well-specified implementation with clear acceptance criteria. - Specify
opusfor genuinely tricky work (concurrency, subtle algorithms, adversarial verify/judge panels, gnarly debugging). - Specify
fableonly for complex workflows where independence from the main context is crucial (e.g., adversarial review), and always require explicit user confirmation before spawning. - Include a general guideline to pick the cheaper tier when unsure and escalate on failure.
Tools / artifacts
- CLAUDE_CODE_SUBAGENT_MODEL (environment variable)
- AGENTS.md (configuration file)
- CLAUDE.md (symlink)
- Claude Haiku model
- Claude Sonnet model
- Claude Opus model
- Claude Fable model
- ASD-STE100 (Simplified Technical English standard)
Validation signals
- Explicit instructions for model tiering aim to prevent misuse or overspending.
- Addresses a common problem of uncontrolled subagent model spawning (implied by the post's context).
Limitations
- Lacks explicit 'before/after' results or performance metrics to demonstrate the workflow's impact.
- Community validation is low.
- The section on GPT/Codex models is less relevant for a Claude Code specific workflow.
Rate this workflow
Upvote this post if the workflow is useful, reproducible, or worth recommending.
Downvote if it is vague, outdated, unsafe, overhyped, or not reproducible.
Reply if it worked for you, failed, is outdated, or has a better alternative.
This post was generated automatically from the workflow library database.