devcontainer-setup
An agent skill by trailofbits, from trailofbits/skills. Tags: automation, cloud, developer-tools, devops, local-workflow.
What it does
Creates devcontainers with Claude Code, language-specific tooling (Python/Node/Rust/Go), and persistent volumes. Use when adding devcontainer support to a project, setting up isolated development environments, or configuring sandboxed Claude Code workspaces.
Install
With the skills CLI, which installs into Claude Code, Codex, Cursor and other agents:
npx skills add trailofbits/skills --skill devcontainer-setup
Or copy the skill folder into Claude Code's skills directory by hand (~/.claude/skills for every project, or .claude/skills inside one):
git clone --depth 1 https://github.com/trailofbits/skills
cp -r skills/plugins/devcontainer-setup/skills/devcontainer-setup ~/.claude/skills/devcontainer-setup
Safety box score
Grade F, high risk: 89 of 100 risk points, rated 2026-10-20. The grade rates what the skill and its scripts can reach on the machine of whoever installs it, across eight categories from shell execution to secrets access. How the score works.
This skill generates a devcontainer image plus helper scripts that install Claude Code, add marketplace plugins, and wire in language tooling. The main risks are executing downloaded installers during build/startup, forwarding Claude/Anthropic credentials into the container, and helper commands that can write to host dotfiles or delete Docker resources.
| Category | Level | Why |
|---|---|---|
| Code & shell execution | 3 (high) | `resources/Dockerfile` runs downloaded installers with `curl ... | bash`, and `resources/post_install.py` spawns `claude -p`; this is broad code execution during build and container startup. |
| Network access | 3 (high) | The setup fetches code and artifacts from the network (`https://claude.ai/install.sh`, GitHub release `.deb`/`.tar.gz` URLs) and forwards auth-bearing env vars into the container via `remoteEnv`. |
| Filesystem reach | 3 (high) | It writes outside the project into home dotfiles and persistent state (`~/.gitconfig.local`, `~/.gitignore_global`, `~/.tmux.conf`, `~/.claude/`) and includes destructive cleanup paths like `rm -rf .venv` and `destroy`. |
| Secrets & credentials | 2 (moderate) | `resources/devcontainer.json` forwards `CLAUDE_CODE_OAUTH_TOKEN` and `ANTHROPIC_API_KEY` into the container, and `resources/post_install.py` uses the OAuth token to seed auth state in `~/.claude.json`. |
| Privilege & persistence | 2 (moderate) | The devcontainer requests elevated capabilities (`--cap-add=NET_ADMIN`, `--cap-add=NET_RAW`) and `post_install.py` invokes `sudo chown -R`, but it does not require host sudo by default. |
| Instruction hijack surface | 3 (high) | `resources/post_install.py` sets Claude's default permission mode to `bypassPermissions`, which suppresses normal approval checks; the helper also advertises `destroy -f` to skip confirmations. |
| Irreversible actions | 3 (high) | `resources/install.sh` can stop/remove containers, volumes, and images (`destroy`), sync sessions from containers to the host, and upgrade Claude Code without further verification. |
| Transparency | 3 (high) | Several build steps rely on remote installers and release artifacts fetched by URL, so the reviewer cannot inspect the executed code from the repository alone. |
Before installing
- Read `resources/Dockerfile` and `resources/post_install.py` first; they execute remote installers and set `bypassPermissions`.
- Test in a scratch repo with dummy `CLAUDE_CODE_OAUTH_TOKEN` and `ANTHROPIC_API_KEY` values before using real credentials.
- Decide whether you want the host dotfile writes and helper side effects (`~/.zshrc`, `~/.gitconfig.local`, `destroy`, `sync`).
- Confirm you are comfortable granting the container `NET_ADMIN`/`NET_RAW` capabilities.
Rated 2026-10-20 by an automated review of 9 files from the skill's repository.
Source
- Repository
- trailofbits/skills (all skills from this repository)
- Path
- plugins/devcontainer-setup/skills/devcontainer-setup/SKILL.md
- Branch
- main
- Collection
- devcontainer-setup
- Updated
- 2026-09-19
Related skills
- hosted-agents — This skill should be used when designing hosted or background agent infrastructure: sandboxed execution, remote coding environments, warm pools.
- provision-cloud-agent — Provision an always-on cloud-hosted coding agent: pick a host platform (Railway or AWS EC2; pluggable for Fly.io, …).
- agents-deploy — Use when deploying your agent to AWS, or when a deploy has failed.
- aws-blocks — Guides building full-stack applications with AWS Blocks — an Infrastructure-from-Code framework.
- bambu-labs — Dry-run, upload, and cautiously initiate local Bambu Lab print jobs from validated plain `.gcode`, using Bambu LAN FTPS/MQTT handoffs.
- cad — Create/edit parametric CAD models, organize CAD projects, export STEP/STL/3MF/GLB files, resolve prompt references, and measure geometry with cadgen.