[BUG] Environment Variables No Longer Override settings.json in v2.0.1

Resolved 💬 6 comments Opened Sep 30, 2025 by siraht 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?

After updating to Claude Code v2.0.1 from 1.x, environment variables declared inline with the claude command are no longer overriding the configuration values set in ~/.claude/settings.json. This is a regression from v1.x behavior where environment variables had proper precedence.

What Should Happen?

When running:

ANTHROPIC_BASE_URL=http://localhost:8080 claude

The ANTHROPIC_BASE_URL should be set to http://localhost:8080 for that specific invocation, overriding any value in ~/.claude/settings.json.

Error Messages/Logs

Steps to Reproduce

Run ANTHROPIC_BASE_URL=http://localhost:8080 claude and see what happens?

Claude Model

None

Is this a regression?

Yes, this worked in a previous version

Last Working Version

1.x

Claude Code Version

2.0.1

Platform

Anthropic API

Operating System

Ubuntu/Debian Linux

Terminal/Shell

Warp

Additional Information

  • Standard environment variable behavior in bash works correctly (verified with ANTHROPIC_BASE_URL=http://localhost:8080 printenv ANTHROPIC_BASE_URL)
  • The issue affects all environment variables in the settings.json env object, not just ANTHROPIC_BASE_URL

View original on GitHub ↗

This issue has 6 comments on GitHub. Read the full discussion on GitHub ↗