MAKRAZMAKRAZ
← Back to blog
Engineering — · Updated · 6 min read

ddev-claude: Claude Code in YOLO mode, in a DDEV sandbox

Engineering

In short: ddev-claude is an open-source DDEV add-on that runs Claude Code in YOLO mode (no permission prompts) inside its own container. A firewall limits its outbound traffic to Anthropic, GitHub, your DDEV services, your machine (the host gateway) and the domains you or your enabled extras allow, with documented gaps such as DNS tunnelling, ping, and data sent out through allowed hosts like GitHub. It guards against accidental data leaks, but it is not a vault for the secrets inside your project, and files it writes to .git/ or .ddev/ can run on your machine. Install it with ddev add-on get makraz/ddev-claude.

ddev-claude is an open-source DDEV add-on that runs Claude Code, Anthropic’s AI coding agent, in its own container next to your project (a “sidecar”). Inside that container the agent runs with --dangerously-skip-permissions, often called YOLO mode, so it works without asking for approval at every step. A firewall decides where it can connect.

Two commands install it in any DDEV project, and a third starts it:

ddev add-on get makraz/ddev-claude
ddev restart
ddev claude

Why run Claude Code in a sandbox?

An AI coding agent is most useful when it can work for a long stretch without supervision: run the tests, read the error, fix the code, run the tests again. By default Claude Code asks permission before each command, which is safe but means you have to sit and click “yes” all session. The obvious way out is the --dangerously-skip-permissions flag, and the name says it all: on your own machine, an agent that goes wrong can delete files, read your SSH keys, or send data anywhere on the internet.

We already run every client project in DDEV, so each project has its own containers and its own network. Putting the agent in one more container on that network was the natural answer: it sees the project code and the DDEV services (web, db, other add-ons), but not your home directory, your SSH keys or your other projects.

What does ddev-claude do?

extras:
  - php
extra_allowed_domains:
  - sentry.io

Apply changes with ddev claude rebuild && ddev restart.

What does ddev-claude not protect against?

We’d rather be clear about this. The agent can read and change your whole project tree, including .env, and it can reach the project’s database: it can still delete files or drop tables inside the project. The firewall controls where traffic can go, not what goes through a destination you allowed: any allowed host, GitHub included, can carry data out, whether the agent pushes with your token (GITHUB_PERSONAL_ACCESS_TOKEN, if you pass one in) or with one an attacker supplies. If you pass a token, give it the narrowest scopes you can.

The SECURITY.md file lists the remaining gaps, including: DNS tunnelling (hiding data inside DNS queries) through the allowed resolver, ICMP echo (ping), sites that share a CDN address with an allowed domain, and any service listening on your machine, since the host gateway is allowed on every port. The agent can also write files that take effect later, outside the sandbox: Git hooks and DDEV host commands that run on your machine, and the Dockerfile escape hatch (.ddev/claude.local/Dockerfile.fragment) or .ddev/claude.yaml (including its allowed domains), which apply at the next rebuild.

So the sandbox guards against accidental data leaks, limits the agent’s network access to the allow-list (within the gaps above) and its file access to the project. Still, review what it writes to .git/ and .ddev/ before you run or rebuild anything. It is not a vault for secrets.

Version history

v0.1.0 (6 May 2026): first release. Everything was included: PHP, Composer, Playwright, Chromium, MCP servers and the GitHub CLI, in an image of about 1.5 GB.

v0.2.0 (3 June): a minimal sidecar. The default image dropped to Claude Code plus the firewall, about 300 MB. PHP became an opt-in extra in .ddev/claude.yaml; the rest (Playwright, the GitHub CLI, MCP servers) moved to an escape hatch (.ddev/claude.local/Dockerfile.fragment), with ready-made snippets in the README. This release also added the safe, shell, exec, rebuild and help subcommands.

v0.3.0 betas (June): pre-built image and security hardening.

v0.4.0 (21 August 2026): the first stable release since v0.2. ddev add-on get only installs stable releases by default, so none of the v0.3 betas reached anyone installing the default version. Lesson learned. This release:

v0.4.1 (31 August 2026): a blocked connection now fails immediately instead of hanging until the client’s timeout (up to 300 s for curl).

v0.4.2 (26 September 2026): the base image was rebuilt with the Claude Code release current at the time, and the release procedure now signs and verifies tags.

Try it

The add-on is MIT-licensed and listed in the DDEV add-on registry. The README and SECURITY.md in the repository cover every option and every known limit. Issues and pull requests are welcome.

Setting up safe, fast development environments like this one is part of our DevOps & Cloud work. For the skills we use with the agent inside the sandbox, see how I use Claude Code skills every day.

Frequently asked questions

Is it safe to run Claude Code with --dangerously-skip-permissions in ddev-claude?+

Safer, not safe. The agent runs in its own container, and its outbound traffic is limited to an allow-list (which includes your own machine), with documented gaps such as DNS tunnelling and ping. But it can read your whole project, including .env, and any API keys or tokens in the container, including your Claude login. Any allowed host, GitHub included, can carry data out. And it can change or delete anything in your project. Keep backups and review what it writes to .git/ and .ddev/, because Git hooks and DDEV host commands written there run on your machine.

Does ddev-claude need an Anthropic API key?+

No. If ANTHROPIC_API_KEY is not set, Claude Code asks you to log in with your Claude account (a subscription or an Anthropic Console account) the first time you run ddev claude.

How do I allow an extra domain in ddev-claude?+

Add it under extra_allowed_domains in .ddev/claude.yaml, then run ddev claude rebuild && ddev restart.

Does ddev-claude work without Mutagen?+

Yes. Without Mutagen the project is mounted from your machine; with Mutagen enabled, the container shares DDEV's synced volume, which was much faster on macOS in our tests.

Hamza Makraz
Founder, MAKRAZ — software engineer

Want AI-assisted development set up safely for your team?

Book a free discovery call