Skip to content

feat: switch Claude Code to native installer (self-updating)#69

Closed
itscooleric wants to merge 2 commits intomainfrom
feat/native-claude-install
Closed

feat: switch Claude Code to native installer (self-updating)#69
itscooleric wants to merge 2 commits intomainfrom
feat/native-claude-install

Conversation

@itscooleric
Copy link
Copy Markdown
Owner

@itscooleric itscooleric commented Mar 10, 2026

Summary

  • Replace npm install -g @anthropic-ai/claude-code@2.1.71 with the official native installer (curl -fsSL https://claude.ai/install.sh | sh)
  • Binary installs to ~/.local/bin/claude as the clide user — fully writable, self-updating at runtime
  • Eliminates the "auto-update failed — reinstall node without sudo or use native installer" error
  • No more version pinning or container rebuilds needed for Claude updates
  • Node.js + npm retained for Codex CLI and entrypoint config scripts

What changes

Before After
npm install -g @anthropic-ai/claude-code@2.1.71 (root-owned, update needs sudo) curl -fsSL https://claude.ai/install.sh | sh (user-owned, self-updating)
Binary at /usr/lib/node_modules/.bin/claude Binary at /home/clide/.local/bin/claude
Pinned version, bump ARG to upgrade Always gets latest on rebuild; auto-updates between rebuilds

Why this is safe

  • ~/.local/bin/claude (the binary) is separate from ~/.claude/ (the config/data dir that gets symlinked to /workspace/.clide)
  • PATH updated to include ~/.local/bin before other entries
  • Entrypoint scripts invoke claude by name (lines 141/144 in claude-entrypoint.sh) — resolves via PATH, no hardcoded path
  • Codex CLI stays on npm — unaffected

Test plan

  • docker compose build succeeds (native installer runs during build)
  • docker compose run --rm claude --version shows latest Claude Code version
  • docker compose run --rm shellclaude --version works
  • claude doctor reports no update issues
  • Web terminal (docker compose up web) → claude launches correctly
  • Auto-update succeeds when a new version is available

🤖 Generated with Claude Code

itscooleric and others added 2 commits March 8, 2026 19:16
groupadd fails with exit 4 if the GID already exists. Fall back to
renaming the existing group to 'clide' so the useradd step succeeds.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Replace the npm-installed Claude Code CLI with the official native
installer (curl -fsSL https://claude.ai/install.sh | sh).  This
eliminates the auto-update permission error that occurred because the
npm global prefix was owned by root while claude runs as clide.

The native binary at ~/.local/bin/claude is self-updating — no more
version pinning or container rebuilds needed to get new Claude releases.
Node.js is retained for Codex CLI and entrypoint config scripts.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@itscooleric
Copy link
Copy Markdown
Owner Author

Superseded by PR #78/#80 (v4 observability) which included the native installer.

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