Skip to main content

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 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

  1. claude-podman resolves 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.
  2. entrypoint.sh launches Claude inside a tmux session.
  3. 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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

claude_podman-0.1.0.tar.gz (5.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

claude_podman-0.1.0-py3-none-any.whl (5.8 kB view details)

Uploaded Python 3

File details

Details for the file claude_podman-0.1.0.tar.gz.

File metadata

  • Download URL: claude_podman-0.1.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

Hashes for claude_podman-0.1.0.tar.gz
Algorithm Hash digest
SHA256 ae82c4c33f4dc3d30ce3aa60c7aa4ef909f66177f4cb2ff59b011220941a6509
MD5 459e50d73856a016f7ffcb4fe629aaf1
BLAKE2b-256 a09cb94bf26307fa3616c5bb093b446af5dc6005480bea8ba7c3a16a36ee692c

See more details on using hashes here.

Provenance

The following attestation bundles were made for claude_podman-0.1.0.tar.gz:

Publisher: publish.yml on serge-m/claude-podman

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file claude_podman-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: claude_podman-0.1.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

Hashes for claude_podman-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 840c4d402bb8cbae87f1828d7929145d0333723dcfd8c41120d822ed33aac8a9
MD5 92c48f626670888fd852c46d76eca183
BLAKE2b-256 5b798633218050e53f50fb445e45de3a31c4f2976f7d0423e2cb38176957373f

See more details on using hashes here.

Provenance

The following attestation bundles were made for claude_podman-0.1.0-py3-none-any.whl:

Publisher: publish.yml on serge-m/claude-podman

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page