Install Claude Code in a Project Container#

Follow these instructions to install Claude Code in an AI Workbench project container to persist it across container restarts.

In this quickstart, you will: - Install Claude Code in the project container via the postBuild.bash script - (Optionally) Add Claude Code to the JupyterLab Launcher - Start the container and verify Claude Code was installed

Prerequisites#

To do this quickstart you should already have:

  1. The AI Workbench Desktop Client installed locally in full local mode (or an existing remote location)

  2. An existing project to add Claude Code to

  3. An Anthropic account with an API key or authentication method ready

Add Claude Code to the Build Script#

Step One: Open the postBuild.bash file in a file editor.
  1. Select Project Tab > File Browser > Option Dots > Edit File for postBuild.bash

Step Two: Add dependency and installation commands to the script.

Add the following to the script.

# Install apt packages used by Claude Code features
# bubblewrap: process sandbox (reduced capability in containers)
# socat: proxied network access for domain allowlists
# jq: useful for writing hooks directly in settings.json
sudo apt-get update && sudo apt-get install -y jq bubblewrap socat

# Install Claude Code
curl -fsSL https://claude.ai/install.sh | bash

(Optional) Add Claude Code to the JupyterLab Launcher#

Build and Verify#

Step One: Build the container.
  1. Select Project Tab > Project Container > Build

  2. Wait for the build to complete

Step Two: Open a terminal in the container.
  1. Open JupyterLab or attach a terminal to the running container

Step Three: Verify Claude Code is installed.
  1. Run claude --version in the terminal

  2. Run claude to start a session and authenticate when prompted

Success: Claude Code is installed in the container image and available on every container start.

Next Steps#