Featured image of post Devcontainers: Claude Code Without Permission Prompts

Devcontainers: Claude Code Without Permission Prompts

My devcontainer setup for running Claude Code with --dangerously-skip-permissions safely isolated from my host system.

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:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
{
    "name": "Claude Code Development",
    "build": { "dockerfile": "Dockerfile" },
    "runArgs": ["--cap-add=NET_ADMIN", "--cap-add=NET_RAW"],
    "customizations": {
        "vscode": {
            "extensions": ["dbaeumer.vscode-eslint", "esbenp.prettier-vscode"],
            "settings": { "terminal.integrated.defaultProfile.linux": "zsh" }
        }
    },
    "remoteUser": "node",
    "mounts": [
        "source=claude-code-config-${devcontainerId},target=/home/node/.claude,type=volume"
    ]
}

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:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
FROM node:20

RUN apt-get update && apt-get install -y --no-install-recommends \
    git procps sudo fzf zsh gh jq vim \
    && apt-get clean && rm -rf /var/lib/apt/lists/*

RUN npm install -g @anthropic-ai/claude-code

USER node
ENV SHELL=/bin/zsh

Running It

  1. Open project in VS Code
  2. Ctrl+Shift+P -> “Dev Containers: Reopen in Container”
  3. Wait for build (30-60 seconds first time, 5-10 seconds after)
  4. 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.

uname -a: Human 5.4.0-anxiety #1 SMP Coffee-Deprived x86_64 GNU/Paranoid
Built with Hugo
Theme Stack designed by Jimmy