Container Use
by Dagger
Sandboxed dev environments for coding agents. Each agent gets its own container and git branch — work in parallel without getting in your way.
What Is Container Use?
Container Use is an open-source MCP server that gives each coding agent its own containerized environment and git worktree, enabling safe parallel agent execution with full observability.
The Problem It Solves
Running multiple AI coding agents simultaneously creates chaos: they corrupt each other's files, clobber shared state, consume unpredictable resources, and produce irreversible host system changes. Container Use eliminates these problems by giving each agent its own isolated sandbox.
Who Built It
Container Use comes from Dagger, the company founded by Solomon Hykes (creator of Docker). Built on Dagger's container pipeline engine, it applies the same containerization philosophy to AI coding agents. Released May 2025, it has rapidly gained traction with 3.6k+ GitHub stars and 32 contributors.
Supported Agents
Container Use works with any MCP-compatible agent through its stdio-based MCP server. Documented integrations include:
- Claude Code — primary integration
- Cursor — via MCP config
- Goose — via
.goosehints - VS Code — via MCP-compatible extension
- Any other MCP-compatible coding agent
Run coding agents in parallel without destroying everything. Each agent gets its own environment.
— Dagger blog, announcing Container UseArchitecture
Container Use combines Dagger's container engine with Git worktrees to provide isolation at both the filesystem and version control level.
MCP-Native
Implements the Model Context Protocol as a stdio server. Any MCP-compatible agent can connect without custom integration code.
Git Worktrees
Each environment gets its own git branch (e.g., cu-fancy-mallard). Review agent work with standard git commands.
Ephemeral Containers
Containers are disposable. Spin up, let the agent work, extract results, destroy. No persistent host changes.
Installation & Setup
# macOS (recommended)
brew install dagger/tap/container-use
# All platforms
curl -fsSL https://raw.githubusercontent.com/dagger/container-use/main/install.sh | bash
Add to Claude Code
# Register as MCP server
cd /path/to/repository
claude mcp add container-use -- container-use stdio
# Optional: add agent rules for better behavior
curl https://raw.githubusercontent.com/dagger/container-use/main/rules/agent.md >> CLAUDE.md
Project Configuration
Container Use stores project config in .container-use/environment.json — commit this directory to share setup with your team.
# Set a base image
container-use config base-image set python:3.11
# Add setup commands (run before code is copied)
container-use config setup-command add "apt-get update && apt-get install -y ffmpeg"
# Add install commands (run after code is copied)
container-use config install-command add "pip install -r requirements.txt"
# Set environment variables
container-use config env set NODE_ENV development
# Configure secrets
container-use config secret set API_KEY
Key Features
Container Use focuses on a small set of things done well: isolation, observability, and standard git workflow integration.
Isolated Environments
Every agent receives a fresh container on its own git branch. Parallel agents never conflict — each has full filesystem independence.
Real-time Visibility
Full command history and logs show what agents actually did. Use cu watch for live monitoring across all active environments.
Direct Intervention
cu terminal <env-id> drops you into any agent's container. Inspect state, debug issues, or take manual control.
Standard Git Workflow
Merge with cu merge, stage with cu apply, or checkout with cu checkout. No proprietary review interface.
Universal Compatibility
No vendor lock-in. Works with any MCP-compatible agent, model, or infrastructure. One interface for all agents.
Secrets Management
Secure handling of API keys and credentials via 1Password integration, environment variables, and file references.
CLI Commands
The container-use command is also available as cu for convenience.
Environment Management
| Command | Description |
|---|---|
| cu list | List all environments (--no-trunc for full output, -q for IDs only) |
| cu log <id> | Show commit history and executed commands (--patch for diffs) |
| cu diff <id> | Compare environment to its base branch |
| cu watch | Real-time monitoring of all active environments |
| cu terminal <id> | Open interactive shell inside the container |
| cu delete <id> | Delete an environment (--all to delete everything) |
Code Integration
| Command | Description |
|---|---|
| cu checkout <id> | Switch to environment's branch (-b for custom name) |
| cu merge <id> | Merge environment commits into current branch (-d to auto-delete) |
| cu apply <id> | Stage changes without committing (-d to auto-delete) |
Configuration
| Command | Description |
|---|---|
| cu config show | Display current configuration |
| cu config base-image | Get, set, or reset base image (default: ubuntu:24.04) |
| cu config setup-command | Add/remove/list/clear pre-code setup commands |
| cu config install-command | Add/remove/list/clear post-code install commands |
| cu config env | Set/unset/list/clear environment variables |
| cu config secret | Set/unset/list/clear secrets |
| cu config agent | Configure MCP for specific agent (claude, goose, cursor) |
| cu stdio | Start the MCP server (used in agent config, not manually) |
Environment ID Formats
Environments can be referenced by:
- Full name:
fancy-mallard - Partial (if unique):
fancy - Branch name:
cu-fancy-mallard
Example Workflow
A typical workflow: you prompt your agent, it works in isolation, and you review/merge when ready.
Install and register
brew install dagger/tap/container-use then claude mcp add container-use -- container-use stdio
Prompt your agent
Ask Claude Code to build something: "Create a hello world app in Python using Flask." Container Use automatically creates an isolated environment.
Agent works in isolation
The agent gets a fresh container with its own git branch (e.g., cu-fancy-mallard). It can install packages, write files, run tests — all without touching your host.
Monitor progress
cu watch shows real-time activity across all environments. cu log <id> shows detailed command history.
Review and merge
cu diff <id> to see what changed. cu merge <id> -d to merge and clean up. Standard git from here.
Container Use reframes agent execution as a containerized, stateless operation — borrowing from CI/CD pipeline thinking — so teams can safely parallelize AI coding workflows at scale.
— Dagger engineering blogLimitations & Considerations
Early Development
Explicitly flagged as "experimental" and "actively evolving." APIs and behavior may change between releases. Currently at v0.4.2.
Dagger Dependency
Built on the Dagger engine, which is an additional runtime dependency. Not a simple Docker container — it's a full pipeline engine.
No Task Queue
Unlike TSK, Container Use doesn't have built-in task queuing or chaining. It provides environments, not workflow orchestration.
No Built-in TUI
cu watch provides monitoring, but there's no interactive TUI dashboard for managing multiple environments simultaneously.
MCP-Only Integration
Agents must support MCP to use Container Use. Non-MCP agents cannot integrate without a compatibility layer.
Container Overhead
Each environment runs a full container with its own copy of the codebase. Resource-intensive for large repos or many parallel agents.
Container Use vs TSK
Both tools provide containerized agent isolation, but with different philosophies.
| Feature | Container Use | TSK |
|---|---|---|
| Integration | MCP server (universal) | CLI tool (direct) |
| Task queue | No | Yes, with server mode |
| Task chaining | No | Yes, via --parent |
| Task templates | No | Yes, Markdown templates |
| Multi-agent comparison | No | Yes, --agent codex,claude |
| Interactive shell | cu terminal | tsk shell |
| Real-time monitoring | cu watch | TUI dashboard |
| Agent support | Any MCP agent | Claude Code + Codex only |
| Installation | brew install | cargo install |
| Network isolation | Container-level | Squid proxy with ACLs |
| Language | Go | Rust |
| Maturity | Experimental (v0.4.2) | Early |
Links & Resources
Official
- GitHub Repository — github.com/dagger/container-use
- Documentation Site — container-use.com
- Dagger — parent organization
Articles & Coverage
- Dagger Blog — "Run Coding Agents in Parallel without Destroying Everything"
- InfoQ — "Container Use: a New Tool for Isolated, Parallel Coding Agents"
- The New Stack — "AI Dev Tools: How To Containerize Agents Using Dagger"
Community
- Discord: container-use.com/discord (#container-use channel)
- Contributors: 32
- License: Apache-2.0
- Current version: v0.4.2 (14 releases total)