From 416b68f7d2410aa9c79ea8ce2ce67c7184143be4 Mon Sep 17 00:00:00 2001 From: Bastien Chanot Date: Wed, 8 Jul 2026 15:58:00 +0200 Subject: [PATCH] =?UTF-8?q?fix(rtk):=20bridge=20~/.cargo/bin/rtk=20into=20?= =?UTF-8?q?~/.local/bin=20=E2=80=94=20compression=20was=20PATH-dead=20on?= =?UTF-8?q?=20develop?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Ports e58037c from release/1.0.0 (never back-merged). develop installed rtk via cargo (~/.cargo/bin) and checked 'command -v rtk' in the installer shell that sourced cargo env — so the check passed while Claude's tool shell never got the PATH, dropping every compound rewrite (measured on release audit: 6/5070 commands compressed over 30 days, ~460K tokens missed). Idempotent bridge symlink, self- repairs a stale link, skips when no cargo binary. Resolves BLK-016 on develop. Review A3. --- install-plugins.sh | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/install-plugins.sh b/install-plugins.sh index 36efd82..4f501ab 100644 --- a/install-plugins.sh +++ b/install-plugins.sh @@ -431,6 +431,19 @@ else cargo install --git https://github.com/rtk-ai/rtk fi fi +# PATH bridge: cargo installs to ~/.cargo/bin, which hand-managed shell +# profiles routinely lose (LRN-036 class). This installer sources cargo env +# so `command -v rtk` passes HERE — but Claude's tool shell never gets that +# PATH: the rewrite hook then drops every COMPOUND rewrite (it can only +# absolute-path the string head) and compression silently dies (measured: +# 6/5070 commands compressed over 30 days). ~/.local/bin is on the standard +# PATH — bridge with a symlink. Idempotent; -x on a broken link is false, +# so a stale link self-repairs. +if [ -x "$HOME/.cargo/bin/rtk" ] && [ ! -x "$HOME/.local/bin/rtk" ]; then + mkdir -p "$HOME/.local/bin" + ln -sf "$HOME/.cargo/bin/rtk" "$HOME/.local/bin/rtk" + ok "rtk bridged into ~/.local/bin (cargo bin dir is not on the tool-shell PATH)" +fi # Only init if not already configured (avoids overwriting custom RTK config) if ! grep -q "rtk" "$HOME/.claude/settings.json" 2>/dev/null; then info "Configuring RTK PreToolUse hook (global)..."