Bundle the official Claude Code CLI devcontainer Feature - #25
Merged
Conversation
Anthropic publishes ghcr.io/anthropics/devcontainer-features/claude-code:1.0, so claude can be installed the same low-effort way copilot-cli already is, across all three agentbox surfaces via the shared features manifest. Skip the Feature's own install when claude is already on PATH (Claude Code cloud environments ship it pre-installed, and the Feature's install.sh has no such check itself — it would otherwise npm-reinstall it every run).
claude-code installs via nvm-managed npm's global bin dir, same as node/npm/npx/corepack — without this it was only reachable from within install-features.sh's own shell (where the node Feature's containerEnv eval had already put nvm's bin dir on PATH), not from any later shell.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
ghcr.io/anthropics/devcontainer-features/claude-code:1.0(the official Anthropic-published Feature) todevcontainer.features.json, soclaudeis now bundled the same low-effort waycopilot-clialready is, across all three agentbox surfaces (Claude Code cloud, Copilot cloud sandbox, Codespaces/pre-built image) via the single shared manifest.install-features.sh: skips the Feature's own install whenclaudeis already on PATH — Claude Code cloud environments ship it pre-installed, and the Feature'sinstall.shhas no such check itself (it would otherwisenpm install -git on every setup-script run for no reason).install-features.sh: symlinksclaudeinto/usr/local/binalongside the existingnode/npm/npx/corepacksymlinks —claude-codeinstalls into the same nvm-managed npm global bin dir, which is only on PATH within the script's own shell (via the node Feature'scontainerEnveval), not in any later non-login shell (GitHub Actions step, Claude Code's Bash tool,docker run ... bash -c). Without this,claudewould be unreachable everywhere except during the setup script's own run — the same class of bug already fixed for node/npm.claudeto the final "Tool check" report.Test plan
Verified end-to-end in a clean
ubuntu:24.04container (not through Docker build, via direct script run pointed at this branch):claude-codeFeature installs successfully (Claude Code CLI installed successfully! 2.1.241), reportedOKin the Tool check.claudealready installed: the skip guard fires (claude already present ..., skipping ... install) instead of reinstalling.clauderesolves via/usr/local/bin/claude(symlink to nvm's current bin dir) from a brand-new non-login shell (docker exec ... bash -c "claude --version"), confirming it survives outside the script's own shell — matches hownode/npmwere already verified to need this.OK(an earlierterraformGPG-verification failure in one run was a transient/unrelated flake, not reproduced on rerun).Generated by Claude Code