claude-code - 💡(How to fix) Fix Workflow tool: honor `effort` on custom subagents + add an `effort` option to agent()

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…

Code Example

// 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' })
RAW_BUFFERClick to expand / collapse

What I'd like

Per-agent reasoning-effort control inside the native Workflow tool (CLAUDE_CODE_WORKFLOWS=1), in two complementary forms:

  1. Honor the effort field on a custom subagent's frontmatter when that subagent is invoked as a workflow agentType.
  2. Add an effort option to agent(prompt, opts) — right next to model — 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 effort had 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's effort field.
  • agent() currently has no effort option at all — only model — 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

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

claude-code - 💡(How to fix) Fix Workflow tool: honor `effort` on custom subagents + add an `effort` option to agent()