fix(01-02): resolve claude and env paths through symlinks

readlink -f ensures CLAUDE_BIN and env point to real nix store
paths accessible inside the bwrap sandbox.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Christopher Mühl 2026-04-09 11:14:50 +02:00
parent 14642eb32e
commit 9296453be3
No known key found for this signature in database
GPG key ID: 925AC7D69955293F

View file

@ -1,5 +1,5 @@
# Resolve claude binary from host PATH (before clearenv strips it)
CLAUDE_BIN=$(command -v claude) || {
CLAUDE_BIN=$(readlink -f "$(command -v claude)") || {
echo "error: claude not found in PATH" >&2
echo "Install Claude Code first: https://docs.anthropic.com/en/docs/claude-code" >&2
exit 1
@ -79,7 +79,7 @@ exec bwrap \
--ro-bind /etc/hosts /etc/hosts \
--ro-bind /etc/nsswitch.conf /etc/nsswitch.conf \
--ro-bind /etc/nix /etc/nix \
--symlink "$(command -v env)" /usr/bin/env \
--symlink "$(readlink -f "$(command -v env)")" /usr/bin/env \
--tmpfs "$HOME" \
--bind "$HOME/.claudebox" "$HOME/.claude" \
--ro-bind "$GITCONFIG_TMP" "$HOME/.gitconfig" \