From 51dba047f343b1a17d5a99c7f01af131c9bd1a2d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christopher=20M=C3=BChl?= Date: Thu, 9 Apr 2026 11:11:44 +0200 Subject: [PATCH] feat(01-01): add claudebox.sh with bwrap sandbox, env allowlist, and secret hiding --- claudebox.sh | 88 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 88 insertions(+) create mode 100644 claudebox.sh diff --git a/claudebox.sh b/claudebox.sh new file mode 100644 index 0000000..8f9fca2 --- /dev/null +++ b/claudebox.sh @@ -0,0 +1,88 @@ +# Resolve claude binary from host PATH (before clearenv strips it) +CLAUDE_BIN=$(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 +} + +# Capture sandbox PATH (runtimeInputs-constructed) +SANDBOX_PATH="$PATH" + +# Record CWD +CWD=$(pwd) + +# Ensure ~/.claudebox exists +mkdir -p "$HOME/.claudebox" + +# Generate minimal .gitconfig (D-05) +GIT_NAME=$(git config --global user.name 2>/dev/null || echo "Claude User") +GIT_EMAIL=$(git config --global user.email 2>/dev/null || echo "claude@localhost") + +GITCONFIG_TMP=$(mktemp) +trap 'rm -f "$GITCONFIG_TMP"' EXIT + +cat > "$GITCONFIG_TMP" <