[BUG] Skill effort: frontmatter is documented but has no runtime effect
What's Wrong?
A skill's effort: YAML frontmatter is documented as overriding reasoning effort while the skill is active, with precedence env > frontmatter > session. In the tested configurations it has no runtime effect.
When a skill whose frontmatter sets a lower effort than the session (e.g. effort: medium, or effort: low) is invoked, the skill-active turns run at the session effort level — not the frontmatter level. There is no step-down in reasoning at the skill boundary.
This reproduced at session --effort max in both headless (-p) and interactive runs, and additionally at session --effort high. In every tested run the skill-active turns tracked the session level and never the (lower) frontmatter level.
Critically, the environment/session effort lever does work as a positive control: CLAUDE_CODE_EFFORT_LEVEL=medium reduced reasoning ~50% across all turns. So the effort mechanism and the measurement method are sound — it is specifically the skill frontmatter that is ignored.
What Should Happen?
Per the documented precedence (env > frontmatter > session), a skill with effort: medium active during a session running at --effort max should lower reasoning effort to medium on the skill-active turns (and restore the session level afterward).
The documented behavior, for reference:
- Model configuration: "Frontmatter effort applies when that skill or subagent is active, overriding the session level but not the environment variable." — and on precedence: "The environment variable takes precedence over all other methods, then your configured level, then the model default."
- Skills frontmatter reference:
effort— "Effort level when this skill is active. Overrides the session effort level. Default: inherits from session."
Either the frontmatter should take effect as documented, or the documentation should be corrected to state that skill effort: frontmatter does not control reasoning effort.
Error Messages/Logs
(none — silent no-op)
There is no error. The documented field is accepted but produces no behavior change, so nothing is logged. Detection requires measuring reasoning/thinking-token usage per turn (see Steps to Reproduce).
Steps to Reproduce
- Create a minimal skill whose frontmatter sets a lower effort than the session will use. For example, at
<project>/.claude/skills/effort-demo/SKILL.md:--- name: effort-demo description: Minimal skill to test whether effort frontmatter lowers reasoning effort. effort: medium --- Produce a short, deterministic output: one fenced mermaid flowchart of a 3-stage CI pipeline (build, test, deploy), then 2-3 sentences explaining the choice. - Start a session at a higher effort:
(Also reproduces atclaude --effort max--effort highpaired witheffort: lowin the skill — a larger gap makes the absence of any step-down unambiguous.) - Invoke the skill — e.g. enter
/effort-demo(or whatever invocation activates a skill in your setup) — so its instructions are injected and the model continues on subsequent turns. Use the fixed brief above so output size is constant across conditions. - Inspect per-turn token usage from the session transcript — each assistant turn's
output_tokens(which include reasoning/thinking tokens), and the reasoning portion in particular. Compare the skill-active turns to the pre-skill turns within the same session (a within-session comparison controls for run-to-run variance). - Observed: skill-active turns sit at the session (max/high) reasoning level — no reduction toward the frontmatter (medium/low) level. Expected: skill-active turns drop to the frontmatter level.
Positive control (confirms the measurement detects real effort changes — and gives a tool-free sanity check, since lower effort visibly shortens/flattens responses): repeat with CLAUDE_CODE_EFFORT_LEVEL=medium instead of skill frontmatter — reasoning drops ~50% on every turn, as expected.
Environment
- Claude Code version: 2.1.179
- Model: Claude Opus 4.8
- Platform: Anthropic API
- Operating System: Windows (the defect is at the harness/effort layer, not OS-specific — also reproduced headless / non-interactive
-p) - Terminal: PowerShell (and headless
-p) - Regression: unknown — only 2.1.179 was tested
Additional Information
Documentation. The effort: frontmatter override and the env > frontmatter > session precedence are documented at model-config ("Frontmatter effort applies when that skill or subagent is active, overriding the session level but not the environment variable") and the skills frontmatter reference ("Overrides the session effort level. Default: inherits from session.").
About the numbers below. "Hidden" tokens = output_tokens (which include reasoning/thinking tokens) minus an estimate of the visible content length — a noisy residual estimate, so absolute values are approximate and vary run-to-run. The signal is the within-run comparison (skill-active vs pre-skill) and the large gap to the expected lower level — not absolute thresholds. Approximate reference bands (which overlap, precisely because the estimate is noisy): max ≈ 880–1370, high ≈ 460, medium ≈ 430–670, low ≈ 150–250.
Positive control — environment effort works (so the measurement is sensitive):
| turn | session --effort max |
CLAUDE_CODE_EFFORT_LEVEL=medium |
Δ |
|---|---|---|---|
| pre-skill | 894 | 440 | −51% |
| skill-invocation | 886 | 432 | −51% |
| post-skill | 1372 | 666 | −51% |
Skill frontmatter effort: medium at session --effort max — inert (headless and interactive); skill-active turns stay at the max band, never the medium band:
| turn | baseline (max, no frontmatter) | max + frontmatter medium (headless) |
max + frontmatter medium (interactive) |
|---|---|---|---|
| skill-invocation | 886 | 1166 | 984 |
| post-skill | 1372 | 1487 | 1344 |
Skill frontmatter effort: low at session --effort high — inert (rules out a "max is a special floor" explanation). The skill-invocation turn stays at the high band; it does not fall to the low target (~150–250):
| run | pre-skill turns | skill-invocation turn | expected if low engaged |
|---|---|---|---|
| 1 | 465, 182 | 457 | ~150–250 |
| 2 | 461, 167 | 453 | ~150–250 |
(Across all skill-active turns the level stays at or above the pre-skill turns — i.e. no step-down toward the low target. The invocation-turn values, 457 and 453, are the cleanest signal and sit squarely in the high band.)
Precedence discrepancy. The documentation states env > frontmatter > session. The observed behavior is consistent with env > session only — skill frontmatter is absent from the effective effort chain.
Likely root cause (hypothesis). Skills appear to be instruction-injection into the parent context rather than an isolated execution with its own reasoning budget. The parent model does the work on subsequent turns at the session effort, so there is no separate "skill execution" for an effort: override to govern. The skill-active state is set on those turns; the session effort still governs them.
How this differs from related issues.
- #34553 is a feature request to add an
effortLevel:field to command/agent frontmatter. This is a defect report: the skilleffort:field that is already documented has no runtime effect — a different surface (skills vs commands/agents) and a different nature (existing-but-broken vs not-yet-existing). - Related effort-reliability reports (#33000
/effort"Unknown skill"; #26950 effort propagation unreliable) describe intermittent effort issues; here the skilleffort:frontmatter is inert in every tested run, at every session level tested.
Scope of claim. Verified with one templated skill at --effort max (headless and interactive) and --effort high, on Claude Code 2.1.179 / Claude Opus 4.8. This is not a proof for every skill or every effort level. The behavior appears consistent with a harness/effort-layer issue rather than skill content — broader skill coverage would further confirm that — but a single skill is sufficient to demonstrate the defect.
I ran into this from the opposite direction and got the opposite result, so here is the data in case it helps narrow the version range.
On 2.1.219 / Opus 5 (and unchanged on 2.1.220), skill frontmatter effort works for me, and it changes real reasoning spend, not just a status field.
Two skills, identical bodies, differing only in the effort: low line (confirmed with diff). Session launched at --effort xhigh via the CLI flag, not the env var, so frontmatter should win under the documented precedence. CLAUDE_EFFORT unset. Two runs per arm.
The task was picked so that the visible output cannot vary: compute the number of derangements of 9 elements by recurrence, verify by a second method, output only the integer. All four runs printed 133496 and nothing else, so any token difference is reasoning rather than response length.
| Arm | top-level effort per assistant record |
work-turn output_tokens |
|---|---|---|
control, no effort: field |
xhigh, xhigh, xhigh, xhigh |
419, 360 |
treatment, effort: low |
xhigh, xhigh, low, low |
112, 152 |
Ranges do not overlap. Mean drop is about 66%.
The control arm matters here: without it you cannot distinguish a working frontmatter override from "invoking any skill resets effort to the default." The control stayed at xhigh throughout, so the change in the treatment arm is attributable to the field.
One limit of this design, stated plainly so the number isn't over-read: it establishes that the effort dial is applied and that thinking spend moves with it. It does not establish that output quality is preserved — the task constrained output to a bare integer, so a cheaper arm that skipped the instructed second-method verification and got lucky would look identical here. Quality at low effort is unmeasured by this probe. That does not affect the point at issue in this thread (whether the field has runtime effect), but it is not evidence that low effort is safe.
Two things that might explain the difference from your runs:
- Version or model. You measured 2.1.179 on Opus 4.8. I am on 2.1.219/2.1.220 on Opus 5. If it was fixed in between, that would present exactly like this.
- Instrument. Your numbers are a residual estimate (
output_tokensminus estimated visible length), which you flagged as noisy. There is a cheaper direct read that I do not think is mentioned in the thread: everytype: "assistant"record in the session.jsonlcarries a top-leveleffortfield. It moved tolowon the record after the skill loaded, so on 2.1.219+ the harness is plumbing the level through, not merely accepting the YAML key.
That top-level field may be useful for your repro regardless of who is right. If it stays at the session level on 2.1.179, the field never reaches the effort chain at all. If it moves to the frontmatter value while token spend does not follow, then the state is set but the budget is not applied — a narrower and probably more actionable bug than "the field is ignored."
One behavior I did confirm that is not in the thread, and that surprised me: the level latches. After the skill returns, the session stays at the frontmatter level for every subsequent turn — it does not revert at the skill boundary. Your issue predicts a step-down "and restore the session level afterward"; on 2.1.219+ the restore does not happen. Whether that is intended is a separate question, but it means a skill declaring a low effort quietly re-tiers the remainder of the session, including any subagents dispatched after it.
It does not persist to settings.json, though, so it dies with the session.
One caution for anyone measuring this: CLAUDE_CODE_EFFORT_LEVEL sits above frontmatter in the documented precedence, so if it is exported anywhere in your environment every frontmatter declaration silently stops working with no error, and the result reads as "the field is ignored." Worth confirming it is unset before concluding either way.
Happy to re-run anything on 2.1.220 if a specific configuration would help.
Adding a data point from 2.1.255 through 2.1.265 (Windows 11, Claude Desktop scheduled tasks, Opus 5, subscription): skill frontmatter effort: now DOES apply for us on most runs, but it is dropped intermittently by what looks like a race in the streaming tool executor.
Measured. Two scheduled routines whose skills carry effort: low (earlier medium), 120 runs over 2026-09-02..09-08, read from the per-turn top-level effort field in the transcript JSONL:
- 110 runs: turn 1
high(the Skill tool call), every turn after it at the frontmatter level. Works as documented. - 10 runs (8%): every turn
highfor the whole run, after an identical Skill call with identical args, the same injected skill body, the same CC version as engaged neighbours minutes apart. No human turn, no error, no other session's Skill call inside the window. - 3 more runs reverted to
highafter a 529 retry: the harness's own "Try again" prompt starts a new query, same as a human message. That part matches the "while the skill is active" wording, just worth knowing.
What the bundle shows (2.1.260 and 2.1.265, minified names vary):
- The Skill tool returns
{ data: {success, commandName, ...}, newMessages, contextLayers: [{kind:"effort", effort}] }. - The streaming tool executor, on tool completion, merges those layers into its own
toolUseContextand yields each result as{ message, newContext: this.toolUseContext }fromgetCompletedResults(). - The main query loop adopts
newContextonly in the post-stream drain (for await (... of streamingToolExecutor.getRemainingResults()) { ...; if (r.newContext) ctx = {...r.newContext, queryTracking} }). - The mid-stream path (
getCompletedResults()called after each streamed assistant event) yields the same{message, newContext}but the loop only forwardsmessage;newContextis never assigned.getUpdatedContext()has no call sites.
So when the Skill tool (about 40 ms) completes before the stream's trailing message_delta/message_stop events are processed, its result is consumed on the mid-stream path and the effort layer (and allowed_tools / model layers, presumably) is lost for the rest of the query. The next turns are built from the un-updated context, so the run stays at the session level. Timing supports it weakly: the leaking runs sit at the fast end of the tool_use-to-tool_result gap (32-47 ms vs a 48 ms median for engaged runs).
Suggested fix: adopt newContext on the mid-stream path too, or read the executor's context back before building the next request.
Happy to share the per-run table or transcripts privately.
Additional data point — the raising direction, and it depends on who invokes the skill.
Environment: Claude Code 2.1.292, VS Code extension, macOS. Session effort medium; no maxEffortLevel, no CLAUDE_CODE_EFFORT_LEVEL.
Skill: user-level skill with frontmatter effort: high.
Invoked by the model (Skill tool): no effect.
- The skill body renders
${CLAUDE_EFFORT}ashigh. - But in the same turn,
echo $CLAUDE_EFFORTin Bash printsmedium. effort/perTurnEffortin the session transcript (~/.claude/projects/…/*.jsonl) staymedium.- Invoking the skill again in the same session only returns "already loaded".
Invoked by the user (typing /<skill-name>): works.
CLAUDE_EFFORT=high, and the transcript showseffort/perTurnEffort=highfor that turn.
So the frontmatter is honored only for user-invoked skills, not for model-invoked ones, although the docs describe the override without that distinction. The transcript field itself works: sessions started at high effort record high.
Expected: a model-invoked skill with effort: high raises effort for its turn, same as a user-invoked one. Otherwise the docs should state that the override applies only to user-invoked skills.
This was fixed in Claude Code 2.1.295, so we're closing this issue. If you disagree, let us know here and we can re-open it. Thanks for reporting!