✨ feat: niyam's sessions run veda's released sarathi and kavach
Slice: #299
Auto-merge is off on purpose. On the desktop $CLAUDE_PROJECT_DIR is the main checkout, so every session on the new main runs the main checkout's .claude/hooks/sarathi.sh:
- Before Alok pulls main there, that file is missing, so new sessions get no niyam
session-start: no agent identity, and GitHub stays locked. - After the pull, sarathi.sh refuses every Bash call until the pin is installed.
So this merges only after Alok says he is ready to git pull and pnpm install in /Users/alok/code/athya/niyam right after it. Auto-merge goes on then.
What changes
@veda-hq/sarathi0.6.10, which carries kavach 0.6.10, pinned exactly. These are the latest releases..claude/hooks/sarathi.shis veda's file, copied verbatim. It loads sarathi only from$CLAUDE_PROJECT_DIR/node_modulesat the pin, never from source..claude/settings.jsonhas one sarathi entry per event: SessionStart (600 s) and PreToolUse on Bash (70 s). niyam'senvlock andpermissionsstay there..claude/sarathi.jsonholds niyam'ssession-start(600 s) andguard(Bash,failClosed) handlers, the wayniyam onboardwrites them since #318. kavach'scommandguard runs beside them on Bash. Run on these files, onboard 0.6.20'sclaudeSettings()changes nothing.pnpm checkrunspnpm hooks:check, which issarathi check --settings .claude/settings.json.
kavach's worktree guard stays off
I checked kavach 0.6.10's worktree_guard.py on sample calls:
niyam review-thread PRRT_… --reply "…"is let through, as aworktree.reviewedCLIsentry.- A Write to the session scratchpad is refused:
BLOCKED: mutation target /private/tmp/claude-501/…/scratchpad/x.md is outside this session's Claude worktree …; that is a system temp folder. - A Write to the side-session notes folder is refused:
BLOCKED: mutation target …/side-session-notes/…/x.md is outside this session's Claude worktree.
So there is no worktree guard and no .claude/kavach.json yet, as #299 records.
Checks
pnpm checkpasses on main 7eb6a31.niyam doctor(fromdist/) prints "All good".- I ran these through
sarathi hook PreToolUse: agh issue comment --body-file -heredoc,gh pr create,git push -u origin,niyam review-thread --replyandpnpm checkall pass, andgit push --no-verifyis refused.
Guards: package.json (its scripts), named in #299's Guards:. Alok re-approved #295 at 12:12:41Z.
🤖 Generated with Claude Code
Summary by cubic
Wires niyam's Claude sessions to run veda's released @veda-hq/sarathi 0.6.10 (with kavach 0.6.10), replacing the inline hooks in .claude/settings.json. Pins @veda-hq/sarathi 0.6.10 exactly; .claude/hooks/sarathi.sh (copied verbatim from veda) loads sarathi only from $CLAUDE_PROJECT_DIR's node_modules at the pin; niyam's session-start and guard handlers move to .claude/sarathi.json (as niyam onboard writes them), beside kavach's command guard; pnpm check now runs sarathi check --settings .claude/settings.json. kavach's worktree guard stays off as #299 records: 0.6.10 admits niyam review-thread --reply but refuses writes to the session scratchpad and side-session notes.
Rollout
- Auto-merge is off on purpose: on the desktop
$CLAUDE_PROJECT_DIRis the main checkout, so a merge before Alok pulls leaves sessions without a niyamsession-start, and after he pulls, sarathi.sh refuses every Bash call until the pin is installed. - Merge only after Alok is ready to
git pullandpnpm installright after in/Users/alok/code/athya/niyam. pnpm checkpasses on main,niyam doctorprints "All good", and PreToolUse runs ofgh issue comment,gh pr create,git push -u origin,niyam review-thread --reply, andpnpm checkpass;git push --no-verifyis refused.