A Docker container with Ubuntu 24.04, Node.js 24, Bun, Git, Claude CLI, and essential development tools for running Claude in dangerous mode.
- Ubuntu 24.04 - Full-featured base image
- Node.js 24 - Latest LTS
- Bun - Fast JavaScript runtime
- Claude CLI - Anthropic's official CLI
- Git - Version control
- GitHub CLI - Create PRs, manage issues, and more
- PostgreSQL Support - Automatic database provisioning per session with PostgreSQL client tools
- Development Tools - ripgrep, fd-find, jq, vim, nano, tmux, htop, and more
- Build Tools - gcc, make, python3, pip
- Session Manager - Manage multiple isolated Claude sessions with git worktree support
- Secret Management - Secure handling of API keys and credentials with automatic leak prevention
The claude-session.sh script makes it easy to manage multiple isolated Claude sessions. Each session runs in its own container with a complete copy of your repository and git worktree support.
# Build the image
docker build -t claude-dangerous .
# Start a new session from any git repository
cd /path/to/your/project
./claude-session.sh start
# List all sessions
./claude-session.sh list
# Attach to an existing session
./claude-session.sh attach <session-name>
# Delete a session
./claude-session.sh delete <session-name>See README-sessions.md for complete documentation.
Setup GitHub CLI for all sessions:
./claude-session.sh github-authInside Claude sessions, you can now use:
gh pr create- Create pull requestsgh pr list- List PRsgh issue create- Create issues- All other gh CLI commands
Each session automatically provisions an isolated PostgreSQL database. Perfect for TypeScript projects that need database connectivity.
# Start a session (database is automatically created)
./claude-session.sh start
# Inside the session, check database status
claude-db status
# Use in your TypeScript code
# DATABASE_URL is automatically configuredDatabase Helper Commands:
claude-db status- Check connectionclaude-db psql- Open PostgreSQL shellclaude-db import schema.sql- Import SQL fileclaude-db export backup.sql- Export databaseclaude-db info- View connection details
Disable database if not needed:
CLAUDE_DB_ENABLED=false ./claude-session.sh startFor monorepos: Session variables (like DATABASE_URL) are automatically injected at the top of your root .env file. Use .env.local in subdirectories for overrides. See README-monorepo.md for usage patterns.
See README-database.md for complete documentation.
The session manager provides secure secret handling:
Store API keys and credentials in:
~/.config/claude-container/secrets/.env.global
Example:
OPENAI_API_KEY=sk-...
AWS_ACCESS_KEY_ID=AKIA...Each session auto-creates a .env file:
./claude-session.sh start
# A .env file is created automatically in your project
# Add project-specific secrets thereStore credential files (like service-account.json) in:
~/.config/claude-container/secrets/
Access them in sessions at /secrets/filename.
Secret files are automatically:
- Added to
.gitignore - Blocked from Claude reading/editing (configurable)
- Mounted read-only in containers
docker-compose buildFirst, create the config directory:
mkdir -p claude-configThen either:
- Copy your existing Claude config:
cp -r ~/.config/claude/* claude-config/ - Or run the container and authenticate:
docker-compose run --rm claude-dev claude auth login
docker-compose run --rm claude-devOr use Docker directly:
docker build -t claude-dangerous .
docker run -it --rm \
-v $(pwd)/claude-config:/config \
-v $(pwd)/workspace:/workspace \
-e CLAUDE_CONFIG_DIR=/config \
claude-dangerousInside the container:
claude chat --dangerously-disable-sandboxOr with a specific directory:
cd /workspace/your-project
claude chat --dangerously-disable-sandbox.
├── Dockerfile # Container definition
├── docker-compose.yml # Docker Compose configuration (for manual usage)
├── claude-session.sh # Session manager script (recommended)
├── README.md # This file
├── README-sessions.md # Session manager documentation
├── claude-config/ # Claude credentials (gitignored)
└── workspace/ # Your projects (manual usage)
- The
workspacedirectory is mounted from your host, so changes persist - Claude config is stored in
claude-configand mounted to/configin the container - All tools (bun, node, git, etc.) are pre-installed and ready to use
- The container runs as root, giving Claude full permissions
- curl, wget, git
- GitHub CLI (gh)
- Node.js 24, npm, Bun
- Claude CLI
- Python 3 with pip
- Build tools (gcc, make, etc.)
- Text editors (vim, nano)
- Utilities (jq, ripgrep, fd-find, tmux, htop)