[BUG] Proxy configuration ignored when CLAUDE_CODE_USE_BEDROCK=1
Environment
- Platform (select one):
- [ ] Anthropic API
- [x] AWS Bedrock
- [ ] Google Vertex AI
- [ ] Other: <!-- specify -->
- Claude CLI version:
1.0.35 (Claude Code) - Operating System:
Debian 12(bookworm) - Terminal:
zsh on vscode terminal
Bug Description
<!-- A clear and concise description of the bug -->
When using the Amazon Bedrock API, proxy configurations such as https_proxy and http_proxy are ignored.
In our environment, direct internet access is not available, so Claude Code should use the proxy server to connect to the Amazon Bedrock API.
Steps to Reproduce
- Set the following environment variables:
https_proxy:http://proxy:3128http_proxy:http://proxy:3128CLAUDE_CODE_USE_BEDROCK:1AWS_REGION:us-east-1
- Launch Claude Code from the command line:
$ claude - Send a prompt.
Expected Behavior
<!-- What you expected to happen -->
Sending a prompt should succeed, and the response should be returned from the Amazon Bedrock API.
Actual Behavior
Sending a prompt returns an error
> test prompt
⎿ API Error: AggregateError
strace.log shows the strace output from the above process.
It shows that the Claude Code process tries the following without using the proxy server:
- Queries
portal.sso.us-east-1.amazonaws.comto the DNS server. - Attempts to connect to the following IP addresses (failed).
- 54.224.185.190
- 34.200.27.237
- 184.73.66.185
Additional Context
<!-- Add any other context about the problem here, such as screenshots, logs, etc. -->
/statusreports that theproxyconfig is set: status.log- If we unset
CLAUDE_CODE_USE_BEDROCKand log in with a Claude account, it successfully connects to the Anthropic API using our proxy configuration. - PoC repo is available at https://github.com/nozaq/cc-poc.
Please let me know if you need more information.
This issue has 5 comments on GitHub. Read the full discussion on GitHub ↗