diff --git a/.claude/hooks/session-start.sh b/.claude/hooks/session-start.sh new file mode 100755 index 0000000..ad2fab0 --- /dev/null +++ b/.claude/hooks/session-start.sh @@ -0,0 +1,25 @@ +#!/bin/bash +set -euo pipefail + +# Only run in Claude Code on the web; skip on local machines. +if [ "${CLAUDE_CODE_REMOTE:-}" != "true" ]; then + exit 0 +fi + +cd "${CLAUDE_PROJECT_DIR:-$(pwd)}" + +echo "[openboot session-start] Go version: $(go version)" + +# Pre-fetch and verify Go module deps so tests/builds are fast and offline-safe. +echo "[openboot session-start] Downloading Go modules..." +go mod download + +# Warm the build cache so the first `go build` / `go test` is fast. +echo "[openboot session-start] Warming build cache (go build ./...)..." +go build ./... >/dev/null + +# Warm the test binary cache without executing tests. +echo "[openboot session-start] Warming test cache (go test -count=0 ./...)..." +go test -count=0 ./... >/dev/null + +echo "[openboot session-start] Done." diff --git a/.claude/settings.json b/.claude/settings.json new file mode 100644 index 0000000..e06b033 --- /dev/null +++ b/.claude/settings.json @@ -0,0 +1,14 @@ +{ + "hooks": { + "SessionStart": [ + { + "hooks": [ + { + "type": "command", + "command": "$CLAUDE_PROJECT_DIR/.claude/hooks/session-start.sh" + } + ] + } + ] + } +} diff --git a/.gitignore b/.gitignore index 02b4404..c1a64f7 100644 --- a/.gitignore +++ b/.gitignore @@ -30,7 +30,10 @@ __pycache__/ # Work tracking (internal) .sisyphus/ -.claude/ +.claude/* +!.claude/hooks/ +!.claude/settings.json +.claude/settings.local.json # Go vendor (deps downloaded at build time) vendor/