[BUG] ${CLAUDE_EFFORT} in a skill preloaded into a subagent expands to the session effort, not the subagent's effort
Preflight Checklist
- [X] I have searched existing issues and this hasn't been reported yet
- [X] This is a single bug report (please file separate reports for different bugs)
- [X] I am using the latest version of Claude Code
What's Wrong?
${CLAUDE_EFFORT} in a skill preloaded into a subagent (via the agent's skills: frontmatter) expands to the parent session's effort, not the subagent's own effort. The subagent's effort is set by its effort: frontmatter and is what the hook payload reports (effort.level) for that subagent's tool calls, so the two disagree.
The docs describe ${CLAUDE_EFFORT} as the current effort level (https://code.claude.com/docs/en/skills) and document a subagent's own effort (https://code.claude.com/docs/en/sub-agents#choose-an-effort-level).
Not tested: a skill loaded through the Skill tool inside a subagent, and a spawn that passes effort.
What Should Happen?
The placeholder should expand to the effort the subagent is actually running at (low in the repro below).
Error Messages/Logs
Session effort: medium
Subagent frontmatter effort: low
Preloaded skill body: "Effort: ${CLAUDE_EFFORT}" -> expanded to "Effort: medium"
Hook payload effort.level for the subagent's tool calls: "low"
Steps to Reproduce
- Start a session at effort
medium(/effort medium). - Create
.claude/agents/effort-probe.md:
---
name: effort-probe
description: Reports the effort value its preloaded skill shows
effort: low
skills:
- print-effort
---
Reply with the single line the print-effort skill gave you, nothing else.
- Create
.claude/skills/print-effort/SKILL.md:
---
name: print-effort
description: Prints the effort level
user-invocable: false
---
Effort: ${CLAUDE_EFFORT}
- Prompt:
Use the effort-probe agent and show me its reply. - The reply is
Effort: medium. A PreToolUse/PostToolUse hook on the subagent's tool calls receiveseffort.level=low.
Automated version, from the public repo melodic-software/claude-code-plugins (on the branch of PR #6913, or main once it lands):python3 plugins/harness-ops/skills/behavior-probes/scripts/probe.py run --live --case subagent/preloaded-skill-placeholder-reflects-session-effort
Claude Model
Not sure / Multiple models
Is this a regression?
I don't know
Claude Code Version
2.1.296 (Claude Code)
Platform
Anthropic API
Operating System
Other Linux
Terminal/Shell
Other