How to Use Claude Code Sub-Agents to Cut AI Costs and Run Parallel Workflows
A practical guide to orchestrating Claude Code sub-agents, assigning cheaper models to tasks, and improving workflow efficiency without sacrificing quality.
Practical Summary
This entry explains how to set up and use Claude Code's sub-agent feature to delegate tasks to cheaper, faster models like Haiku for research and summarization, while keeping the main session on more powerful models. It covers creating, configuring, and managing sub-agents for cost-effective parallel processing.
Why It Matters
For businesses using AI coding tools, this workflow directly reduces operational costs by optimizing model selection for specific tasks. It enables parallel execution, keeps context clean, and can improve developer productivity by automating research and routine analysis.
Understanding Claude Code Sub-Agents
Instead of running all tasks in a single chat that can become cluttered, Claude Code allows you to create sub-agents. The main session acts as an orchestrator, delegating work to specialist workers that run in their own isolated contexts, often in parallel. This keeps your main conversation clean and focused.
Step-by-Step Guide to Implementing Cost-Saving Sub-Agents
1. **Spin Up a Quick Sub-Agent**: In your main Claude Code session, ask in plain English to create a sub-agent for a specific task. For example: "Kick off a sub-agent to research [tool], give me features, pricing, how it works." The sub-agent runs independently and returns only a summary, preserving your main context.
2. **Create a Custom Sub-Agent**: Use the `/agents` command, navigate to the Library tab, and select "Create new agent." Choose between a Project-specific agent (lives in the repo) or a Personal agent (follows you). Select "Generate with Claude" and describe its purpose; Claude will write the necessary file.
3. **Assign a Cheaper Model for Savings**: For tasks like research and summarization, configure the sub-agent to use a cheaper, faster model like Haiku. Keep more powerful models like Opus for complex main session work. This "smart boss, cheap workers" approach optimizes costs.
4. **Set Permissions and Refine Descriptions**: During setup, you can grant sub-agents read-only tools if they shouldn't edit files. Also, keep the agent's description (in the YAML file) tight and specific to avoid misfires. For example, "use when I say roast my plan".
5. **Use Pre-built Agents**: Search GitHub for "awesome-claude-code-subagents" to find ready-made specialists like API designers or security auditors. These are markdown files you can drop into your project. Always review them before running.
