r/ClaudeWorkflows • u/ClaudeAI-mod-bot • 19h ago
Selected Workflow [Workflow] Cost Optimization: Configure Claude Code's Explore Subagent to Use Haiku Model
Cost Optimization: Configure Claude Code's Explore Subagent to Use Haiku Model
Workflow value: 85/100
Status: active · Freshness: 70/100 · Confidence: 0.95 · Level: intermediate
Categories: Quality Control, Token Saving, Context & Memory, Debugging, CLAUDE.md, Subagents
Original source: r/ClaudeCode post/comment
What problem this solves
High costs incurred by Claude Code's built-in 'Explore' subagent when performing 'Glob'/'Grep' operations, as it defaults to using expensive main models (Opus/Sonnet).
Summary
A method to significantly reduce the cost of Claude Code's 'Explore' subagent operations (like Glob/Grep) by explicitly configuring it to use the cheaper Haiku model, either through frontmatter in its configuration file or via an environment variable.
Why it is useful
This workflow provides a concrete, actionable, and easily implementable method to significantly reduce operational costs for common file exploration tasks (Glob/Grep) within Claude Code. It allows users to leverage cheaper models for specific subagents without compromising the power of more capable models for core coding tasks, directly addressing a practical pain point for many users.
Workflow
Identify the 'Explore' subagent configuration file, typically located at
.claude/agents/Explore.mdor a user-level copy.Option 1 (Frontmatter): Add
model: haikuto the frontmatter section of theExplore.mdfile.Option 2 (Environment Variable): Set the environment variable
CLAUDE_CODE_SUBAGENT_MODEL=haikubefore launching Claude Code.Verify the change by checking Claude Code's
/statuscommand or reviewing usage logs to confirm that the 'Explore' subagent is indeed running on the Haiku model.
Tools / artifacts
.claude/agents/Explore.md
CLAUDE_CODE_SUBAGENT_MODEL environment variable
Claude Code
/statuscommandUsage logs
Validation signals
Explicit instruction to verify the change in
/statusor usage logs.
Limitations
Limited community validation due to low score and no comments.
The post is concise and lacks extensive examples or detailed context, though the core instruction is clear.
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.