Run Claude Code CLI in a Podman container with tmux, GitHub access, and persistent config
Project description
Claude Code in Podman
Run Claude Code CLI inside a Podman container with GitHub access, persistent configuration, and a tmux session that lets you switch between Claude and a regular terminal.
Why?
Claude Code runs as a full CLI agent that can read, edit, and execute code in your project. Running it inside a container provides isolation — Claude operates in a sandboxed environment rather than directly on your host system.
The container includes tmux so you can open a shell alongside Claude (e.g. to run tests, inspect files, or use git) without leaving the container.
What's in the box
| File | Purpose |
|---|---|
src/claude_podman/cli.py |
CLI entry point — builds the image and launches the container |
src/claude_podman/Dockerfile |
Container image definition (see below for installed packages) |
src/claude_podman/entrypoint.sh |
Starts Claude inside a tmux session |
pyproject.toml |
Python package definition |
DESIGN.md |
Original design requirements |
Prerequisites
- Podman installed
- Python 3.10+
- A Claude Code account (you'll authenticate on first run)
- An SSH key for GitHub access (optional)
Quick start
Run from PyPI (no clone needed)
uvx claude-podman \
--workspace ~/my-project \
--github-key ~/.ssh/id_ed25519 \
--claude-config ./claude-auth
Run directly from GitHub (no clone needed)
Not recommended - better check what you are running first!
uvx --from git+https://github.com/serge-m/claude-podman claude-podman \
--workspace ~/my-project \
--github-key ~/.ssh/id_ed25519 \
--claude-config ./claude-auth
Run from a local clone
git clone https://github.com/serge-m/claude-podman.git
cd claude-podman
uv run claude-podman \
--workspace ~/my-project \
--github-key ~/.ssh/id_ed25519 \
--claude-config ./claude-auth
Arguments
| Argument | Description |
|---|---|
--workspace |
Path to your project directory (mounted as /workspace in the container) |
--github-key |
(optional) Path to your SSH private key for GitHub (mounted read-only as /root/.ssh/id_ed25519 inside the container) |
--claude-config |
Directory for Claude's persistent config (mounted as ~/.claude). Created automatically if it doesn't exist. Contains auth tokens, session history, etc. |
--verbose |
Enable debug logging |
Using tmux inside the container
Claude starts in a tmux session. Standard tmux keybindings apply:
| Keys | Action |
|---|---|
Ctrl-b c |
Open a new terminal window |
Ctrl-b n / Ctrl-b p |
Switch to next / previous window |
Ctrl-b d |
Detach from tmux (exits the container) |
Ctrl-b 0-9 |
Switch to window by number |
What's installed in the container
| Package | Why |
|---|---|
git, gh |
Version control and GitHub CLI |
openssh-client |
SSH for GitHub push/pull |
tmux |
Terminal multiplexer — run Claude and a shell side by side |
curl, ca-certificates |
Fetching resources over HTTPS |
mc, vim |
File management and text editing |
build-essential |
C/C++ compiler toolchain (needed by some npm/pip packages) |
python3-venv |
Python virtual environments |
zsh |
Default shell |
nodejs, npm |
Node.js runtime (required by Claude Code) |
@anthropic-ai/claude-code |
Claude Code CLI (installed via npm) |
GitHub's SSH host keys are pre-populated at build time via ssh-keyscan, so git operations won't prompt for host verification.
How it works
claude-podmanresolves all paths, reads your git identity from the host, extracts the bundled Dockerfile from the package, builds the container image, and runs it with the appropriate volume mounts.entrypoint.shlaunches Claude inside a tmux session.- Your workspace is bind-mounted into the container, so changes Claude makes are reflected on your host filesystem immediately.
Persistent config
The --claude-config directory stores Claude's authentication and session data. Point this at the same directory across runs to avoid re-authenticating each time. A .claude.json file is automatically created inside it if missing.
Note: The config directory contains auth credentials. Don't commit it to version control.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file claude_podman-0.2.0.tar.gz.
File metadata
- Download URL: claude_podman-0.2.0.tar.gz
- Upload date:
- Size: 5.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f9080aa5c9e5a3b3caee7a66e50307a7bd387380ca604f1c123154b209bfbdfe
|
|
| MD5 |
a0089f1644f84b067f503bedabf703df
|
|
| BLAKE2b-256 |
8c2dcdff9387b00d4214408f5f19575467d761fc4de5d338bb1a00f166836c9e
|
Provenance
The following attestation bundles were made for claude_podman-0.2.0.tar.gz:
Publisher:
publish.yml on serge-m/claude-podman
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
claude_podman-0.2.0.tar.gz -
Subject digest:
f9080aa5c9e5a3b3caee7a66e50307a7bd387380ca604f1c123154b209bfbdfe - Sigstore transparency entry: 1194659735
- Sigstore integration time:
-
Permalink:
serge-m/claude-podman@71b0fd5fd79a57caa4f8f644a2d4f64d2fda8bb7 -
Branch / Tag:
refs/tags/v0.2.0 - Owner: https://github.com/serge-m
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@71b0fd5fd79a57caa4f8f644a2d4f64d2fda8bb7 -
Trigger Event:
release
-
Statement type:
File details
Details for the file claude_podman-0.2.0-py3-none-any.whl.
File metadata
- Download URL: claude_podman-0.2.0-py3-none-any.whl
- Upload date:
- Size: 5.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2c6aee0d7aad2086e08dd4188ca57bd651246cef30a3e229f3020d8462bd633a
|
|
| MD5 |
afd4135ffb8ec38e871c046dea5017ba
|
|
| BLAKE2b-256 |
918b87589fe105b0e3514865c7a48eb19c0c889145fc96891af2c47fe888c29c
|
Provenance
The following attestation bundles were made for claude_podman-0.2.0-py3-none-any.whl:
Publisher:
publish.yml on serge-m/claude-podman
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
claude_podman-0.2.0-py3-none-any.whl -
Subject digest:
2c6aee0d7aad2086e08dd4188ca57bd651246cef30a3e229f3020d8462bd633a - Sigstore transparency entry: 1194659745
- Sigstore integration time:
-
Permalink:
serge-m/claude-podman@71b0fd5fd79a57caa4f8f644a2d4f64d2fda8bb7 -
Branch / Tag:
refs/tags/v0.2.0 - Owner: https://github.com/serge-m
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@71b0fd5fd79a57caa4f8f644a2d4f64d2fda8bb7 -
Trigger Event:
release
-
Statement type: