[BUG] `ANTHROPIC_BASE_URL` ignored during setup
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?
From version 2.0.55 till 2.0.74, when you have a custom ANTHROPIC_BASE_URL, the initialisation of ~/.claude.json fails. It tries to connect to api.anthropic.com, which is blocked for our organisation. Moreover, I am able to get around this by installing 2.0.54 first, and then installing the latest (2.0.74) at this time.
I'm trying to provision claude code for 500+ people, so custom workarounds is something I'd like to prevent. After going past the "init" phase of getting ~/.claude.json created, I am able to upgrade, so my theory is that there is a bug in that part of the code. After upgrading ANTHROPIC_BASE_URL is respected again.
<img width="905" height="483" alt="Image" src="https://github.com/user-attachments/assets/0d7c36ff-0db1-4552-a881-b5fd496fa73c" />
What Should Happen?
ANTHROPIC_BASE_URL should be respected on first run
Error Messages/Logs
Steps to Reproduce
Install latest version of claude code, with settings preconfigured in ~/.claude/settings.json to point to a different endpoint, that endpoint will not be respected. ~/.claude.json should not be present. It will not be created.
Claude Model
Not sure / Multiple models
Is this a regression?
Yes, this worked in a previous version
Last Working Version
2.0.54
Claude Code Version
2.0.74
Platform
Other
Operating System
Other Linux
Terminal/Shell
Windows Terminal
Additional Information
This doesnt work on linux (alma), or windows (win 11)
This issue has 8 comments on GitHub. Read the full discussion on GitHub ↗