Workflow tool: honor `effort` on custom subagents + add an `effort` option to agent()
What I'd like
Per-agent reasoning-effort control inside the native Workflow tool (CLAUDE_CODE_WORKFLOWS=1), in two complementary forms:
- Honor the
effortfield on a custom subagent's frontmatter when that subagent is invoked as a workflowagentType. - Add an
effortoption toagent(prompt, opts)— right next tomodel— e.g.agent(prompt, { model: 'opus', effort: 'xhigh', agentType: '...' }).
Why
Workflow authors want to route individual stages to different effort levels — e.g. a planning/review stage at xhigh, mechanical/extraction stages at low — for cost and quality control. Today the only effort lever is the whole session (--effort / /effort / effortLevel in settings), which applies uniformly to every agent in a workflow. There's no per-stage knob.
What I observed (Claude Code 2.1.158)
I tested two custom subagents, identical except effort: low vs effort: xhigh (both model: opus), each invoked via agent(prompt, { agentType }) on an identical prompt:
- The per-agent
efforthad no observable effect — no extended-thinking in either transcript, and outputs were within normal run-to-run variance. The session-level effort appeared to dominate regardless of the subagent'seffortfield. agent()currently has noeffortoption at all — onlymodel— so there's no direct per-call lever either.
So neither route to per-agent effort works today: the subagent-file effort doesn't appear to reach the workflow agent, and there's no agent() opt for it.
Proposed API
// Option A — subagent frontmatter applies to workflow agentTypes
// .claude/agents/deep-planner.md
// ---
// name: deep-planner
// model: opus
// effort: xhigh
// ---
// Option B — effort opt on agent(), beside model
const plan = await agent(prompt, { model: 'opus', effort: 'xhigh', agentType: 'deep-planner' })
Ideally both, with the agent() opt taking precedence over the subagent file when both are set (mirroring how the model override already works).
Environment
- Claude Code 2.1.158, macOS
This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗