[FEATURE] Use repo devcontainer as execution environment for cloud sessions
Summary
When using Claude Code cloud (claude.ai/code), there is currently no way to specify a custom execution environment. The only option is a setup script that runs from scratch each session, which is slow and fragile for repos with complex toolchains.
Repos that already have a .devcontainer/devcontainer.json have already done the work of defining their environment. Claude Code cloud should be able to use that directly.
Proposed behaviour
When starting a cloud session for a repository that contains a .devcontainer/devcontainer.json, Claude Code cloud should offer to spin up the devcontainer as the execution environment — exactly as GitHub Codespaces does today.
Motivation
Many teams use non-standard build toolchains that require specific setup:
- Custom build systems (e.g. Pants, Bazel) that need to be installed
- Specific Python/Node/language versions via version managers (pyenv, nvm, etc.)
- Pre-built virtual environments and caches
Today, the only workaround is a setup script that re-installs everything from scratch on each new session. For a repo using Pants + pyenv + Python 3.11, this takes several minutes per session and is brittle.
The devcontainer spec is already a widely-adopted standard for exactly this purpose — VS Code, GitHub Codespaces, and others use it. The ghcr.io/anthropics/devcontainer-features/claude-code:1.0 feature already exists, meaning Claude Code is already designed to run _inside_ a devcontainer. The missing piece is closing the loop so claude.ai/code can use the repo's devcontainer as its execution environment.
Implementation sketch
- When creating a cloud session for a repo, detect
.devcontainer/devcontainer.json - Offer to build and run the devcontainer as the session environment (opt-in)
- Run Claude Code inside that container, just as VS Code does locally
This would give cloud sessions full parity with local devcontainer setups with zero extra configuration for repos that already have a devcontainer.
This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗