Quick Setup: Multiple Claude Code Authentication Profiles
Tired of manually switching environment variables every time you want to use a different Claude Code authentication method? Same here! Let me show you a super clean way to set up profiles that you can

Why bother with profiles?
I use different auth methods depending on what I'm working on:
API Key: Personal/Company projects using Anthropic credits
AWS Bedrock: Work stuff through company AWS
Pro Account: Quick experiments with my Claude Pro subscription
Instead of juggling env vars, now I just type claude-pro
, claude-aws
, or claude-api
and boom - done!
Steps
1. Make a folder for profiles
First, create a directory to store all your profile configurations:
mkdir -p ~/.claude-profiles
2. Create environment files
These files tell each profile which credentials to use. Create three files:
~/.claude-profiles/api.env
# Clear any Claude session tokens if they exist
unset CLAUDE_SESSION_TOKEN
# API Key profile
export ANTHROPIC_API_KEY="your_anthropic_api_key_here"
unset CLAUDE_CODE_USE_BEDROCK
unset AWS_ACCESS_KEY_ID
unset AWS_SECRET_ACCESS_KEY
unset AWS_REGION
~/.claude-profiles/aws.env
# AWS Bedrock profile
unset CLAUDE_SESSION_TOKEN
unset ANTHROPIC_API_KEY
# Using AWS Profile (use `aws sso login --profile "profile_name"`)
export AWS_PROFILE="your_aws_profile_name"
export CLAUDE_CODE_USE_BEDROCK="true"
export ANTHROPIC_MODEL="us.anthropic.claude-3-7-sonnet-20250219-v1:0"
export ANTHROPIC_SMALL_FAST_MODEL="us.anthropic.claude-3-5-haiku-20241022-v1:0"
# AWS credentials for Bedrock (In case you use static credentials)
# export AWS_ACCESS_KEY_ID="your_aws_access_key_id"
# export AWS_SECRET_ACCESS_KEY="your_access_key"
# export AWS_SESSION_TOKEN="your_aws_session_token"
# export AWS_REGION="your_aws_region"
~/.claude-profiles/pro.env
# Pro account profile - clear all API credentials
unset CLAUDE_SESSION_TOKEN
unset ANTHROPIC_API_KEY
unset CLAUDE_CODE_USE_BEDROCK
unset AWS_ACCESS_KEY_ID
unset AWS_SECRET_ACCESS_KEY
unset AWS_REGION
3. Create the magic wrapper scripts
These scripts load the right environment and launch Claude Code:
~/.claude-profiles/launch-api.sh
#!/bin/bash
source ~/.claude-profiles/api.env
echo "🔑 Launching Claude Code with Anthropic API Key authentication..."
claude "$@"
~/.claude-profiles/launch-aws.sh
#!/bin/bash
source ~/.claude-profiles/aws.env
echo "☁️ Launching Claude Code with AWS Bedrock authentication..."
claude "$@"
~/.claude-profiles/launch-pro.sh
#!/bin/bash
source ~/.claude-profiles/pro.env
echo "👤 Launching Claude Code with Pro account authentication..."
claude "$@"
Don't forget to make them executable:
chmod +x ~/.claude-profiles/*.sh
4. Add some sweet aliases
Add these to your shell config file (I’m using zsh, so I edit ~/.zshrc, your case maybe the ~/.bashrc file):
# Claude Code profile aliases
alias claude='~/.claude-profiles/launch-api.sh'
alias claude-api='~/.claude-profiles/launch-api.sh'
alias claude-pro='~/.claude-profiles/launch-pro.sh'
alias claude-aws='~/.claude-profiles/launch-aws.sh'
5. Reload and you're done!
# For Bash
source ~/.bashrc
# For Zsh
source ~/.zshrc
How to use it
Super simple! Just use these commands:
# Use API key (default)
claude
# Use API key (explicit)
claude-api
# Use Pro account
claude-pro
# Use AWS Bedrock
claude-aws
All the usual Claude Code arguments work too:
claude-pro --help
claude-aws --verbose
claude-api --config myconfig.json
Quick notes
API Key setup:
Replace
"your_anthropic_api_key_here"
with your actual key
AWS Bedrock setup:
Make sure AWS CLI is configured:
aws sso login --profile "your_profile_name"
Update the model names if needed
Uncomment and update the static credentials if you're not using AWS profiles
Pro Account setup:
Log in to Claude Code with your Anthropic account first (just run
claude-code
normally once)After that initial login,
claude-pro
will work perfectly
That's it!
Now you can switch between different Claude Code auth methods without thinking about it. The setup takes 5 minutes but saves you tons of time later. Plus, it just feels so much cleaner than managing env vars manually.
Happy coding! 🚀