container-use: Sandboxed Containers for Claude Code
Dagger's container-use gives each coding agent its own container and git branch via an MCP server, so parallel agents run safely. Install, workflow, cons.
By Claudekit Team Published 1 min read
- Type
- CLI
- Pricing
- Open Source
- Repository
- github.com
- GitHub stars
- 4,079
- Website
- container-use.com
container-use, from the Dagger team, gives coding agents containerized development environments. Each agent gets a fresh container on its own git branch, so you can run several agents in parallel, let them install packages and run servers freely, and throw away failures without touching your machine. It works with Claude Code, Cursor and any MCP-compatible agent.
Who it is for
Developers who want stronger isolation than worktrees alone, for example when agents need to install dependencies, run databases, or execute untrusted code.
Install
# macOS (recommended)
brew install dagger/tap/container-use
# All platforms
curl -fsSL https://raw.githubusercontent.com/dagger/container-use/main/install.sh | bash
Then add it to Claude Code from your repository:
cd /path/to/repository
claude mcp add container-use -- container-use stdio
Optionally append the project’s agent rules to your CLAUDE.md:
curl https://raw.githubusercontent.com/dagger/container-use/main/rules/agent.md >> CLAUDE.md
Use cases
- “Create a hello world app in Python using Flask” and get a URL to the running app inside the container.
- Run two agents on alternative implementations and keep the better branch.
- Let an agent experiment with system packages without polluting your laptop.
- Drop into an agent’s terminal when it gets stuck and take over.
Pros
- Real container isolation per agent, powered by Dagger.
- Standard git workflow for review: just check out the branch.
- Full visibility into commands the agent actually ran.
Cons and caveats
- Experimental and evolving; expect breaking changes.
- Requires a container runtime and adds startup overhead.
- Agents must route work through the MCP tools; the rules file helps keep them inside the sandbox.
Links
- Repo: dagger/container-use
- Quickstart: container-use.com
- Related: Claude Squad, permission modes, CLAUDE.md guide
Frequently asked questions
Is container-use an MCP server or a CLI?
Both. You install a CLI (container-use, or cu for short) and register its stdio MCP server with your agent.
How do I review what an agent did?
Each environment maps to a git branch, so you can git checkout the branch, and the tool keeps a full command history and logs.
Is it production ready?
The README marks it as experimental and in early development, so expect changes.