Add SessionStart hook so tests/typecheck work in web sessions#178
Open
IanMayo wants to merge 1 commit into
Open
Add SessionStart hook so tests/typecheck work in web sessions#178IanMayo wants to merge 1 commit into
IanMayo wants to merge 1 commit into
Conversation
A fresh Claude Code on the web session starts with no node_modules, so yarn typecheck, yarn test and yarn build all fail (tsc/vite not found) until dependencies are installed. Add a synchronous SessionStart hook that runs `yarn install` and fetches the Chromium build the pinned @playwright/test version expects, so typecheck and the Playwright suite work out of the box in remote sessions. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016apmoXLgCfaB4NEFJZ64QM
Contributor
PR PreviewPreview deployment is ready! View Preview Last updated: 2026-06-25T20:30:08.730Z |
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.
What & why
The reported "CSS-import error failing tests /
yarn typecheckwas failing" turned out not to be a code bug. Onmain:yarn build,yarn build:standalone(CSS correctly inlined), andyarn typecheckall pass.tscdoesn't even resolve theimport './gramframe.css'side-effect import in a JS file (verified: renaming the CSS file away still passes typecheck), so the CSS import cannot cause a typecheck failure.The real cause: a fresh Claude Code on the web session starts with no
node_modules, so every command fails before doing any work —yarn typecheck→tsc: not found,yarn build→vite: not found, andyarn testadditionally needs a Playwright browser that matches the pinned@playwright/test@1.54.1(build 1181).Change
A synchronous
SessionStarthook that, in remote sessions:yarn installyarn playwright install chromium(fetches the build the pinned version expects)Files:
.claude/hooks/session-start.sh— the hook (idempotent, non-interactive).claude/settings.json— registers the hookValidation
yarn typecheckpassesThe hook is synchronous: it guarantees deps are ready before the agent starts (no race), at the cost of slightly slower session startup. Can be switched to async if faster startup is preferred. Once merged to the default branch, all future web sessions will use it.
🤖 Generated with Claude Code
https://claude.ai/code/session_016apmoXLgCfaB4NEFJZ64QM
Generated by Claude Code