diff --git a/.claude/hooks/inject-sprint-context.sh b/.claude/hooks/inject-sprint-context.sh new file mode 100755 index 00000000..da9b40f8 --- /dev/null +++ b/.claude/hooks/inject-sprint-context.sh @@ -0,0 +1,29 @@ +#!/usr/bin/env bash +set -euo pipefail + +cd "$CLAUDE_PROJECT_DIR" 2>/dev/null || exit 0 + +branch="$(git branch --show-current 2>/dev/null || echo unknown)" +recent="$(git log --oneline -10 2>/dev/null || echo '(git log unavailable)')" + +backlog_excerpt="(BACKLOG.md not found)" +if [ -f dev-docs/BACKLOG.md ]; then + # First 40 lines, capped at ~3500 chars to stay well under 600 tokens for the whole output. + backlog_excerpt="$(head -n 40 dev-docs/BACKLOG.md | head -c 3500)" +fi + +cat <