A single Docker Compose workspace for Claude Code, GitHub Copilot CLI, and OpenAI Codex,
all sharing a common base image and the same workspace/ directory.
.
├── Dockerfile.base # Shared base: Ubuntu 24.04 + Node.js + Python 3 + Rust + bash
├── Dockerfile.claude # FROM dev-base + Claude Code CLI
├── Dockerfile.copilot # FROM dev-base + GitHub Copilot CLI
├── Dockerfile.codex # FROM dev-base + OpenAI Codex CLI
├── docker-compose.yml # All three agents + PostgreSQL
├── .gitignore
├── workspace/ # Shared project files — all agents mount this
├── claude-config/ # Persistent Claude Code auth - gitignored so no secrets can leak
├── copilot-config/ # Persistent Copilot CLI auth - gitignored so no secrets can leak
├── codex-config/ # Persistent Codex config - gitignored so no secrets can leak
├── commandhistory/ # Persistent command history - gitignored so no data can leak
│ ├── claude/
│ ├── copilot/
│ └── codex/
└── README.md
Dockerfile.base builds a shared image called dev-base containing everything all three
agents need: system packages, Node.js LTS, Python 3, Rust, pnpm, and yarn. Each agent
Dockerfile starts with FROM dev-base and only adds its own CLI tool.
Benefits:
- Common layers are built and cached once — not three times
- Rebuilding one agent image is fast (only its own layer changes)
- All agents run identical Node/Python/Rust versions
- Disk space: shared layers are stored once by Docker
The base image uses plain bash with Ubuntu's default color prompt, tab completion
(bash-completion), and persistent history — no heavy shell frameworks needed.
mkdir -p commandhistory/claude commandhistory/copilot commandhistory/codexdocker build -f Dockerfile.base -t dev-base .docker compose up --build -ddocker compose exec -it claude-code bash
docker compose exec -it copilot bash
docker compose exec -it codex bashAll three agents use an interactive device code flow — no API keys or .env files needed.
Auth is persisted in the *-config/ directories on the host and survive rebuilds.
Claude Code (inside claude-code container):
claude
# follow the interactive login flowCopilot CLI (inside copilot-dev container):
copilot
# follow the interactive login flowCodex (inside codex-dev container):
codex
# follow the interactive login flowAll three containers mount the same ./workspace directory.
You can use the agents to work on different projects or together on one project.
Use Git as your coordination layer — commit before switching agents so you always have a clean handoff point:
# for example in claude-code:
# checkout a new feature branch
git checkout -b feature-branch
# finish your task with claude code, review it, then commit
git add . && git commit -m "claude: add new feature"
# then merge the feature into the main branch
git checkout main
git merge feature-branchA suggested task split based on each tool's strengths:
| Agent | Best for |
|---|---|
| Claude Code | Architecture, refactoring, tests, large codebase understanding |
| Copilot CLI | GitHub integration (issues, PRs, branches), multi-model tasks |
| Codex | Focused code generation, OpenAI model preference |
Each agent runs in its own isolated container with separate memory and environment variables. Auth tokens and config are mounted into only the container that needs them — the Copilot config is invisible to the Claude and Codex containers, and vice versa.
The only shared surface between containers is the workspace/ directory (intentional)
and the host network (localhost). No MCP servers, web search, or external tool access
is configured by default, keeping the attack surface minimal for local development.
# Start all containers
docker compose up -d
# Start only one agent
docker compose up -d claude-code
# Open a shell
docker compose exec -it claude-code bash
# Stop everything
docker compose stop
# Stop and remove containers
docker compose down
# Rebuild base image after changes
docker build -f Dockerfile.base -t dev-base .
docker compose up --build -d
# Remove everything including volumes (⚠️ deletes PostgreSQL data)
docker compose down -vAvailable to all agents via localhost:5432 (host network mode).
| Setting | Value |
|---|---|
| Database | quest_db |
| User | quest_user |
| Password | quest_passw0rd |
Change the default credentials before using this in any shared or production environment!
Copyright (c) 2026 Michael Schaefer https://github.com/mischa-robots/multi-agent-docker


