migrate to the new tiered structure

This commit is contained in:
Justin
2026-06-20 10:18:18 -04:00
parent 535c837dd3
commit 4b3df1ddae
17 changed files with 495 additions and 224 deletions

26
entrypoint.sh Executable file
View File

@ -0,0 +1,26 @@
#!/bin/bash
# This runs every time a container starts. Keep it generic — anything specific
# to a project (language versions, installing dependencies, and so on) belongs
# in that project's .safeclaude/hooks/, not here.
set -e
# Install Claude if it isn't already here. The home folder is saved between
# runs, so this only actually downloads the first time.
if ! command -v claude &>/dev/null; then
echo "[safeclaude] Claude Code not found — installing..."
curl -fsSL https://claude.ai/install.sh | bash
fi
# Run the project's setup scripts, in name order. They're read straight from the
# project folder, so editing one takes effect next launch — no rebuild needed.
# If a script fails we stop here, rather than start in a half-set-up container.
HOOK_DIR="/code/.safeclaude/hooks"
if [ -d "$HOOK_DIR" ]; then
for hook in "$HOOK_DIR"/*.sh; do
[ -e "$hook" ] || continue
echo "[safeclaude] hook: $(basename "$hook")"
bash "$hook"
done
fi
exec "$@"