Skip to content

feat(claude-code): switch to official installer with volume persistence#2

Merged
pocky merged 1 commit into
mainfrom
fix/claude-code-shared
Feb 25, 2026
Merged

feat(claude-code): switch to official installer with volume persistence#2
pocky merged 1 commit into
mainfrom
fix/claude-code-shared

Conversation

@pocky
Copy link
Copy Markdown
Contributor

@pocky pocky commented Feb 25, 2026

Summary

  • Replace npm-based Claude Code installation with the official claude.ai/install.sh binary installer, removing the Node.js dependency
  • Implement automatic configuration persistence via a Docker named volume (/claude-config) with a postStartCommand symlink, replacing the manual bind-mount approach documented previously
  • Copy the claude binary to /usr/local/bin so all container users can access it regardless of home directory permissions

Changes

Feature Definition

  • src/claude-code/devcontainer-feature.json: Bump to v1.1.0, drop installsAfter: node, add named volume mount at /claude-config, add postStartCommand to run link-claude-config on each start

Installation Script

  • src/claude-code/install.sh: Replace Node.js/npm installation with curl-only official installer; copy binary from ~/.local/bin to /usr/local/bin; pre-create /claude-config with correct ownership; install link-claude-config.sh to /usr/local/bin
  • src/claude-code/link-claude-config.sh: New post-start script that creates the ~/.claude -> /claude-config symlink for the active container user

Tests

  • test/claude-code/test.sh: Remove npm global package check (no longer relevant with binary install)
  • test/claude-code/install_claude_code_specific_version.sh: Switch version detection from npm list -g to claude --version output parsing

Documentation

  • README.md: Update Claude Code section to reflect official installer, document automatic persistence via named volume, remove manual bind-mount instructions and Node.js feature prerequisite

Test plan

  • Build the feature: devcontainer features test --features claude-code --base-image mcr.microsoft.com/devcontainers/base:ubuntu .
  • Verify claude is accessible system-wide: which claude && claude --version
  • Rebuild the container and confirm authentication and settings survive: check ~/.claude is a symlink pointing to /claude-config
  • Run specific version scenario and confirm claude --version returns 2.1.30

Generated with awf commit workflow

- `README.md`: Update docs to reflect official installer and automatic config persistence
- `src/claude-code/devcontainer-feature.json`: Bump to 1.1.0, add named volume mount and postStartCommand, drop Node.js dependency
- `src/claude-code/install.sh`: Replace npm install with official claude.ai installer, copy binary to /usr/local/bin, install link-claude-config script
- `src/claude-code/link-claude-config.sh`: Add post-start script to symlink ~/.claude to /claude-config volume
- `test/claude-code/install_claude_code_specific_version.sh`: Replace npm list version check with claude --version
- `test/claude-code/test.sh`: Remove npm global package validation (no longer applicable)
@pocky pocky marked this pull request as ready for review February 25, 2026 23:56
@pocky pocky merged commit 35e4374 into main Feb 25, 2026
4 checks passed
@pocky pocky deleted the fix/claude-code-shared branch February 25, 2026 23:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant