Agent tool ignores `effort:` frontmatter in subagent .md files — inherits global effortLevel instead

Status Fixed / completed
Maintainer reply None cached
Activity 8 comments · opened Jun 2, 2026 · closed Aug 17, 2026

Summary

When spawning subagents via the Agent tool, the effort: field declared in the subagent's .md frontmatter is ignored. All subagents inherit the global effortLevel from .claude/settings.json regardless of their individual frontmatter declaration.

Environment

  • Claude Code version: latest
  • Project settings: .claude/settings.json with "effortLevel": "xhigh"
  • Subagent files in .claude/agents/ with varying effort: frontmatter values

Steps to Reproduce

  1. Create .claude/settings.json with "effortLevel": "high"
  2. Create a subagent file .claude/agents/agent-a.md with frontmatter effort: low
  3. Create a subagent file .claude/agents/agent-b.md with frontmatter effort: xhigh
  4. Spawn both subagents via the Agent tool in the same session
  5. Observe: both subagents run at high (the global setting), not at their declared effort: level

Expected Behavior

Each subagent spawned via the Agent tool should use the effort: value declared in its own frontmatter, allowing per-agent effort configuration.

Actual Behavior

All subagents inherit effortLevel from the parent session's .claude/settings.json, ignoring the frontmatter effort: field entirely.

Impact

This makes it impossible to build multi-agent pipelines with differentiated effort levels per role. A natural pattern is having some agents that perform simple, mechanical tasks (effort: low) alongside others that require deep reasoning (effort: xhigh). With the current behavior, the global effortLevel must be set to the highest required value, causing all agents — including lightweight ones — to run at maximum effort unnecessarily.

Workaround

Set effortLevel globally to the highest required value and accept the token overhead for lower-effort agents.

Request

Respect the effort: frontmatter field when spawning subagents via the Agent tool, using it to override the global effortLevel for that specific subagent invocation.

View original on GitHub ↗

3 Comments

Necmttn · 2 months ago

Per-agent effort is also an accounting problem.

Each Agent spawn should preserve four fields: agent file path/hash, declared effort from frontmatter, inherited global effort, and effective effort used for the child session. If the child inherits because frontmatter is unsupported or overridden, that reason should be explicit.

That gives cost tooling a clean explanation for "cheap scout ran at xhigh" cases, and it gives users a regression target: parent high + agent low should either run low or report the mismatch before work starts.

---

_Generated with ax._

vietnt · 1 month ago

Still reproduces on 2.1.215 (macOS). Two data points that make this easy to confirm, plus a second affected surface:

1. Transcript-level proof (frontmatter path)

Since 2.1.212 session transcripts record the reasoning effort on each assistant message, so no eyeballing is needed:

  • Agent definition: ~/.claude/agents/coder-low.md with model: opus, effort: low (key/value per the sub-agents docs, which say frontmatter effort "overrides the session effort level").
  • Session effortLevel in settings.json set higher.
  • Spawn the agent via the Agent tool with a trivial prompt, then grep its transcript under <project>/<session-id>/subagents/agent-*.jsonl:
$ grep -o '"effort":"[a-z]*"' agent-<id>.jsonl | sort | uniq -c
   1 "effort":"high"     # = parent session's level, not the frontmatter's "low"

The child records exactly the parent session's effort on every assistant message; the frontmatter value never reaches the request.

2. The Workflow tool's per-call effort opt is dropped too

agent(prompt, {agentType, effort}) documents an effort option, but it's silently ignored the same way. A/B probe: same prompt to the same custom agent at effort: 'low' vs effort: 'max' — a mental-arithmetic task with "verify by an independent method before answering" (48273 × 91457):

| probe | recorded effort | thinking chars | output tokens | answer |
|---|---|---|---|---|
| effort: 'low' | high (inherited) | 0 | 6 | wrong |
| effort: 'max' | high (inherited) | 0 | 6 | wrong (different) |

Identical recorded effort, identical zero-thinking behavior at both extremes — a genuine max would not blurt a wrong 10-digit product with no thinking. So the override is dropped before the request, not just mislabeled in the UI.

Note: the Workflow side was reported in #64033 but auto-closed as a duplicate of #43083, which is a feature request. Since agent()'s effort opt is already documented in the tool schema and silently dropped, it's the same bug as this issue, not a missing feature.

Impact

Any routing setup that pairs a big model with low effort for cheap mechanical work (a common cost/latency pattern) silently runs every such subagent at the session's full effort instead.

joweiser · 1 month ago

I can confirm this on Windows using Claude Code 2.1.219

Showing cached comments. Read the full discussion on GitHub ↗