[BUG] ANTHROPIC_AUTH_TOKEN renamed to CLAUDE_CODE_OAUTH_TOKEN
Resolved 💬 3 comments Opened Sep 29, 2025 by osalloum Closed Sep 30, 2025
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?
https://docs.claude.com/en/docs/claude-code/settings
The documentation still references ANTHROPIC_AUTH_TOKEN but Claude Code 2 is expecting CLAUDE_CODE_OAUTH_TOKEN
What Should Happen?
When configuring CLAUDE_AUTH_TOKEN it should be used a bearer token for sending requests
Error Messages/Logs
Steps to Reproduce
When configured with
{
"env": {
"ANTHROPIC_MODEL": "claude-sonnet-4-20250514",
"ANTHROPIC_BASE_URL": "http://127.0.0.1:9001",
"ANTHROPIC_AUTH_TOKEN": "sk-ant-oat01-myrealclaudetoken-T0vGhgAA",
"BASH_DEFAULT_TIMEOUT_MS": "300000",
"BASH_MAX_TIMEOUT_MS": "1800000"
},
"permissions": {
"allow": [
"Bash(mv:*)",
"Bash(find:*)",
"Bash(./gradlew *)"
],
"deny": []
}
}
claude -p "hi"
API Error: 401 {"type":"error","error":{"type":"authentication_error","message":"OAuth authentication is currently not supported."},"request_id":"req_011CTdZYhDAPuDravbsPrHMw"} · Please run /login
When configured with
{
"env": {
"ANTHROPIC_MODEL": "claude-sonnet-4-20250514",
"ANTHROPIC_BASE_URL": "http://127.0.0.1:9001",
"CLAUDE_CODE_OAUTH_TOKEN": "sk-ant-oat01-myrealclaudetoken-T0vGhgAA",
"BASH_DEFAULT_TIMEOUT_MS": "300000",
"BASH_MAX_TIMEOUT_MS": "1800000"
},
"permissions": {
"allow": [
"Bash(mv:*)",
"Bash(find:*)",
"Bash(./gradlew *)"
],
"deny": []
}
}
it works
claude -p "hi"
Weekly limit reached ∙ resets 10am
Claude Model
None
Is this a regression?
Yes, this worked in a previous version
Last Working Version
1.0.128
Claude Code Version
2.0.0
Platform
Anthropic API
Operating System
macOS
Terminal/Shell
Terminal.app (macOS)
Additional Information
_No response_
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗