[BUG] Setting DISABLE_PROMPT_CACHING Environment Variable Causes 401 Unauthorized Errors
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?
When the environment variable DISABLE_PROMPT_CACHING is set, the Claude Code extension fails to authenticate, resulting in a 401 Unauthorized error. Unsetting this environment variable immediately resolves the issue.
This behavior is unexpected because a feature flag for caching should not interfere with the authentication flow. Furthermore, this environment variable appears to be undocumented, making the issue difficult to diagnose.
What Should Happen?
Setting DISABLE_PROMPT_CACHING=true should disable prompt caching as intended, without affecting the user's authentication status. All commands should execute normally after a successful login.
Error Messages/Logs
API Error: 401 {"type":"error","error":{"type":"authentication_error","message":"OAuth authentication is currently not
supported."},"request_id":"req_011CTgM7o63aV9K39BERJn7c"} · Please run /login
The Debug log is below.
[ERROR] SyntaxError: SyntaxError: JSON Parse error: Unexpected identifier "API"
at <parse> (:0)
at parse (unknown)
at <anonymous> (/$bunfs/root/claude:568:9937)
at W (/$bunfs/root/claude:534:13292)
at tFG (/$bunfs/root/claude:896:37032)
at processTicksAndRejections (native:7:39)
[ERROR] Error in non-streaming fallback: 401 {"type":"error","error":{"type":"authentication_error","message":"OAuth authentication is currently not supported."},"request_id":"req_011CTgLuT9f6gsMsASFAMVqk"}
[ERROR] Error: Error: 401 {"type":"error","error":{"type":"authentication_error","message":"OAuth authentication is currently not supported."},"request_id":"req_011CTgLuT9f6gsMsASFAMVqk"}
at new W5 (unknown:1:28)
at new _Y (/$bunfs/root/claude:716:20515)
at new jv (unknown:1:28)
at generate (/$bunfs/root/claude:716:21006)
at makeRequest (/$bunfs/root/claude:871:5359)
at processTicksAndRejections (native:7:39)
Steps to Reproduce
In your terminal, set the environment variable:
export DISABLE_PROMPT_CACHING=true
Launch or restart Claude code from the same terminal session to ensure it inherits the environment variable.
Attempt to use any Claude Code command that requires authentication (e.g., /edit, /fix, or starting a new chat).
Observe the 401 Unauthorized error.
Claude Model
Sonnet (default)
Is this a regression?
Yes, this worked in a previous version
Last Working Version
1.0.88
Claude Code Version
2.0.1
Platform
Anthropic API
Operating System
macOS
Terminal/Shell
Warp
Additional Information
<img width="1250" height="594" alt="Image" src="https://github.com/user-attachments/assets/ce22f93d-7556-4e19-a192-49db5369aa9e" />
You can just check the command "unset" and then it works. 404 error is not important.
This issue has 10 comments on GitHub. Read the full discussion on GitHub ↗