Related ToolsClaude Code

"Dangerously" Runs Claude Code Unattended Inside Docker Compose Stacks

Claude by Anthropic
Image: Anthropic

Claude Code has an autonomous mode (triggered by a flag literally called --dangerously-skip-permissions) that lets the AI agent run without asking you to approve every file edit, command, or deletion. Powerful, but the name is a hint: you probably don't want an unsupervised AI agent with free rein over your actual file system.

A new open-source project called "dangerously" solves this by wrapping Claude Code inside an isolated Docker container. File system changes get restricted to your project directory, so the agent can write, delete, and refactor without touching anything outside the sandbox.

The more interesting part is docker-compose integration. The tool reads your existing docker-compose.yml and spins up your full service stack alongside Claude Code. That means the agent can run tests against real dependencies - your actual Postgres database, Redis cache, message queue, whatever your app needs - instead of working blind and hoping the code it writes actually works with your infrastructure.

This matters because the gap between "AI wrote code that looks right" and "AI wrote code that actually runs" is where most agent-assisted development falls apart. Giving Claude Code access to a real (but disposable) copy of your service stack closes that gap without the risk of the agent accidentally dropping your production database.

The project is MIT-licensed and available on GitHub. Setup looks straightforward if you're already using Docker Compose - which, if you're the kind of developer running Claude Code in autonomous mode, you almost certainly are.

One limitation to watch: container isolation protects your file system and services, but network access and secret management still need careful handling. The README doesn't go deep on either topic yet. For local development and CI pipelines, though, this is a practical approach to a real problem that anyone using agentic coding tools has bumped into.