Skip to content

fix: install claude-code to user home, not root on Incus#20

Merged
ethannortharc merged 1 commit intomainfrom
fix/claude-install-user-home
Mar 11, 2026
Merged

fix: install claude-code to user home, not root on Incus#20
ethannortharc merged 1 commit intomainfrom
fix/claude-install-user-home

Conversation

@ethannortharc
Copy link
Copy Markdown
Owner

Summary

  • On Incus, exec_cmd runs as root ($HOME=/root), so claude-code was installed to /root/.npm-global/bin/claude
  • Zellij panes run as the non-root user, so $HOME/.npm-global/bin/claude wasn't found — falling back to opencode
  • Fix: explicitly set HOME=/home/<username> during npm install so claude ends up in the correct home directory
  • Also chown -R the installed npm and nix-profile directories to the user

Test plan

  • cargo build + cargo test pass
  • Linux: devbox destroy --name test2 && devbox create --name test2 --tools rust,go — verify claude starts in Workspace tab

🤖 Generated with Claude Code

On Incus, exec_cmd runs as root ($HOME=/root), so npm installed
claude-code to /root/.npm-global/bin/. But Zellij panes run as the
non-root user, so $HOME/.npm-global/bin/claude wasn't found — falling
back to opencode.

Fix: explicitly set HOME=/home/<username> during the npm install so
claude ends up in the user's home. Also chown the installed files.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@ethannortharc ethannortharc merged commit fc59e2a into main Mar 11, 2026
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