š§ chore(claude): veda's session start clears a worktree-scoped core.hooksPath
Builds slice #425, approved by Alok's š on https://github.com/veda-hq/veda/issues/425#issuecomment-7084876550.
What: veda's session start now runs sarathi's worktree-hooks-path.sh first. It clears a worktree-scoped core.hooksPath in the session's own checkout, so the shared relative .githooks applies and the worktree runs its own branch's hooks.
Why: the Claude desktop app writes core.hooksPath = /Users/alok/code/athya/veda/.githooks into every worktree's config.worktree, at creation and when a session opens. Nine veda worktrees had it, and their pushes ran the main checkout's hooks. In the worktree that built #287, its pre-push stage never ran on a real push.
Changes:
.claude/sarathi.json: one SessionStart entry,bash "$SARATHI_HOOKS"/worktree-hooks-path.sh, with a 10 s timeout. The pinned sarathi 0.8.3 already ships the handler (#371, #380).scripts/sarathi-hook.test.mjs: a throwaway repository with a linked worktree.- A scoped absolute value goes through the real launcher and config, and
local .githooksis what is left. - A worktree with no scoped value is left as it is, and nothing is said.
- The advisor case now fires SessionStart from a scratch
cwd, so a local test run never clears a real worktree's config.
- A scoped absolute value goes through the real launcher and config, and
CLAUDE.md("Git hooks") anddocs/lessons/git-github.mddescribe the clear. A line still there after session start is still reported to Alok.
Not here:
- The app itself.
- A push-time check in
.githooks/pre-push, which is protected. .veda/required-settings.json, which is protected too.
Takes effect once the main checkout pulls this merge. A desktop worktree session reads .claude/ from the main checkout.
pnpm check passes locally.
Closes #425
Slice: #425
š¤ Generated with Claude Code