[BUG] maximum of 4 blocks with cache_control may be provided
Resolved 💬 17 comments Opened Sep 30, 2025 by zhongwen-xu Closed Jan 10, 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?
it should just work, but it only works for CLI, not the vscode extension
What Should Happen?
Claude should just repsonse without error.
Error Messages/Logs
API Error: 400
{"type":"error","error":{"type":"invalid_request_error","message":"A
maximum of 4 blocks with cache_control may be provided. Found
5."},"request_id":"req_011CTdncGQHoWvTQh8WTVMWb"}"
Steps to Reproduce
open the updated vscode extension, type anything, it reports 400 error.
Claude Model
Sonnet (default)
Is this a regression?
Yes, this worked in a previous version
Last Working Version
_No response_
Claude Code Version
2.0.0 (Claude Code)
Platform
Anthropic API
Operating System
macOS
Terminal/Shell
VS Code integrated terminal
Additional Information
_No response_
17 Comments
In the terminal using Claude Code, this issue also occurs on my end, but it started appearing from version 1.0.128. It disappears after I downgrade the version, and the problem persists in version 2.0 as well. The error content is:
"API Error: 400 {\"type\":\"error\",\"error\":{\"type\":\"invalid_request_error\",\"message\":\"A maximum of 4 blocks with cache_control may be provided. Found 5.\"},\"request_id\":\"req_011CTcSQCjcKsqyvV95aH1Bi\"}"
I am the same, an error occurs when using @ to reference files.
I tried it and this bug only works in the VSCode plugin, not in the terminal
Just upgrade the server for the forwarding service
I have the same issue. how to fix it?
I am also experiencing this issue. Is there any solution available at this time?
Thank you.
kaeelo5 @.***> 于2025年10月9日周四 06:41写道:
I tried using claude code in the terminal instead of in VSCode, and the issue still occurred.
same issue
@claude Please try to analyze why and how to solve it.
this will fix it for you:
[System.Environment]::SetEnvironmentVariable("DISABLE_PROMPT_CACHING","1","User")Please run on admin terminal
same issue. how to fix it?
It seems that Claude can only be triggered by contributors to the repository.
<img width="1123" height="692" alt="Image" src="https://github.com/user-attachments/assets/500f9b82-b9c1-417b-8359-bbf21d779b05" />
This issue has been inactive for 30 days. If the issue is still occurring, please comment to let us know. Otherwise, this issue will be automatically closed in 30 days for housekeeping purposes.
This issue has been automatically closed due to 60 days of inactivity. If you're still experiencing this issue, please open a new issue with updated information.
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.