Skip to content

[BUG] /effort change confirmation dialog warns about cache miss, but cache is preserved #63962

Description

@whatrwewaitingf0r

Bug description

When changing effort level mid-session via /effort, Claude Code shows a confirmation dialog:

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

Subtitle: "Your next response will be slower and use more tokens"

This warning is incorrect. Empirical testing shows the prompt cache is fully preserved across effort level changes.

Reproduction

Three sequential claude --print calls with identical system/messages, varying only --effort:

Request 1 — effort high:
  cache_creation: 84,300    cache_read: 0

Request 2 — effort high (control):
  cache_creation: 61,695    cache_read: 22,653   ← partial hit (expected)

Request 3 — effort xhigh (CHANGED):
  cache_creation: 0         cache_read: 84,348   ← FULL cache hit

Request 3 shows cache_read: 84,348 and cache_creation: 0 — the entire messages prefix was served from cache despite the effort level change.

This is consistent with the Anthropic prompt caching docs, which state that the effort parameter (sent via the effort-2025-11-24 beta header) is a server-side output control, analogous to max_tokens or temperature, and should not affect the input cache key.

Impact

  • Users avoid switching effort mid-session because the dialog warns of cost/latency penalties that don't exist
  • This defeats the intended workflow of dynamically adjusting effort per-task (e.g., high for simple questions, xhigh for complex reasoning)
  • The same F8_ confirmation component is shared between /model and /effort — the warning is correct for model switches but incorrect for effort changes

Expected behavior

/effort changes should apply immediately without a cache-miss confirmation dialog, since the prompt cache is preserved.

Source code reference

The confirmation is triggered by fM_() in the binary, which checks PVH(model) (supports prompt caching) and shows F8_ dialog with identical text for both model and effort changes. The fix would be to skip fM_() when kind === "effort".

Environment

  • Claude Code: v2.1.143+
  • Model: claude-sonnet-4-6 (tested), applies to all models
  • OS: macOS 15.4

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:tuibugSomething isn't workinghas reproHas detailed reproduction stepsplatform:macosIssue specifically occurs on macOSstaleIssue is inactive

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions