Workflow tool: honor `effort` on custom subagents + add an `effort` option to agent()

Resolved 💬 2 comments Opened May 30, 2026 by 0xnfrith Closed Jun 3, 2026

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

View original on GitHub ↗

This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗