
Getting Started with Claude Code on Amazon SageMaker AI Studio JupyterLab
A step-by-step guide to installing and configuring Claude Code in Amazon SageMaker AI Studio JupyterLab, enabling AI-powered coding assistance directly in your ML development environment.
As machine learning practitioners, we spend significant time in Amazon SageMaker AI Studio JupyterLab: writing code, building models, and iterating on experiments. What if you could bring an AI-powered coding assistant directly into that environment to accelerate your workflow?
Claude Code is Anthropic's official CLI tool that brings agentic coding capabilities to your terminal. It can help you write, debug, and refactor code, navigate complex codebases, and automate repetitive tasks — all through natural language interaction. By integrating Claude Code with Amazon SageMaker AI Studio JupyterLab and powering it through Amazon Bedrock, you get AI-assisted development that stays within your AWS environment and leverages your existing security and access controls.
In this post, we walk you through installing and configuring Claude Code on Amazon SageMaker AI Studio JupyterLab (SageMaker image version 4.3 or latest), so you can start using AI-powered coding assistance alongside your ML workflows.
Prerequisites
Before you begin, ensure you have the following:
- An AWS account with access to Amazon SageMaker AI Studio
- A SageMaker AI Studio domain with JupyterLab space running image version 4.3 or later
- Access to Amazon Bedrock Claude models in your AWS Region (specifically
claude-sonnet-4-5) - Appropriate IAM permissions for Bedrock model invocation
Setting Up Claude Code in SageMaker AI Studio JupyterLab
Step 1: Open your JupyterLab terminal
Launch your SageMaker AI Studio JupyterLab space and open a new terminal from the Launcher.
Step 2: Install Claude Code ACP
In the terminal, install the Claude Code Agent Client Protocol (ACP) package globally using npm:
1
npm install -g @agentclientprotocol/claude-agent-acpStep 3: Install the Claude Code CLI
Run the official Claude Code installation script:
1
curl -fsSL https://claude.ai/install.sh | bashNote: We are using the official Claude CLI . This installs the latest version of Claude Code to your local environment.
Step 4: Add Claude Code to your PATH
Add the Claude Code CLI directory to your system's PATH environment variable so you can run it from any location:
1
echo 'export PATH="$HOME/.local/bin:$PATH"' >> ~/.bashrc && source ~/.bashrcStep 5: Configure AWS plugins for Claude Code
Configure Claude Code to use AWS plugins including the SageMaker AI plugin:
1
2
claude plugins marketplace add awslabs/agent-plugins
claude plugins install sagemaker-ai@agent-plugins-for-awsFor more details on available AWS plugins, see the AWS Labs agent-plugins repository .
Step 6: Configure Claude Code to use Amazon Bedrock
Update the Claude Code settings file at
~/.claude/settings.json to enable Amazon Bedrock as the model provider by adding the json block:Important: If asettings.jsonfile already exists at~/.claude/settings.json, download it first and add the"env"key-value pair to the existing configuration before uploading the updated file
1
2
3
4
5
{
"env": {
"CLAUDE_CODE_USE_BEDROCK": "1"
}
}To create this file in your SageMaker JupyterLab environment, you can either:
- Create locally and upload — Create the
settings.jsonfile on your local machine and upload it to your SageMaker JupyterLab using the file upload feature, placing it at~/.claude/settings.json. - Create directly in the terminal — Run the following commands:
1
2
3
4
5
6
7
8
mkdir -p ~/.claude
cat > ~/.claude/settings.json << 'EOF'
{
"env": {
"CLAUDE_CODE_USE_BEDROCK": "1"
}
}
EOFAlternative: Claude login — You can also use Claude Code with your Anthropic Claude login (viaclaude /login) without configuring AWS Bedrock
Step 7: Request Amazon Bedrock model access
To use Claude Code with Amazon Bedrock, you need access to the
claude-sonnet-4-5 model. Request access through the Amazon Bedrock console by following the AWS Bedrock model access documentation .Step 8: Restart your JupyterLab space
Restart the space to ensure all environment changes take effect. You can do this by running the following command in the terminal:
1
restart-jupyter-serverNote:Restarting the space will terminate any active kernels and discard unsaved in-memory state. Save your work before proceeding.
Alternatively, you can restart the space via the SageMaker AI Studio UI.
Using Claude Code in JupyterLab
After restarting, open a new JupyterLab chat and launch Claude Code with the prompt:
1
@claude Hi
ClaudeCode
You can now interact with Claude directly in your SageMaker AI JupyterLab. Try asking it to:
- What skills do I have and explain the skills?
- Help fine-tune LLMs on SageMaker.
- Explain or refactor existing code in your workspace
- Generate boilerplate for SageMaker training jobs or processing scripts
- Debug errors in your notebooks or Python scripts
- Navigate and summarize your project structure
Conclusion
By integrating Claude Code into your Amazon SageMaker AI Studio JupyterLab environment, you bring AI-powered coding assistance directly into your ML development workflow — without leaving your familiar workspace. Powered by Amazon Bedrock, this setup keeps model invocations within your AWS account, leveraging your existing IAM permissions and security controls.
This approach complements other AI-assisted capabilities in SageMaker AI Studio using agent skills. For detailed example of how AI-guided workflows with agent skills simplify complex ML tasks, see Agentic Model Customization: Simplifying Fine-Tuning with AI-Guided Workflows in Amazon SageMaker AI .
Enjoyed reading this content? Let the author know!
Your likes, comments, shares, and saves help creators reach more builders.
Loading recommendations
Loading article