chore: add a SessionStart hook for Claude Code on the web - #71
Merged
Conversation
Installs pnpm dependencies (pnpm install) at the start of a remote session so tests and linters work without a manual step. Only runs when CLAUDE_CODE_REMOTE is set, so it's a no-op locally. Carves an exception into .gitignore's blanket .claude/ exclusion for just this hook and its settings.json — everything else under .claude/ (CLAUDE.md, settings.local.json, skills) stays untracked as before. Validated: pnpm install exits 0; a lint (vp lint) and a test (vitest, nyuchi-docs-search) both pass afterwards. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01KQPxAPY7KvsN9WLbdLSQED
…actually works The previous commit's !.claude/hooks/ negation was silently defeated: .claude/ (trailing slash) is a directory exclusion, and git never descends into an excluded directory to evaluate further patterns for its children. It was committed with `git add -f`, which bypasses the check and papered over the bug — any new file added under .claude/hooks/ later would have needed -f again, every time. Switched to .claude/* (glob one level, not a directory exclusion), so specific children can be re-included. Verified: `git check-ignore` now reports no match for the hook files. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01KQPxAPY7KvsN9WLbdLSQED
Deploying with
|
| Status | Name | Latest Commit | Preview URL | Updated (UTC) |
|---|---|---|---|---|
| ✅ Deployment successful! View logs |
nyuchi-docs | 81b2441 | Commit Preview URL Branch Preview URL |
Sep 02 2026, 03:59 PM |
Deploying with
|
| Status | Name | Latest Commit | Preview URL | Updated (UTC) |
|---|---|---|---|---|
| ✅ Deployment successful! View logs |
shamwari-docs-ai | 81b2441 | Commit Preview URL Branch Preview URL |
Sep 02 2026, 03:59 PM |
Deploying with
|
| Status | Name | Latest Commit | Preview URL | Updated (UTC) |
|---|---|---|---|---|
| ✅ Deployment successful! View logs |
nyuchi-docs-mcp | 81b2441 | Commit Preview URL Branch Preview URL |
Sep 02 2026, 03:58 PM |
bryanfawcett
marked this pull request as ready for review
September 5, 2026 16:46
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
.claude/hooks/session-start.sh, run onSessionStart(registered in.claude/settings.json):pnpm installwhenCLAUDE_CODE_REMOTEis set, no-op locally. Lets Claude Code on the web run tests/linters immediately without a manual install step..gitignore's blanket.claude/exclusion for just this hook and itssettings.json— everything else under.claude/(CLAUDE.md,settings.local.json, skills) stays untracked, per the existing convention.Test plan
CLAUDE_CODE_REMOTE=true ./.claude/hooks/session-start.sh) → exits 0pnpm exec vp lint(nyuchi-docs-search) → clean after installpnpm exec vitest run tests/manifest.test.ts(nyuchi-docs-search) → 3/3 passed🤖 Generated with Claude Code
https://claude.ai/code/session_01KQPxAPY7KvsN9WLbdLSQED
Generated by Claude Code