VS Code sets `GIT_ASKPASS`, which simple-git rejects as unsafe unless `allowUnsafeAskPass` is enabled, breaking the agent hooks when run from a VS Code terminal. Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude Code hooks
This directory contains hook scripts that Claude Code invokes automatically at key points in a session.
Hooks
sessionstart-check.ts — SessionStart
Runs once on session startup, resume, clear, or compact.
Installs tools and dependencies so the session has a working environment:
mise install— installs language runtimes declared in.tool-versions/mise.toml. Failure is non-fatal (logs a warning and continues) so the session works even withoutmise.pnpm install— installs Node dependencies. Failure is fatal and blocks the session.
cwdchanged-check.ts — CwdChanged
Runs on every working-directory change, including EnterWorktree.
Install tools and dependencies in the new cwd, so the session has a working environment even when switching to a different worktree or subdirectory.
pretooluse-check.ts — PreToolUse
Runs before every tool call.
Blocks tool invocations that use forbidden package managers or test runners (e.g. npm, yarn, npx, jest directly) and requires pnpm / vitest instead.
stop-check.ts — Stop
Runs when Claude Code is about to stop.
Executes pnpm check --all against all files changed since the base branch. If the check fails, the stop is blocked and Claude is prompted to fix the issues before finishing.