Claude Code is distributed as an npm package and requires Node.js 18+. If you are on an older version, upgrade via your system package manager or a version manager (see below).
On macOS, Claude Code stores OAuth tokens in the macOS Keychain via security CLI. This is automatic — no extra setup is required. If you see a keychain access prompt the first time you log in, click Allow.
If you have a Claude.ai Pro or Team subscription, you can authenticate with your account directly.
1
Run claude
claude
2
Select Claude.ai login
When prompted, choose Claude.ai (not API key). Claude Code will open a browser window.
3
Complete the OAuth flow
Sign in to claude.ai and authorize Claude Code. Return to the terminal when done.
Your OAuth tokens are stored in the system keychain and refreshed automatically. You will not need to re-authenticate unless you explicitly log out.To log out:
Access Claude through AWS Bedrock using your existing AWS credentials:
export CLAUDE_CODE_USE_BEDROCK=1claude
Claude Code uses the AWS SDK’s standard credential chain — environment variables, ~/.aws/credentials, IAM roles, and so on. Make sure the IAM identity you are using has permission to invoke the Claude model on Bedrock.Additional environment variables for Bedrock:
Variable
Purpose
AWS_PROFILE
Named AWS profile to use
AWS_REGION
AWS region for Bedrock requests
CLAUDE_CODE_SKIP_BEDROCK_AUTH
Skip credential prefetch (useful in some IAM role setups)
Run the built-in diagnostics command to check for common problems:
claude doctor
This checks Node.js version, authentication state, keychain access, network connectivity, and MCP server configuration. Any issues are printed with suggested fixes.