Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions .claude/hooks/session-start.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
#!/bin/bash
#
# SessionStart hook for Claude Code on the web.
#
# A fresh remote session starts with no node_modules, so yarn typecheck,
# yarn test and yarn build all fail (e.g. "tsc: not found", "vite: not found")
# until dependencies are installed. This hook installs them, and fetches the
# Playwright browser build that the pinned @playwright/test version expects so
# the test suite can run.
#
# Runs synchronously so dependencies are guaranteed ready before the agent
# starts. Idempotent and non-interactive.
set -euo pipefail

cd "$CLAUDE_PROJECT_DIR"

# Install JS dependencies (uses yarn's cache; safe to re-run).
yarn install

# Install the Chromium build that the pinned Playwright version needs so
# `yarn test` works. Skipped automatically if already present.
yarn playwright install chromium

echo "session-start hook complete: dependencies and Playwright browser ready"
14 changes: 14 additions & 0 deletions .claude/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"hooks": {
"SessionStart": [
{
"hooks": [
{
"type": "command",
"command": "$CLAUDE_PROJECT_DIR/.claude/hooks/session-start.sh"
}
]
}
]
}
}
Loading