Skip to content

How to Connect the Claude Code to AWS Bedrock via the terminal

This guide shows how to configure the terminal instance of Claude Code to use your secure AWS Bedrock endpoint instead of the public Anthropic API.

  • Node version 20.19 or higher
  • An AWS account
  • Access to Claude models (e.g., Claude 4.5 Sonnet ) enabled in your AWS Bedrock console
  • AWS credentials configured locally. The simplest method is to install the AWS CLI and run aws configure but check with your IT/infrastructure team. Claude will automatically find these credentials once configured to use Bedrock.

Step 1: Install the Claude Code for VS code Extension

Section titled “Step 1: Install the Claude Code for VS code Extension”
  1. Open your terminal
  2. Run npm install -g @anthropic-ai/claude-code

Step 2: Add the Bedrock Configuration to Claude Code settings.json

Section titled “Step 2: Add the Bedrock Configuration to Claude Code settings.json”

⚠️ Please validate that your AWS credentials are configured before proceeding ⚠️

  1. Navigate to ~/.claude and create a new file: settings.json
  2. Add the following JSON block to your settings.json file
~/.claude/settings.json
{
"env": {
"CLAUDE_CODE_USE_BEDROCK": "1",
"AWS_REGION": "us-west-2"
}
}
  1. Reload or restart the terminal to apply the new settings.
  2. Initilize Claude Code with the command claude
  3. Claude Code should initialize without asking for an API key or login.
  4. In the chat input, use the command “/Status” to validate your connected to AWS Bedrock. It should look something like this: claude successfully configured in the terminal
  5. Finally, press esc to revert back to the chat interface. Try a prompt out to validated the connection.

If you get a response, you are successfully connected. Claude is now using your local AWS credentials to send all requests securely to your AWS Bedrock endpoint.