Skip to content

Instantly share code, notes, and snippets.

@andrew-magic
Last active June 26, 2025 18:04
Show Gist options
  • Save andrew-magic/7ae9c56cee120cf3c2cebcece42b7b06 to your computer and use it in GitHub Desktop.
Save andrew-magic/7ae9c56cee120cf3c2cebcece42b7b06 to your computer and use it in GitHub Desktop.

Claude Code Setup Guide

This guide will help you set up Claude Code for your development environment.

Prerequisites

  • Node.js 18 or higher
  • npm 8 or higher
  • AWS credentials with access to Bedrock

Installation Steps

  1. Install Claude Code globally:
npm install -g @anthropic-ai/claude-code
  1. Create the Claude Code configuration directory and settings file:
mkdir -p ~/.claude && touch ~/.claude/settings.json
  1. 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"
    }
}
  1. 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.

MCP Servers Setup

Claude Code supports Model Control Protocol (MCP) servers that extend its capabilities. Here's how to add the Context7 MCP server:

  1. 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.

  1. Once installed, you can use Context7 to access documentation within claude-code sessions.

Verifying Your Installation

To verify your installation is working correctly:

claude --version

This should display the installed version of Claude Code.

Basic Usage

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

Using Context7 MCP

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.

Troubleshooting

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:

  1. Verify your AWS credentials with:
    aws sts get-caller-identity
  2. If using Granted, ensure you've properly assumed a role with:
    assume <profile-name>
    aws sts get-caller-identity
  3. Confirm you have the necessary Bedrock permissions in your IAM policy
  4. Check that you're using the correct AWS region in your settings.json

More Information

For additional documentation, visit: https://docs.anthropic.com/en/docs/claude-code

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment