Skip to content

piotrowski/cclaude

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 

Repository files navigation

cclaude - Containerized Claude

Run Claude Code in a containerized environment.

To make it seamless and compatible with your local hooks and config Docker will run with the same user directory as your local environment.

Disclaimer: This project was created for my personal use and everything in this repo was tested against my Linux setup. Things may not work for your setup out of the box.

Build

make build

This automatically detects your host UID, GID, username, and timezone so the container matches your local environment. You can override any of these:

make build IMAGE=my-claude TAG=v1.0 TZ=America/New_York

Run

docker run -it --rm \
  -v "$HOME/.claude:/home/$(whoami)/.claude" \
  -v "$HOME/.claude.json:/home/$(whoami)/.claude.json" \
  -v "$HOME/.gitconfig:/home/$(whoami)/.gitconfig:ro" \
  -v "$HOME/.ssh:/home/$(whoami)/.ssh:ro" \
  -v "$SSH_AUTH_SOCK:/tmp/ssh-agent.sock" \
  -e SSH_AUTH_SOCK=/tmp/ssh-agent.sock \
  -v "$HOME/.config/rtk:/home/$(whoami)/.config/rtk" \
  -v "$HOME/.local/share/rtk:/home/$(whoami)/.local/share/rtk" \
  -v "$(pwd):/work" \
  -w /work \
  claude-code

This mounts your Claude credentials, Git config, SSH keys, and RTK config into the container and opens Claude Code in the current directory.

RTK (Token Killer)

The container includes rtk, a CLI proxy that reduces token usage by 60-90% on common dev operations.

See the RTK installation guide for full setup details.

Important: RTK relies on Claude Code hooks to intercept commands. You must install the hooks in your Claude Code settings for RTK to work inside the container. Since ~/.claude is mounted from your host, configure the hooks on your host machine and they will be available inside the container automatically.

Alias

Add this to your ~/.bashrc or ~/.zshrc:

alias cclaude='docker run -it --rm \
  -v "$HOME/.claude:/home/$(whoami)/.claude" \
  -v "$HOME/.claude.json:/home/$(whoami)/.claude.json" \
  -v "$HOME/.gitconfig:/home/$(whoami)/.gitconfig:ro" \
  -v "$HOME/.ssh:/home/$(whoami)/.ssh:ro" \
  -v "$SSH_AUTH_SOCK:/tmp/ssh-agent.sock" \
  -e SSH_AUTH_SOCK=/tmp/ssh-agent.sock \
  -v "$HOME/.config/rtk:/home/$(whoami)/.config/rtk" \
  -v "$HOME/.local/share/rtk:/home/$(whoami)/.local/share/rtk" \
  -v "$(pwd):/work" \
  -w /work \
  claude-code'

Then run from any project directory:

cclaude

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors