[BUG] Claude Code Not Switching to AWS Bedrock

Status Fixed / completed
Maintainer reply ✓ Yes — ant-kurt
Activity 6 comments · opened Aug 12, 2025 · closed Aug 12, 2025
💡 Likely answer: A maintainer (ant-kurt, collaborator) responded on this thread — see the highlighted reply below.

Environment

  • Platform (select one):
  • [ ] Anthropic API
  • [x] AWS Bedrock
  • [ ] Google Vertex AI
  • [ ] Other: <!-- specify -->
  • Claude CLI version: 1.0.76 (Claude Code)
  • Operating System: macOS 15.6
  • Terminal: Panic Prompt / Panic Nova + fish shell

Bug Description

Claude Code Will Not Switch to AWS Bedrock

Steps to Reproduce

mzagaja@TED-MBP-MZAGAJA ~/D/ai-reference> claude --version
1.0.76 (Claude Code)
mzagaja@TED-MBP-MZAGAJA ~/D/ai-reference> echo $CLAUDE_CODE_USE_BEDROCK
1
mzagaja@TED-MBP-MZAGAJA ~/D/ai-reference> echo $AWS_REGION
us-east-1
mzagaja@TED-MBP-MZAGAJA ~/D/ai-reference> claude -p 'Are you using AWS bedrock?'
No, I'm running through Anthropic's Claude API, not AWS Bedrock. Claude Code does support AWS Bedrock integration if you want to configure it to use Bedrock instead.

Expected Behavior

I expected Claude Code to use AWS Bedrock after set CLAUDE_CODE_USE_BEDROCK 1.

Actual Behavior

Claude Code used my Anthropic account.

View original on GitHub ↗

6 Comments

github-actions[bot] · 1 year ago

Found 3 possible duplicate issues:

  1. https://github.com/anthropics/claude-code/issues/64
  2. https://github.com/anthropics/claude-code/issues/257
  3. https://github.com/anthropics/claude-code/issues/838

This issue will be automatically closed as a duplicate in 3 days.

  • If your issue is a duplicate, please close it and 👍 the existing issue instead
  • To prevent auto-closure, add a comment or 👎 this comment

🤖 Generated with Claude Code

ant-kurt collaborator · 1 year ago

Check /status to see if the Bedrock connection info is displayed. Also consider running with ANTHROPIC_LOG=debug to confirm your requests are indeed hitting Anthropic and not Bedrock.

mzagaja · 1 year ago

Appreciate the hint on /status

 Claude Code v1.0.76
  L Session ID: 8f81ad23-7051-4520-9333-696f19a5cbc7

 Working Directory 
  L /Users/mzagaja/Developer/ai-reference

 Account • /login
  L Login Method: Claude Max Account
  L Organization: matthew@zagaja.com's Organization
  L Email: matthew@zagaja.com

 Memory • /memory
  L user: ~/.claude/CLAUDE.md

 Model • /model
  L sonnet (claude-sonnet-4-20250514)

I would say it is likely this has to do with Claude Code not properly seeing/inspecting the environment in fish shell. If I switch to zsh:

mzagaja@TED-MBP-MZAGAJA ~/D/ai-reference> zsh
mzagaja@TED-MBP-MZAGAJA ai-reference % export CLAUDE_CODE_USE_BEDROCK=1
mzagaja@TED-MBP-MZAGAJA ai-reference % export AWS_REGION='us-east-1'
mzagaja@TED-MBP-MZAGAJA ai-reference % claude
╭───────────────────────────────────────────────────╮
│ ✻ Welcome to Claude Code!                         │
│                                                   │
│   /help for help, /status for your current setup  │
│                                                   │
│   cwd: /Users/mzagaja/Developer/ai-reference      │
╰───────────────────────────────────────────────────╯

 ※ Tip: Use /agents to create context-efficient experts for specific tasks. Eg. Code Reviewer, Software Architect, Data Scientist

 Claude Code v1.0.76
  L Session ID: 00983734-55cf-4399-b90d-6533e25976a5

 Working Directory 
  L /Users/mzagaja/Developer/ai-reference

 API Configuration 
  L API Provider: AWS Bedrock
  L AWS Region: us-east-1

 Memory • /memory
  L user: ~/.claude/CLAUDE.md

 Model • /model
  L sonnet (us.anthropic.claude-sonnet-4-20250514-v1:0)

It works. This was not broken the other day, so I think its potentially a regression in newest update.

ant-kurt collaborator · 1 year ago

Just double-checking, can you confirm that you exported your env var via set -x CLAUDE_CODE_USE_BEDROCK 1? We don't do anything special around environment variable loading, which typically means the variable is not exported / visible to child processes like claude.

Also, consider using a settings.json.

mzagaja · 1 year ago

Ah, I was merely doing set CLAUDE_CODE_USE_BEDROCK 1 so -x seems to be significant here. Thanks for having me check that.

github-actions[bot] · 1 year ago

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.