[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)
8 Comments
Found 2 possible duplicate issues:
This issue will be automatically closed as a duplicate in 3 days.
🤖 Generated with Claude Code
The duplicates are not the same, albeit related.
Encountered the same issue in 2.0.76.
I've encountered the same problem: the ANTHROPIC_BASE_URL env is not working.
My workaround for this is to add "hasCompletedOnboarding": true to ~/.claude.json within a script that I have people run instead of running claude directly.
Guys, but where is a fix?.. The issue is just closed
@fi0nafung - is there a fix for this? what release?
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.