feat: install Claude Code with its native installer in dev containers - #35
Merged
Merged
Conversation
- Run the official install script as the vscode user during the image build and expose the launcher through /usr/local/bin so it works from every shell without rc file changes - Drop the claude-code and node dev container features; the native binary needs no Node.js, matching how Codex is already installed - Document that rebuilding the image updates both Claude Code and Codex
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.
Overview and Background
The generated dev container now installs Claude Code with Anthropic's native installer during the image build and no longer contains Node.js. Previously Claude Code came from the
ghcr.io/anthropics/devcontainer-features/claude-codefeature, which installs the npm package and therefore needs Node.js. On Ubuntu 26.04 the feature's own Node.js fallback failed, so #33 had to add thenodefeature explicitly, reintroducing a runtime that #19 had deliberately removed when Codex switched to its standalone installer.Related Issues
None. Follows up on #33 and restores the intent of #19.
Implementation Approach
curl -fsSL https://claude.ai/install.sh | bash) downloads a checksum-verified binary and installs it under$HOME(~/.local/share/claude/versions/<v>with a~/.local/bin/claudelauncher). It is run as thevscodeuser in the Dockerfile so the files belong to the user that will run it; the transient~/.claude/downloadsdirectory is removed afterwards./usr/local/bin/claudeis a symlink to the user's launcher so the command works frombash -lc,zsh -lc, and non-login shells without relying on rc files that thecommon-utilsfeature rewrites.claude-codeandnodefeatures are removed fromdevcontainer.json.github-cliandcommon-utilsstay.~/.claudebind mount (authentication and config) is unaffected: the binary lives in~/.local, and the image was verified with an empty~/.claudemounted over it.Changes
template/.devcontainer/Dockerfile: native Claude Code install asvscode, symlink in/usr/local/bin.template/.devcontainer/devcontainer.json:nodeandclaude-codefeatures removed.README.md,template/README.md: rebuilding the image updates both Claude Code and Codex.Impact
claudeis available exactly as before. The image no longer ships Node.js or npm; projects that need Node.js for their own work should add thenodefeature themselves.~/.local/share/claude.Validation Results
Generated a Python 3.14 project from this branch and built the dev container both with plain Docker and with the Dev Container CLI (features included).