claude-code - 💡(How to fix) Fix [FEATURE] Use repo devcontainer as execution environment for cloud sessions [1 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
anthropics/claude-code#47856Fetched 2026-04-15 06:40:23
View on GitHub
Comments
0
Participants
1
Timeline
3
Reactions
0
Author
Participants
Timeline (top)
labeled ×3

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.

Root Cause

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.

Fix Action

Fix / Workaround

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.

RAW_BUFFERClick to expand / collapse

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

  1. When creating a cloud session for a repo, detect .devcontainer/devcontainer.json
  2. Offer to build and run the devcontainer as the session environment (opt-in)
  3. 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.

extent analysis

TL;DR

To improve the execution environment in Claude Code cloud, utilize the existing .devcontainer/devcontainer.json specification to offer a custom environment setup, similar to GitHub Codespaces.

Guidance

  • Detect the presence of a .devcontainer/devcontainer.json file when creating a cloud session for a repository.
  • Offer an opt-in option to build and run the devcontainer as the session environment, leveraging the ghcr.io/anthropics/devcontainer-features/claude-code:1.0 feature.
  • Run Claude Code inside the devcontainer, mirroring the local development setup.
  • This approach would eliminate the need for a slow and fragile setup script, providing a more efficient and reliable environment for repositories with complex toolchains.

Example

No code snippet is provided as the issue focuses on the integration of devcontainer specifications rather than specific code changes.

Notes

The proposed solution relies on the widespread adoption of the devcontainer standard and the existing feature in Claude Code designed to run inside a devcontainer. This approach may not apply to repositories without a .devcontainer/devcontainer.json file or those with highly customized environments not compatible with the devcontainer specification.

Recommendation

Apply the workaround by utilizing the devcontainer specification to offer a custom execution environment, as it aligns with industry standards and leverages existing features in Claude Code, providing a more efficient and reliable development experience.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

claude-code - 💡(How to fix) Fix [FEATURE] Use repo devcontainer as execution environment for cloud sessions [1 participants]