Skip to content

Conversation

@bijancamp
Copy link

Problem

Automatic updates fail when using a non-root user for spawning processes in the container (i.e., via the remoteUser setting in devcontainer.json).

When the container user is root, auto-updating works because the owner of the @anthropic-ai install directory (in npm root --global) is root:

drwxr-xr-x 3 root root 4096 Nov 27 05:38 @anthropic-ai

However, when using a non-root user (e.g., \"remoteUser\": \"vscode\"), the user no longer has write permissions to the directory, since the owner is root and the directory is not group-writable:

drwxr-sr-x 3 root   nvm 4096 Nov 27 05:48 @anthropic-ai

Feature installation scripts are run as root, so when the Claude Code process runs as the configured non-root remoteUser, Claude Code is prevented from updating its own installation.

Solution

Make Claude Code's install directory group-writable after installation. This approach is consistent with:

The change adds chmod -R g+rw to the @anthropic-ai directory after installation, allowing non-root users to get automatic updates for Claude Code.

Fixes #27

🤖 Generated with Claude Code

@bijancamp bijancamp force-pushed the claude-code-auto-update branch from 71a26b7 to 0cc2a25 Compare November 27, 2025 06:56
@bijancamp bijancamp force-pushed the claude-code-auto-update branch from 0cc2a25 to 40b06d4 Compare November 27, 2025 07:00
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.

Automatic update failed

1 participant