claude-code icon indicating copy to clipboard operation
claude-code copied to clipboard

[BUG] /effort asks to confirm a cache miss on Opus 5.5 with a subscription, although the cache is kept

Open sebthom opened this issue 1 month ago • 2 comments

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?

On Opus 5.5 with a Claude Max subscription, /effort shows a confirmation dialog that warns about a cache miss (see below).

The prompt caching docs say this setup keeps the cache and needs no confirmation:

On Opus 5.5, Sonnet 5.5, Haiku 5.5, and Fable 5.1 with an API key or a Claude subscription, changing effort keeps the cache, and Claude Code applies the new level without asking.

My transcripts agree with the docs, not with the dialog: every effort change within the cache TTL read the full previous context from the cache (data under Additional Information).

What Should Happen?

As documented: on the 5.5 models and Fable 5.1 with an API key or a Claude subscription, /effort applies the new level without the confirmation dialog. The dialog stays for the setups the docs list as cache-breaking.

Error Messages/Logs

Change effort level?
Your next response will be slower and use more tokens

This conversation is cached for the current effort level. Switching to high means the full history gets re-read on your next message.

> 1. Yes, switch to high
  2. No, go back

Steps to Reproduce

  1. Log in with a Claude Max subscription and start Claude Code with claude-opus-5-5 at effort xhigh.
  2. Send any message and wait for the response.
  3. Run /effort and pick high.

The confirmation dialog above appears.

Claude Model

Opus

Is this a regression?

I don't know

Last Working Version

No response

Claude Code Version

2.1.301 (Claude Code)

Platform

Anthropic API

Operating System

Windows

Terminal/Shell

Other

Additional Information

Setup: Claude Max subscription via OAuth login, no API key; no Bedrock, Google Cloud, Foundry or gateway; CLAUDE_CODE_DISABLE_EXPERIMENTAL_BETAS and ANTHROPIC_BASE_URL not set; Windows 10 Pro 19045, ConEmu.

I checked every confirmed /effort change in my local transcripts (~/.claude/projects/*/*.jsonl). For each one, I compared the context size of the last main-chain request before the change with the cache usage of the first request after it. All changes ran on claude-opus-5-5 with the same subscription.

Version New level Context before Next cache_read Next cache_creation Gap
2.1.282 xhigh 238,711 238,707 21,373 2.5 min
2.1.282 xhigh 121,422 121,517 8,275 3.3 min
2.1.282 xhigh 524,350 525,561 248 1.2 min
2.1.283 high 524,226 524,224 1,282 1.4 min
2.1.283 max 540,801 540,799 18,438 3.7 min
2.1.286 max 381,479 386,847 11,607 9.1 min
2.1.286 max 662,087 663,819 11,255 29.8 min
2.1.291 max 553,260 553,258 21,442 4.5 min
2.1.296 xhigh 887,165 890,387 11,690 1.4 min
2.1.301 high 105,235 105,233 2,821 0.1 min
2.1.280 high 194,386 30,429 166,549 256.5 min

All 10 changes within the one-hour cache TTL read the full previous context from the cache. The only miss followed a gap of over four hours, after the cache had expired anyway.

Related: #63962 reported the same dialog text on older models and was closed by the stale bot.

sebthom avatar Oct 16 '26 19:10 sebthom

Same dialog here on Claude Code 2.1.303, macOS, Opus 5.5 (claude-opus-5-5[1m]), Claude subscription via OAuth, no custom ANTHROPIC_BASE_URL, CLAUDE_CODE_DISABLE_EXPERIMENTAL_BETAS not set.

Likely cause: Message Threads. I looked at the check that decides whether the dialog appears. In 2.1.303 (2.1.302 is identical) it is this function (minified names, so they differ between builds):

function ZBe(e,n,r,s,d){
  if(!d)return!1;
  let u=Ch();if(u===0||u===s)return!1;
  if(!VS(r))return!1;
  if(typeof bw(r,e)!=="number"&&typeof bw(r,n)!=="number"&&f3n(r,Ke(r))&&!Fs().rootLatestRequestThreaded)return!1;
  ...
  return!0}

f3n is true when per-turn effort is active (Opus 5.5 lists per_turn_effort in its capabilities, and the per-turn-control-2026-07-01 beta hasn't been refused). That is the documented case that skips the dialog. But the skip also requires !rootLatestRequestThreaded. That field is set after each main-thread request:

if(h===void 0)Fs().rootLatestRequestThreaded=dn&&Qb()

Qb() is the Message Threads gate: first-party provider, then CLAUDE_CODE_TETHER_LIVE if set, otherwise the tengu_curious_tower remote flag. The field resets on /clear and resume. So when the latest request went over a message thread (message-threads-2026-08-12), the dialog shows even on Opus 5.5. My ~/.claude.json has "tengu_curious_tower": true cached.

That would explain why this showed up for some accounts and not others, and why it seems to have started recently without a client change: the remote flag decides it, not the version.

The cache is still kept. An effort change in one of my sessions (medium → xhigh, Opus 5.5, 2.1.303, under a minute after the previous request) read the whole prior context from cache: the request before it read 76,778 tokens from cache, and the first request after the change also read 76,778 and wrote only 828. I can't tell from the transcript whether that particular request went over a thread. Your 10 out of 10 cache hits on 2.1.282–2.1.301 point the same way.

If threads don't actually break the cache on an effort change, the rootLatestRequestThreaded condition makes this dialog a false alarm. If they do in some cases, the prompt caching docs should list Message Threads next to Bedrock, Agent Platform and the other exceptions.

Untested workaround, inferred from the code above: CLAUDE_CODE_TETHER_LIVE=false should stop the dialog by turning threads off. Per #100083 that variable does turn threads off, but it's undocumented and changes how every request is sent.

Related: #100083, #102850 (other Message Threads side effects).

voidfreud avatar Oct 19 '26 11:10 voidfreud

This was fixed in Claude Code 2.1.310, so we're closing this issue. If you disagree, let us know here and we can re-open it. Thanks for reporting!

bpasero-ant avatar Nov 29 '26 18:11 bpasero-ant