Generate production-ready devcontainer configurations with Claude Code, modern dev tools, and persistent volumes. Supports Python, Node/TypeScript, Rust, and Go.
Overview
The Devcontainer Setup skill creates isolated development environments with Claude Code pre-installed, language-specific tooling, modern CLI utilities, and persistent session data. Perfect for sandboxed development, team onboarding, or reproducible builds. Author: Alexis ChallandeFeatures
Claude Code Pre-installed
Includes Claude Code with
bypassPermissions configured and marketplace plugins auto-loadedMulti-Language Support
Detects and configures Python 3.13, Node 22, Rust, and Go automatically
Modern CLI Tools
Includes ripgrep, fd, fzf, tmux, git-delta, ast-grep for enhanced development
Session Persistence
Command history, GitHub CLI auth, and Claude config survive container rebuilds
Supported Languages
| Language | Detection | Configuration |
|---|---|---|
| Python | pyproject.toml, *.py | Python 3.13 via uv (fast binary install) |
| Node/TypeScript | package.json, tsconfig.json | Node 22 via fnm |
| Rust | Cargo.toml | Devcontainer feature |
| Go | go.mod | Devcontainer feature |
Multi-language projects automatically get all detected configurations merged.
Generated Files
| File | Purpose | |------|---------|| |Dockerfile | Container build instructions with Claude Code and dev tools |
| devcontainer.json | VS Code/devcontainer configuration |
| post_install.py | Post-creation setup (permissions, tmux, git config) |
| .zshrc | Shell configuration with history persistence |
| install.sh | CLI helper (devc command) for managing containers |
Installation
Usage
Automatic Detection
Claude detects your project’s language stack by scanning for:
pyproject.toml,*.py→ Pythonpackage.json,tsconfig.json→ Node/TypeScriptCargo.toml→ Rustgo.mod→ Go
Configuration Generated
Claude writes 5 files to
.devcontainer/:- Dockerfile with language runtimes
- devcontainer.json with VS Code settings
- post_install.py for setup automation
- .zshrc for shell configuration
- install.sh for CLI helper commands
CLI Helper Commands
After generating, run.devcontainer/install.sh self-install to add the devc command:
Language-Specific Configuration
Python Projects
Detected from:pyproject.toml, requirements.txt, *.py
Includes:
- Python 3.13 via uv (fast binary install, not source compilation)
- VS Code extensions: python, pylance, ruff
- Auto-configured interpreter path:
.venv/bin/python - Ruff formatting on save
Node/TypeScript Projects
Detected from:package.json, tsconfig.json
Includes:
- Node 22 via fnm (Fast Node Manager)
- VS Code extensions: eslint, prettier
- Auto-detect package manager from lockfile (pnpm, yarn, npm)
- Prettier formatting on save
Rust Projects
Detected from:Cargo.toml
Includes:
- Rust via devcontainer feature
- VS Code extensions: rust-analyzer, even-better-toml
- Locked builds when
Cargo.lockexists
Go Projects
Detected from:go.mod
Includes:
- Go latest via devcontainer feature
- VS Code extension: golang.go
- Language server enabled
Security Model
The devcontainer provides filesystem isolation with network isolation capabilities:Filesystem Isolation
Filesystem Isolation
- Container filesystem is isolated from host
- Your
~/.gitconfigis mounted read-only - Persistent volumes preserve auth across rebuilds
- No access to host files outside project directory
Network Isolation
Network Isolation
- iptables/ipset with NET_ADMIN/NET_RAW capabilities
- Restrict outbound traffic by domain/IP
- NPM security: scripts disabled, 24-hour package release delay
Session Persistence
Session Persistence
These survive container rebuilds:
- Command history (zsh)
- GitHub CLI authentication
- Claude Code configuration
- SSH keys (via persistent volume)
Advanced Usage
Adding Persistent Volumes
Pattern for new mounts indevcontainer.json:
/home/vscode/.cargo(Rust dependencies)/home/vscode/go(Go modules)/home/vscode/.npm(NPM cache)/home/vscode/.cache(General cache)
Multi-Language Projects
For projects using multiple languages (e.g., Python + Node):- All detected languages are configured automatically
- Extensions from all languages are merged
- Post-create commands are chained:
Tailscale Integration
For secure networking between devcontainers:Reference Material
The skill includes detailed reference documentation:- dockerfile-best-practices.md - Layer optimization, multi-stage builds, architecture support
- features-vs-dockerfile.md - When to use devcontainer features vs custom Dockerfile
Validation Checklist
Before starting the container, verify:Troubleshooting
Container won't start
Container won't start
Check Docker is running:Rebuild container:
Permission errors
Permission errors
The
post_install.py script handles permissions. If issues persist:Dependencies not installing
Dependencies not installing
Check the post-create command ran successfully:Manually run setup:
Lost configuration after rebuild
Lost configuration after rebuild
Ensure persistent volumes are configured in
devcontainer.json:Related Skills
- Modern Python - Python tooling configured in devcontainers (uv, ruff, pytest)
- GH CLI - GitHub CLI comes pre-installed and authenticated
- Ask Questions If Underspecified - Used when project language is ambiguous