[BUG] VS Code extension sends unsupported `scope` field in cache_control, causing 400 API errors

Resolved 💬 2 comments Opened Apr 1, 2026 by vzjwall Closed Apr 8, 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?

The VS Code extension sends cache_control: { type: "ephemeral", scope: "..." } in
system
prompt blocks, but the API rejects the unknown scope field with a 400 error:

system.1.cache_control.ephemeral.scope: Extra inputs are not permitted

The CLI (claude --version → 2.1.89) works fine on the same machine. The error only occurs

in the VS Code extension.

UI output:

I'm running variations of this to try and get my UI to run in sync. These are from my .zshrc file.

export CLAUDE_CODE_DISABLE_PROMPT_CACHING=1
export CLAUDE_CODE_STRIP_BETA_HEADERS=1
export CLAUDE_CODE_DISABLE_PROMPT_CACHING=1
export NODE_TLS_REJECT_UNAUTHORIZED=0

My environment is a bit restricted, so just working within our parameters. Things work with Claude in the command line up and down versions. This JUST happened today and torched my entire UI.

What Should Happen?

API calls succeed (no extra fields in cache_control)

Error Messages/Logs

API Error: 400 {"error":{"message":"{"message":"system.1.cache_control.ephemeral.scope: Extra inputs are not permitted"}. Received Model Group=claude-sonnet-4-6\nAvailable Model Group Fallbacks=None","type":"None","param":"None","code":"400"}}

Steps to Reproduce

I don't know. I just load VSC ... Claude Code for VSC extension and still have these issues

Claude Model

Sonnet (default)

Is this a regression?

Yes, this worked in a previous version

Last Working Version

_No response_

Claude Code Version

2.1.89 (have used 2.1.83, upgraded to see if it was fixed and was not)

Platform

Anthropic API

Operating System

macOS

Terminal/Shell

Terminal.app (macOS)

Additional Information

https://github.com/BerriAI/litellm/issues/22398
https://github.com/BerriAI/litellm/pull/22567

Additional references above - just can't seem to find the resolver

▎ Running behind a LiteLLM proxy (internal gateway). CLAUDE_CODE_DISABLE_PROMPT_CACHING=1
is set in .zshrc but VS Code extension does not inherit macOS shell env vars, so the
flag has no effect on the extension. CLI works because it inherits the env from the
terminal session.

View original on GitHub ↗

This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗