RadianDevCore - AI - claude-code-container¶
Launch Claude Code inside a Debian container in the current folder
Documentation: https://radiandevcore.gitlab.io/ai/claude-code-container
- Copyright: 2026 Adrian DC
- Project: RadianDevCore - AI
- Maintainer: Adrian DC
Table of contents
Installation¶
-
Dependencies:
mise-en-place: https://mise.jdx.dev/installing-mise.htmlpodmanordocker: Container engine (podmanis preferred if available)
-
Install
claude-code-containerglobally withmise-en-place:
Examples¶
# Launch Claude Code in the current folder
claude-code-container
# Continue the last conversation, with the current folder mounted read-only
claude-code-container --read-only --continue
# Mount another folder and pass a host environment variable
claude-code-container -v ../shared-library -e GITLAB_TOKEN
Usage¶
usage: claude-code-container [-h] [--version] [--update] [--build] [--read-only] [-e VAR[=VALUE]] [-v PATH[:ro]]
[--shell | --upgrade | --cost] [--] [CLAUDE_ARGS ...]
claude-code-container: Launch Claude Code inside a container in the current folder
internal arguments:
-h, --help # Show this help message
--version # Show the current version
--update # Update to the latest release
modes arguments:
--shell # Launch a 'bash' shell in the container instead
--upgrade # Upgrade Claude Code with 'mise' in the container volume
--cost # Show the Claude Code '/cost' usage summary and exit
container arguments:
--build # Rebuild the container image with logs (pull base image, no cache)
--read-only # Mount the current folder read-only in the container
-e, --env VAR[=VALUE] # Set a container environment variable
# (host value without VALUE)
-v, --volume PATH[:ro] # Mount a host folder or file at its real host path and symlink path
# (read-only with ':ro')
positional arguments:
-- # Positional arguments separator (recommended)
CLAUDE_ARGS # Arguments passed to Claude Code
environment variables:
CLAUDE_CODE_CONTAINER_ENGINE # Container engine (default: podman, else docker)
CLAUDE_CODE_CONTAINER_IMAGE # Container image (default: claude-code-container:local)
CLAUDE_CODE_CONTAINER_VOLUME # User home volume (default: claude-code-container)
CLAUDE_CODE_CONTAINER_NETWORK # Container network (default: host, or bridge)
CLAUDE_CODE_CONTAINER_GITCONFIG # Git configuration mounted read-only (default: 0, 1 for '~/.gitconfig', or a path)
CLAUDE_CODE_CONTAINER_GITDIRS # Git submodules and worktrees folders mounted (default: 1, 0 to disable)
CLAUDE_CODE_CONTAINER_HOSTHOME # Home folder paths mounted under '/home/host' (default: 1, 0 for real paths)
CLAUDE_CODE_CONTAINER_HISTORY_DAYS # Claude Code history retention days (default: 7, 0 for Claude Code defaults)
CLAUDE_CODE_EXPERIMENTAL_CODE_MODE # Claude Code experimental code mode (default: 1)
Container details¶
Image and volume¶
- Image: built locally on first use, from
debian:13-slimwithmise(installed withextrepo) - Claude Code: installed on first use with
mise use -g claude@latest - Volume:
claude-code-containerkeeps/home/claude(login, configurations,miseinstallations) - Project: the current folder is mounted at the same path, with files owned by the host user
- Mounts:
-vpaths keep their host path, symlinks are also mounted at their own path - Home paths: paths inside the host home folder are mounted under a fake
/home/hostfolder - Launch summary: mounts, network, security and privacy details are shown on each launch
Security¶
- Only the current folder and the volume are accessible, not the host home folder
- Paths inside the host home folder are mounted under
/home/host(like~/projects/appat/home/host/projects/app), to hide the host user name and home path from the container- Git worktrees with absolute
.gitreferences outside the current folder still use their real host paths - Claude Code sessions are stored per path, so previous sessions of such folders are not listed after enabling it
- Git worktrees with absolute
- Refused folders, also through symlinks, to avoid exposing the whole host:
- The
~folder and its parents (like/) - System folders (like
/tmpor/etc) - Runtime folders (like
/runor/dev)
- The
- No privileges escalation, all capabilities dropped once the entrypoint switches to the host user, and a processes limit
- Folders on FUSE mounts (like
sshfs) require theallow_otheroption withdocker
Network¶
- The host network is used by default, for reliable DNS (like with VPN resolvers)
- It also exposes the host
localhostservices, useCLAUDE_CODE_CONTAINER_NETWORK=bridgeto isolate the container
Git¶
- The host Git configuration is not mounted by default, for privacy
- Git submodules and worktrees folders (
.gitfiles pointing outside the current folder) are mounted at their real host paths (read-only with--read-only)
Privacy¶
- Telemetry, error reporting,
/bugcommand and feedback surveys are disabled by default - Conversations history is kept for 7 days by default
Environment variables¶
| Variable | Default | Usage |
|---|---|---|
CLAUDE_CODE_CONTAINER_NETWORK | host | bridge to isolate the container network |
CLAUDE_CODE_CONTAINER_GITCONFIG | 0 | 1 for ~/.gitconfig, or a path (like a dedicated identity), mounted as /etc/gitconfig |
CLAUDE_CODE_CONTAINER_GITDIRS | 1 | 0 to not mount Git submodules and worktrees folders |
CLAUDE_CODE_CONTAINER_HOSTHOME | 1 | 0 to mount home folder paths at their real host paths instead of /home/host |
CLAUDE_CODE_CONTAINER_HISTORY_DAYS | 7 | Conversations history days, 0 for Claude Code defaults |
CLAUDE_CODE_EXPERIMENTAL_CODE_MODE | 1 | 0 to disable the experimental code mode |
DISABLE_TELEMETRY | 1 | 0 to enable telemetry |
DISABLE_ERROR_REPORTING | 1 | 0 to enable error reporting |
DISABLE_BUG_COMMAND | 1 | 0 to enable the /bug command |
CLAUDE_CODE_DISABLE_FEEDBACK_SURVEY | 1 | 0 to enable feedback surveys |
CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC | unset | Passed to the container when set on the host |
NO_COLOR | unset | Disable the launch summary colors (only colored on terminals) |
Updates¶
- Show
claude-code-containerversion :
- Upgrade Claude Code with
misein the container volume :
- Rebuild the container image with logs (latest Debian 13 packages and
mise) :
- Update
claude-code-containerto the latest release :
- Reset the Claude Code login and installations volume :
Development¶
- Use
claude-code-containerfrom sources withmise-en-place:
{
git clone https://gitlab.com/RadianDevCore/ai/claude-code-container.git
cd ./claude-code-container/
mise install
mise use -g "gitlab:RadianDevCore/ai/claude-code-container@path:${PWD}"
}
- Build and test the release archive :
- Restore
claude-code-containerlatest release :
References¶
- Claude Code: Agentic coding tool
- gcil: Launch .gitlab-ci.yml jobs locally
- git-cliff: CHANGELOG generator
- mise-en-place: Development tools and versions manager