Skip to content

[BUG] settings.json Proxy Configuration Doesn't Work for Claude (But CLI Does) #22004

Description

@CallisteH

Preflight Checklist

  • I have searched existing issues and this hasn't been reported yet
  • This is a single bug report (please file separate reports for different bugs)
  • I am using the latest version of Claude Code

What's Wrong?

My app needs to have no proxy to work.
If I do this in ~/.claude/settings.json

{
  "env": {
    "ANTHROPIC_BASE_URL": "<base-url>",
    "ANTHROPIC_AUTH_TOKEN": "<token>",
    "CLAUDE_CODE_DISABLE_EXPERIMENTAL_BETAS": "1",
    "CLAUDE_CODE_TELEMETRY_DISABLED": "1",
    "https_proxy": "",
    "HTTP_PROXY": "",
    "http_proxy": "",
    "HTTPS_PROXY": ""
  },
  "model": "haiku"
}

Claude blocks. It takes the proxy that is in my bashrc.

Now, if I do this:

HTTPS_PROXY="" HTTP_PROXY="" https_proxy="" http_proxy="" claude

Claude works.
I should note that I tried NO_PROXY="*", and it doesn't work.

What Should Happen?

Claude should be able to reach my base URL without a proxy, just like it does when we pass proxy arguments with the command.

Error Messages/Logs

❯ bonjour
⎿  API Error: Connection error. (after several minutes)

Steps to Reproduce

Steps to Reproduce

Prerequisites:

  • A proxy is configured in your system bashrc (e.g., export https_proxy=...)
  • Your API URL works without the proxy (e.g., curl --proxy "" https://<base-url> succeeds)

Test 1 - settings.json (FAILS):

{
  "env": {
    "ANTHROPIC_BASE_URL": "<base-url>",
    "https_proxy": "",
    "HTTP_PROXY": "",
    "http_proxy": "",
    "HTTPS_PROXY": ""
  }
}

Result: Claude blocks

Test 2 - CLI (WORKS):

HTTPS_PROXY="" HTTP_PROXY="" https_proxy="" http_proxy="" claude

Result: Claude connects successfully

Expected: Both methods should work the same way.

Claude Model

None

Is this a regression?

I don't know

Last Working Version

No response

Claude Code Version

2.1.25

Platform

Other

Operating System

Other Linux

Terminal/Shell

WSL (Windows Subsystem for Linux)

Additional Information

❯ /doctor
Diagnostics └ Currently running: native (2.1.25)
└ Path: /home//.local/share/claude/versions/2.1.25
└ Invoked: /home//.local/share/claude/versions/2.1.25
└ Config install method: native
└ Search: OK (bundled)

Updates
└ Auto-updates: enabled
└ Auto-update channel: latest
└ Stable version: 2.1.7
└ Latest version: 2.1.25

Version Locks
└ 2.1.25: PID 180758 (running)

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:apiarea:corebugSomething isn't workinghas reproHas detailed reproduction stepsplatform:linuxIssue specifically occurs on LinuxstaleIssue is inactive

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions