fix(claude): stop native ~/.local/bin/claude shadowing the Alpine dispatcher - #1
Merged
Merged
Conversation
…op native shadow A native `claude` self-update (or bare-Termux install) drops a ~/.local/bin/claude ahead of $PREFIX/bin in PATH and silently shadows the Alpine dispatcher, so `claude` breaks while every other CLI keeps working (the "works for everyone but Claude" paradox). - install_claude_dispatcher: write the dispatcher to all three entry points (~/.local/bin, ~/bin, $PREFIX/bin) + a canonical copy under $PREFIX/libexec. - install_claude_session_guard: profile.d login-shell guard that reasserts the dispatcher if a self-update re-shadows it (zero-gap; heals on next terminal). - 50-persistence.sh: boot hook now reasserts the dispatcher on every boot in Alpine mode, in addition to the existing MLS relabel. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01RCBu9ooZapfHJLDy9MHTrs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
On Alpine-mode installs,
claudeis a thin Termux→Alpine dispatcher. But a nativeclaudeself-update (or a bare-Termux install) drops a~/.local/bin/claudethat sits ahead of$PREFIX/binin PATH and silently shadows the dispatcher — soclaudebreaks while grok/agy/codex keep working (the "works for everyone but Claude" paradox). The existing persistence hook re-labels MLS but never re-asserts the dispatcher, so it recurs on every Claude update.Fix
install_claude_dispatcher(lib/common.sh): writes the dispatcher to all three entry points a native install can occupy (~/.local/bin,~/bin,$PREFIX/bin), keeps a canonical copy under$PREFIX/libexec/root-aicli/, and re-applies Termux MLS.install_claude_session_guard(lib/common.sh): dropsetc/profile.d/root-aicli-claude.sh, a login-shell guard that reasserts the dispatcher if a self-update re-shadows it — zero-gap (heals on the next terminal open, as the Termux user, so context is inherited automatically).20-claude.sh: now calls both helpers instead of writing a single entry point.50-persistence.sh: the boot hook now reasserts the dispatcher on every boot in Alpine mode (in addition to the MLS relabel).Bionic/Path-B (native
claude) installs are unaffected — the dispatcher/guard/boot-reassert are all gated ondetect_runtime_preference = alpine.Testing
bash -npasses on all three changed shell files.clauderesolves to the dispatcher even with~/.local/binfirst in PATH.🤖 Generated with Claude Code
https://claude.ai/code/session_01RCBu9ooZapfHJLDy9MHTrs