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.
package.json → name fieldpyproject.toml → project.nameCargo.toml → package.namego.mod → module path (last segment after /)| Language | Detection Files |
|---|---|
| Python | pyproject.toml, *.py |
| Node/TypeScript | package.json, tsconfig.json |
| Rust | Cargo.toml |
| Go | go.mod, go.sum |
postCreateCommand, chain all setup commands:uv run /opt/post_install.py && uv sync && npm ci
resources/ directory. Substitute:{{PROJECT_NAME}} → Human-readable name (e.g., "My Project"){{PROJECT_SLUG}} → Slug for volumes (e.g., "my-project").devcontainer/ mounted read-only to prevent container escapeCLAUDE_CODE_OAUTH_TOKEN and ANTHROPIC_API_KEY via remoteEnvpyproject.toml, requirements.txt, setup.py, or *.py filespyproject.toml), modify the Python installation:# Install Python via uv (fast binary download, not source compilation)
RUN uv python install <version> --default
customizations.vscode.extensions:"ms-python.python",
"ms-python.vscode-pylance",
"charliermarsh.ruff"
customizations.vscode.settings:"python.defaultInterpreterPath": ".venv/bin/python",
"[python]": {
"editor.defaultFormatter": "charliermarsh.ruff",
"editor.codeActionsOnSave": {
"source.organizeImports": "explicit"
}
}
pyproject.toml exists, chain commands:rm -rf .venv && uv sync && uv run /opt/post_install.py
package.json or tsconfig.jsoncustomizations.vscode.extensions:"dbaeumer.vscode-eslint",
"esbenp.prettier-vscode"
customizations.vscode.settings:"editor.defaultFormatter": "esbenp.prettier-vscode",
"editor.codeActionsOnSave": {
"source.fixAll.eslint": "explicit"
}
pnpm-lock.yaml → uv run /opt/post_install.py && pnpm install --frozen-lockfileyarn.lock → uv run /opt/post_install.py && yarn install --frozen-lockfilepackage-lock.json → uv run /opt/post_install.py && npm ciuv run /opt/post_install.py && npm installCargo.toml"ghcr.io/devcontainers/features/rust:1": {}
customizations.vscode.extensions:"rust-lang.rust-analyzer",
"tamasfe.even-better-toml"
customizations.vscode.settings:"[rust]": {
"editor.defaultFormatter": "rust-lang.rust-analyzer"
}
Cargo.lock exists, use locked builds:uv run /opt/post_install.py && cargo build --locked
uv run /opt/post_install.py && cargo build
go.mod"ghcr.io/devcontainers/features/go:1": {
"version": "latest"
}
customizations.vscode.extensions:"golang.go"
customizations.vscode.settings:"[go]": {
"editor.defaultFormatter": "golang.go"
},
"go.useLanguageServer": true
uv run /opt/post_install.py && go mod download
references/dockerfile-best-practices.md - Layer optimization, multi-stage builds, architecture supportreferences/features-vs-dockerfile.md - When to use devcontainer features vs custom Dockerfiledevcontainer.json:"mounts": [
"source={{PROJECT_SLUG}}-<purpose>-${devcontainerId},target=<container-path>,type=volume"
]
source={{PROJECT_SLUG}}-cargo-${devcontainerId},target=/home/vscode/.cargo,type=volume (Rust)source={{PROJECT_SLUG}}-go-${devcontainerId},target=/home/vscode/go,type=volume (Go).devcontainer/ directory:Dockerfile - Container build instructionsdevcontainer.json - VS Code/devcontainer configurationpost_install.py - Post-creation setup script.zshrc - Shell configurationinstall.sh - CLI helper for managing the devcontainer (devc command){{PROJECT_NAME}} placeholders are replaced with the human-readable name{{PROJECT_SLUG}} placeholders are replaced with the slugified namedevcontainer.json (no trailing commas, proper nesting)postCreateCommand includes all required setup commands (chained with &&)devcontainer up --workspace-folder ..devcontainer/install.sh self-install to add the devc command to PATH