Skip to main content

A CLI tool for sandboxing folders into containers with Claude Code support

Project description

Sandboxer

A CLI tool for sandboxing folders into containers using Podman. Perfect for isolating development environments with pre-configured tools like Claude Code, Go, Python, and Bun.

Features

  • Mount any local folder into an isolated container environment
  • Pre-built container image with development tools ready to go
  • Manage multiple sandbox containers (list, stop, attach, remove)
  • Uses Podman for rootless container execution

Container Image

The included Dockerfile builds an Ubuntu 24.04-based image with:

Tool Description
Claude Code Anthropic's CLI for Claude
OpenCode AI coding assistant
uv Fast Python package manager
Bun Fast JavaScript runtime
Go Go programming language (v1.23.5)
Pyright Python type checker
ripgrep, jq, neovim, tmux Developer utilities

The image supports both amd64 and arm64 architectures.

Building the Container Image

# Build for current architecture
podman build -t sandboxer .

# Build for a specific architecture
podman build --platform linux/amd64 -t sandboxer:amd64 .
podman build --platform linux/arm64 -t sandboxer:arm64 .

# Build multi-arch image and push to registry
podman build --platform linux/amd64,linux/arm64 -t myregistry/sandboxer:latest --manifest sandboxer .
podman manifest push sandboxer docker://myregistry/sandboxer:latest

Installation

Prerequisites

  • Podman installed on your system
  • Python 3.12+
  • uv (recommended) or pip

Install the CLI

# Using uv (recommended)
uv pip install .

# Or using pip
pip install .

# For development
uv pip install -e ".[dev]"

Alternatively, run the install script which sets up Podman, uv, and Claude Code:

./install.sh

Usage

Run a sandbox container

Mount the current directory into an interactive container:

sandboxer run

Mount a specific folder:

sandboxer run /path/to/project

Use a custom container image:

sandboxer run /path/to/project --image myregistry/custom-image:latest

Run in detached mode (background):

sandboxer run /path/to/project --detach

Specify a custom container name:

sandboxer run /path/to/project --name my-sandbox

List sandbox containers

List all sandboxer-managed containers:

sandboxer list

List only running containers:

sandboxer list --running

Attach to a running container

sandboxer attach <container-name-or-id>

Stop a container

sandboxer stop <container-name-or-id>

Remove a container

sandboxer rm <container-name-or-id>

Check version

sandboxer --version

Example Workflow

# Build the container image (first time only)
podman build -t sandboxer .

# Start a sandbox for your project
sandboxer run ~/projects/my-app --detach --name my-app-sandbox

# List running sandboxes
sandboxer list --running

# Attach to work in the sandbox
sandboxer attach my-app-sandbox

# Inside the container, use Claude Code
claude

# Exit and stop when done
sandboxer stop my-app-sandbox
sandboxer rm my-app-sandbox

How It Works

Sandboxer uses Podman to create containers with your project folder mounted at /home/developer/project. The containers run as a non-root developer user with:

  • User namespace mapping (--userns=keep-id) for proper file permissions
  • SELinux labeling (:Z) for volume mounts
  • Labels for tracking sandboxer-managed containers

Container names are auto-generated based on the folder path: sandboxer-{folder-name}-{hash}.

License

MIT

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

sandboxer-0.1.0.tar.gz (13.7 kB view details)

Uploaded Source

Built Distribution

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

sandboxer-0.1.0-py3-none-any.whl (7.0 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: sandboxer-0.1.0.tar.gz
  • Upload date:
  • Size: 13.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.26 {"installer":{"name":"uv","version":"0.9.26","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for sandboxer-0.1.0.tar.gz
Algorithm Hash digest
SHA256 f4b986731c95e0103daad402a0449d0defd1af39b6f31e48612ded350ed12510
MD5 8c7f3718d3645da2597f9caa09a29eeb
BLAKE2b-256 fc8af2c873e86e1723104012b20bc733633ed198adf7d31af73e5c7b9a19aa23

See more details on using hashes here.

File details

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

File metadata

  • Download URL: sandboxer-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 7.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.26 {"installer":{"name":"uv","version":"0.9.26","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for sandboxer-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 592456ade0da6c9c5ed52d7cdeb188cc42a1667a85293d047c12d771a98d919b
MD5 7a7b485f2da86d9d902121155784e2f8
BLAKE2b-256 6f79c9aed99ad7c412fddea36d6cbd3f51674c6f25510fd09878c94b42b2d2eb

See more details on using hashes here.

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