This guide will help you set up Claude Code for your development environment.
- Node.js 18 or higher
- npm 8 or higher
- AWS credentials with access to Bedrock
- Install Claude Code globally:
npm install -g @anthropic-ai/claude-code
- Create the Claude Code configuration directory and settings file:
mkdir -p ~/.claude && touch ~/.claude/settings.json
- Open the settings file and add the following configuration:
{
"env": {
"CLAUDE_CODE_USE_BEDROCK":"true",
"CLAUDE_CODE_BEDROCK_REGION":"us-west-2",
"CLAUDE_CODE_BEDROCK_MODEL":"anthropic.claude-sonnet-4-20250514-v1:0"
}
}
- If you use Granted for AWS SSO login, use the following to assume a role before starting Claude Code:
assume Ops-Infra/Admin
# Then run the claude command again, you will be auth'd into aws to use bedrock!
claude
This will ensure Claude Code has the proper AWS credentials from your SSO session.
Claude Code supports Model Control Protocol (MCP) servers that extend its capabilities. Here's how to add the Context7 MCP server:
- Install the Context7 MCP server:
claude mcp add context7 -- npx -y @upstash/context7-mcp
This command should be run from your terminal, outside of a claude-code session.
- Once installed, you can use Context7 to access documentation within claude-code sessions.
To verify your installation is working correctly:
claude --version
This should display the installed version of Claude Code.
Start a new Claude Code session in your project directory:
cd /path/to/your/project
claude
Common Claude Code commands:
/help
- Display help information/init
- Initialize Claude Code for your codebase/memory
- Manage conversation memory/resume
- Resume a previous session/image
- Share an image with Claude
To use Context7 for accessing documentation within claude-code, try a prompt like:
Get the AWS CDK python docs for ECS. I need to make some improvements to my CDK stack, but use context7 mcp and create the ECS.md in a new directory called ~/aws-cdk-docs/
Claude will use Context7 to fetch the relevant AWS CDK documentation and save it to the specified file. This can be used in future requests to get up-to-date documentation that is stored locally and can be viewed locally.
If you have any issues installing and accessing, make sure your npm global installation is active. If its not, try setting this up:
# Create a global npm directory and set it in path.
npm list -g --depth=0 > ~/npm-global-packages.txt
mkdir -p ~/.npm-global
npm config set prefix ~/.npm-global
echo 'export PATH=~/.npm-global/bin:$PATH' >> ~/.zshrc
source ~/.zshrc
npm install -g @anthropic-ai/claude-code
npm -g list
which claude
If you're having trouble with Bedrock access:
- Verify your AWS credentials with:
aws sts get-caller-identity
- If using Granted, ensure you've properly assumed a role with:
assume <profile-name> aws sts get-caller-identity
- Confirm you have the necessary Bedrock permissions in your IAM policy
- Check that you're using the correct AWS region in your settings.json
For additional documentation, visit: https://docs.anthropic.com/en/docs/claude-code