diff --git a/.claude/hooks/session-start.sh b/.claude/hooks/session-start.sh new file mode 100755 index 0000000..e2289fa --- /dev/null +++ b/.claude/hooks/session-start.sh @@ -0,0 +1,10 @@ +#!/bin/bash +set -euo pipefail + +if [ "${CLAUDE_CODE_REMOTE:-}" != "true" ]; then + exit 0 +fi + +cd "$CLAUDE_PROJECT_DIR" + +pnpm install 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 ede23db..fa6e23a 100644 --- a/.gitignore +++ b/.gitignore @@ -25,5 +25,14 @@ pnpm-debug.log* # CLAUDE.md and .claude/ carry this repo's agent instructions, skills, # hooks and settings. They are deliberately untracked so `main` never # ships them; keep your own local copies for development. +# +# Exception: the SessionStart hook and its settings are tracked, so +# Claude Code on the web can install dependencies without a manual step. +# .claude/* (not .claude/): a trailing-slash directory exclusion stops +# git from ever descending into it, silently defeating the negations +# below. CLAUDE.md -.claude/ +.claude/* +!.claude/settings.json +!.claude/hooks/ +!.claude/hooks/*