[BUG] Claude Code v2.1.24+ broken on macOS - cache_control.ephemeral.scope error

Status Closed — not planned
Reported on v2.1.25
Maintainer reply None cached
Activity 14 comments · opened Feb 5, 2026 · closed Mar 24, 2026

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?

Anything later than v2.1.23 causes :
 API Error: 400 {"type":"error","error":{"type":"invalid_request_error","message":"system.2.cache_control.ephemeral.scope: Extra inputs are not
permitted"},"request_id":"req_011CXoxb4QmrysjyNqcTUneF"}

What Should Happen?

Error: system.2.cache_control.ephemeral.scope: Extra inputs are not permitted

Details:

  • Account: locotoki@gmail.com (Claude Max)
  • Platform: macOS (M1), Portugal
  • Works: v2.1.23 and earlier
  • Broken: v2.1.24, 2.1.25, 2.1.28, 2.1.29, 2.1.31
  • Same account works on Windows with v2.1.29
  • CLAUDE_CODE_DISABLE_EXPERIMENTAL_BETAS=1 does NOT fix it

The "scope" field in cache_control.ephemeral appears to be rejected by my account's API endpoint. This may be region-specific or account-specific routing issue.

Error Messages/Logs

API Error: 400 {"type":"error","error":{"type":"invalid_request_error","message":"system.2.cache_control.ephemeral.scope: Extra inputs are not
     permitted"},"request_id":"req_011CXoxb4QmrysjyNqcTUneF"}

Steps to Reproduce

anything later than v2.1.23 causes this error, for both Native and npm installation

Claude Model

Not sure / Multiple models

Is this a regression?

Yes, this worked in a previous version

Last Working Version

v2.1.23

Claude Code Version

2.1.23 (Claude Code)

Platform

Anthropic API

Operating System

macOS

Terminal/Shell

Terminal.app (macOS)

Additional Information

_No response_

View original on GitHub ↗

14 Comments

github-actions[bot] · 6 months ago

Found 1 possible duplicate issue:

  1. https://github.com/anthropics/claude-code/issues/21612

This issue will be automatically closed as a duplicate in 3 days.

  • If your issue is a duplicate, please close it and 👍 the existing issue instead
  • To prevent auto-closure, add a comment or 👎 this comment

🤖 Generated with Claude Code

locotoki · 6 months ago

This is not a duplicate of #21612. Please remove the duplicate label before auto-close.

#21612 is about context_management: Extra inputs are not permitted — a top-level parameter being rejected.

My error is system.2.cache_control.ephemeral.scope: Extra inputs are not permitted — a nested field inside the third system message's cache_control block. These are completely different fields, different code paths, and different root causes.

Here's the proof:

1. Different error field

#21612:  context_management: Extra inputs are not permitted
#23220:  system.2.cache_control.ephemeral.scope: Extra inputs are not permitted
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
         This field does not appear in #21612 at all

Search this entire repo for cache_control.ephemeral.scope — you will find zero results besides this issue.

2. #21612 workaround does NOT work here

Users in #21612 fixed their issue by downgrading to v2.1.20. For my issue, v2.1.23 is the last working version — every version after (v2.1.24, 2.1.25, 2.1.28, 2.1.29, 2.1.31, 2.1.32) produces the same error. Both native and npm installations are affected. Downgrading does not help. CLAUDE_CODE_DISABLE_EXPERIMENTAL_BETAS=1 also does not help (consistent with #20031).

3. macOS-only — same account works on Windows

My exact same Claude Max account works perfectly on Windows with v2.1.29. On macOS (M1), the same account fails on every version after v2.1.23. This is a platform-specific bug. #21612 has no mention of OS-specific behavior.

4. Probable root cause

The scope field is related to the workspace-level cache isolation that went live on Feb 5, 2026 (per Anthropic's prompt caching docs). On macOS, Claude Code injects "scope": "..." into cache_control.ephemeral on system message blocks. On Windows, it doesn't. The API rejects the field because it doesn't expect it.

This is a macOS-specific code path issue — not the same root cause as #21612.

Request

Please reopen this issue and remove the duplicate label. This is a distinct, reproducible, macOS-specific bug with a unique error signature. Auto-closing it into #21612 will bury it.

cc @anthropics/claude-code

locotoki · 6 months ago

Additional bug: v2.1.23 also broken — /plan mode corrupts message state

To compound the issue above, even v2.1.23 (the only version where basic requests work) has a separate critical bug:

After using /plan mode, exiting to execute corrupts the conversation history:

API Error: 400 {"type":"error","error":{"type":"invalid_request_error","message":"messages.0.content.0: unexpected `tool_use_id` found in `tool_result` blocks: toolu_01JTTpYfhCmHfS6VGMTcvmfe. Each `tool_result` block must have a corresponding `tool_use` block in the previous message."}}

What happens:

  1. Enter /plan mode, generate a plan
  2. Ask Claude to exit plan mode and execute
  3. It fails to properly exit — requires manual Shift+Tab
  4. Once back in normal mode, asking to proceed triggers the tool_use_id corruption error every time
  5. The only workaround is copy-pasting the plan output into a new session

Net result: I have ZERO fully working versions of Claude Code on macOS:

| Version | Status |
|---|---|
| v2.1.23 | Basic requests work, but /plan → execute transition corrupts state |
| v2.1.24–v2.1.32 | Completely broken — cache_control.ephemeral.scope error on every request |

I'm a paying Claude Max subscriber ($200/month) and Claude Code is essentially unusable on my primary development machine (macOS M1). A support ticket has also been filed via Intercom.

locotoki · 6 months ago

Additional bug: v2.1.23 also broken — /plan mode corrupts message state

Even v2.1.23 (the only version where basic requests work) has a separate critical bug:

After /plan mode, exiting to execute corrupts the conversation history:

API Error: 400 messages.0.content.0: unexpected tool_use_id found in tool_result blocks: toolu_01JTTpYfhCmHfS6VGMTcvmfe. Each tool_result block must have a corresponding tool_use block in the previous message.

Repro steps:

  1. Enter /plan mode, generate a plan
  2. 2. Ask Claude to exit plan mode and execute
  3. 3. It fails to properly exit — requires manual Shift+Tab
  4. 4. Once in normal mode, asking to proceed triggers the tool_use_id corruption error
  5. 5. Only workaround: copy-paste plan output into a new session

Net result — ZERO fully working versions on macOS:

| Version | Status |
|---|---|
| v2.1.23 | Basic requests work, but /plan to execute corrupts state |
| v2.1.24-v2.1.32 | Completely broken — cache_control.ephemeral.scope on every request |

Claude Max subscriber, Claude Code unusable on macOS M1. Support ticket also filed via Intercom.

locotoki · 6 months ago

Additional bug: v2.1.23 also broken

Even v2.1.23 (the only version where basic requests work) has a separate critical bug:

After /plan mode, exiting to execute corrupts the conversation history:

API Error: 400 messages.0.content.0: unexpected tool_use_id found in tool_result blocks: toolu_01JTTpYfhCmHfS6VGMTcvmfe. Each tool_result block must have a corresponding tool_use block in the previous message.

Repro steps:

  1. Enter /plan mode, generate a plan
  2. Ask Claude to exit plan mode and execute
  3. It fails to properly exit -- requires manual Shift+Tab
  4. Once in normal mode, asking to proceed triggers the tool_use_id corruption error
  5. Only workaround: copy-paste plan output into a new session

Net result -- ZERO fully working versions on macOS:

| Version | Status |
|---|---|
| v2.1.23 | Basic requests work, but /plan to execute corrupts state |
| v2.1.24-v2.1.32 | Completely broken -- cache_control.ephemeral.scope on every request |

Claude Max subscriber, Claude Code unusable on macOS M1. Support ticket also filed via Intercom.

resouer · 6 months ago

You can just go ahead disable prompt cache, then this issue will be fixed:

    "DISABLE_PROMPT_CACHING": "1"
eromoe · 6 months ago

i am using litellm gateway, works on windows but fail on mac too. export DISABLE_PROMPT_CACHING=1 does solve the problem .
But why we can't use prompt_cacheing ?

github-actions[bot] · 5 months ago

Closing for now — inactive for too long. Please open a new issue if this is still relevant.

zhengxiangyue · 5 months ago

Saw similar but not exact same issue on 2.1.88

2026-03-31T02:02:17.352Z [ERROR] Error: Error: 400 {"error":{"message":"{\"message\":\"system.1.cache_control.ephemeral.scope: Extra inputs are not permitted\"}. Received Model Group=bedrock-claude-sonnet-4-6\nAvailable Model Group Fallbacks=None","type":"None","param":"None","code":"400"}}
    at Qq.generate (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:8:51185)
    at Rx.makeStatusError (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:47:2195)
    at Rx.makeRequest (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:47:5420)
    at process.processTicksAndRejections (node:internal/process/task_queues:103:5)

Either downgrade to 2.1.87, or setting DISABLE_PROMPT_CACHING=1 would fix. But never had to set DISABLE_PROMPT_CACHING before.

ohhhHwH · 5 months ago

I encountered the same problem when using Claude Code for VSCode on an x86 Ubuntu server. I added "CLAUDE_CODE_DISABLE_EXPERIMENTAL_BETAS": "1" to the "env" in ~/.claude/settings.json, and then it worked.

<img width="645" height="504" alt="Image" src="https://github.com/user-attachments/assets/e77b3f3b-777a-4012-a1fe-1c4acfbe20be" />

devilr33f · 5 months ago

+1, can be reproduced on 2.1.88 VS Code extension. Adding CLAUDE_CODE_DISABLE_EXPERIMENTAL_BETAS to ~/.claude/settings.json fix the issue:

<img width="343" height="284" alt="Image" src="https://github.com/user-attachments/assets/e5149fab-6eb7-4fe1-8c7a-377b9d44d5be" />

richardrl · 4 months ago

Getting this error too running enterprise Claude. disabling prompt cache fixed it but i guess wastes our tokens...

tianyu-z · 4 months ago

CLAUDE_CODE_DISABLE_EXPERIMENTAL_BETAS=1 solves this issue. Version: 2.1.96

github-actions[bot] · 4 months ago

This issue has been automatically locked since it was closed and has not had any activity for 7 days. If you're experiencing a similar issue, please file a new issue and reference this one if it's relevant.