Claude Code goes in through https://claude.ai/install.sh, matching what the
platform already does for members in os-user-claude.ts and chosen there for the
auto-update npm does not give. The comment at os-user-claude.ts:28 claiming
setup.sh already did this was simply wrong — setup-ubuntu.sh used
`npm install -g @anthropic-ai/claude-code`.
Two things that installer insists on, both of which a naive port gets wrong and
both of which os-user-claude.ts had already found:
It REFUSES to run under sudo from a regular user's shell — it checks for uid 0
with SUDO_USER set, because everything it writes goes under $HOME and under
sudo that is root's. This script runs as root, so the install has to be done AS
the account.
It declares #!/bin/bash and uses [[ … =~ … ]], so it must be piped to bash. On
Ubuntu /bin/sh is dash and `| sh` fails.
Two bugs found by running it rather than reading it:
opencode does not install to ~/.local/bin. It goes to ~/.opencode/bin, which is
what sidecar/opencode/index.ts:22 hardcodes. The first version looked in the
wrong place, reported a working install as missing, and installed it again —
the run said "did not complete" while the installer had plainly succeeded.
claude on this machine came from npm, so `command -v claude` found it and the
section would have left a copy that never updates. It now detects an npm
install by resolving the binary into node_modules, says so, and offers to
reinstall through the official installer — naming the npm copy and how to
remove it rather than deleting something it did not put there.
~/.local/bin and ~/.opencode/bin are both added to the account's PATH. The
sidecars do not need it — they check the exact paths — but a user who cannot run
`claude` in their own terminal reasonably concludes it was never installed.
PI stays optional and says outright that nothing in the platform spawns it.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>