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:
- The AI Workbench Desktop Client installed locally in full local mode (or an existing remote location)
- An existing project to add Claude Code to
- 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.
- 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.
(Optional) Add Claude Code to the JupyterLab Launcher
Build and Verify
Step One: Build the container.
- Select Project Tab > Project Container > Build
- Wait for the build to complete
Step Two: Open a terminal in the container.
- Open JupyterLab or attach a terminal to the running container
Step Three: Verify Claude Code is installed.
- Run
claude --versionin the terminal - Run
claudeto start a session and authenticate when prompted
Success: Claude Code is installed in the container image and available on every container start.
Next Steps
- Configure Claude Code Sandboxing in a Project Container - Create a sandbox configuration repository for Claude Code
- Sandboxing Agents with AI Workbench - Background on how agent sandboxing works in AI Workbench