Skip to content

feat(claude-code): add auto-update support for non-root users#6

Merged
pocky merged 1 commit into
mainfrom
feat/update-claude
Mar 4, 2026
Merged

feat(claude-code): add auto-update support for non-root users#6
pocky merged 1 commit into
mainfrom
feat/update-claude

Conversation

@pocky
Copy link
Copy Markdown
Contributor

@pocky pocky commented Mar 4, 2026

Summary

  • Enable Claude Code's built-in auto-updater for non-root container users by installing the binary to ~/.local/bin/claude (the path the updater expects)
  • Ensure ~/.local/bin is present in PATH for non-login shells so the user-local binary is picked up after auto-updates
  • Bump feature version to 1.2.0 to reflect the new capability

Changes

Claude Code Feature

  • src/claude-code/devcontainer-feature.json: Version bump 1.1.0 → 1.2.0
  • src/claude-code/install.sh: Add user-scoped install via claude.ai/install.sh when _REMOTE_USER is set and is not root, supporting both latest and pinned version installs
  • src/claude-code/link-claude-config.sh: Append ~/.local/bin to PATH in ~/.profile when the directory exists and is not already in the profile, enabling auto-updated binaries to be found in non-login shells

Test plan

  • Build the devcontainer with a non-root user and verify ~/.local/bin/claude exists after container startup
  • Run claude --version in a non-login shell and confirm the user-local binary is resolved
  • Trigger a Claude Code auto-update and verify it succeeds without permission errors
  • Verify root-user containers are unaffected (no user-scoped install attempted)

Generated with awf commit workflow

- `src/claude-code/devcontainer-feature.json`: bump version to 1.2.0
- `src/claude-code/install.sh`: install Claude via native installer for remote user to enable auto-updater
- `src/claude-code/link-claude-config.sh`: add ~/.local/bin to PATH in .profile for auto-update support
@pocky pocky marked this pull request as ready for review March 4, 2026 13:17
@pocky pocky merged commit e89626a into main Mar 4, 2026
4 checks passed
@pocky pocky deleted the feat/update-claude branch March 4, 2026 13:30
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