Skip to content

chore: add a SessionStart hook for Claude Code on the web - #71

Merged
bryanfawcett merged 2 commits into
mainfrom
claude/mzizi-skills-publishing-i1r02q
Sep 5, 2026
Merged

chore: add a SessionStart hook for Claude Code on the web#71
bryanfawcett merged 2 commits into
mainfrom
claude/mzizi-skills-publishing-i1r02q

Conversation

@bryanfawcett

Copy link
Copy Markdown
Contributor

Summary

  • Adds .claude/hooks/session-start.sh, run on SessionStart (registered in .claude/settings.json): pnpm install when CLAUDE_CODE_REMOTE is set, no-op locally. Lets Claude Code on the web run tests/linters immediately without a manual install step.
  • 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, per the existing convention.

Test plan

  • Ran the hook directly (CLAUDE_CODE_REMOTE=true ./.claude/hooks/session-start.sh) → exits 0
  • pnpm exec vp lint (nyuchi-docs-search) → clean after install
  • pnpm 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

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
@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Sep 2, 2026

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

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

@cloudflare-workers-and-pages

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

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

@cloudflare-workers-and-pages

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

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
bryanfawcett marked this pull request as ready for review September 5, 2026 16:46
@bryanfawcett
bryanfawcett merged commit 8d68ba9 into main Sep 5, 2026
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants