From 9112f9e4460b8ca6c27766e69b344fc5bcdb6d08 Mon Sep 17 00:00:00 2001 From: claude-hdb Date: Mon, 13 Jul 2026 22:22:50 +0000 Subject: [PATCH] fix: make claude reachable from non-interactive shells in the box MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 'claudebox exec box -- claude --version' — the exact invocation the help promises — failed on the first live drill: the binary lands in ~/.local/bin, but cloud-init only exported PATH in .bashrc/.zshrc, which the non-interactive shell behind exec never reads (the box's login shell is zsh, so even sudo -i reads neither). A symlink in /usr/local/bin is on every shell's PATH, interactive or not. Found by the drill (#15). Co-Authored-By: Claude Fable 5 --- cloud-init/user-data.yaml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/cloud-init/user-data.yaml b/cloud-init/user-data.yaml index bd6f2bb..47d160f 100644 --- a/cloud-init/user-data.yaml +++ b/cloud-init/user-data.yaml @@ -49,6 +49,10 @@ runcmd: - curl -fsSL https://deb.nodesource.com/setup_22.x | bash - - apt-get install -y nodejs - sudo -u claude bash -lc 'curl -fsSL https://claude.ai/install.sh | bash' + # 'claudebox exec box -- claude …' runs through a NON-interactive shell, which + # reads no .bashrc/.zshrc — a PATH export there is invisible to it. The + # symlink makes claude reachable from every shell, interactive or not. + - ln -sf /home/claude/.local/bin/claude /usr/local/bin/claude - echo 'export PATH="$HOME/.local/bin:$PATH"' >> /home/claude/.bashrc - chsh -s /usr/bin/zsh claude - sudo -u claude bash -lc 'RUNZSH=no CHSH=no sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"'