My Claude Code workflow kept getting interrupted by permission prompts. Every file write, every shell command - confirm, confirm, confirm. The --dangerously-skip-permissions flag eliminates these prompts, but running it on my host felt risky.
Devcontainers solved this. Here’s my setup.
The Core Idea
Container isolation gives you the safety that permission prompts were providing. Claude Code can do whatever it wants inside the container - the host system stays protected. If something goes wrong, rebuild the container.
My Configuration
Create .devcontainer/devcontainer.json:
| |
The NET_ADMIN and NET_RAW capabilities allow network debugging tools if Claude needs them. The named volume persists your Claude configuration across container rebuilds.
Create .devcontainer/Dockerfile:
| |
Running It
- Open project in VS Code
Ctrl+Shift+P-> “Dev Containers: Reopen in Container”- Wait for build (30-60 seconds first time, 5-10 seconds after)
- In the container terminal:
claude --dangerously-skip-permissions
No more permission prompts. Full autonomy inside the container.
Container startup adds 5-10 seconds. In exchange, uninterrupted sessions. Worth it.
