From 1fee46ef36bcfa81d85f39e2ca9073d94194a887 Mon Sep 17 00:00:00 2001 From: Chris Meireles Date: Thu, 24 Sep 2026 14:58:08 -0400 Subject: [PATCH] CLAUDE.md: hand session sync to the hooks Pulling at session start and the commit/push reminder now run as hooks in Desktop\Claude\.claude (outside the repo). Claude only does them by hand in sessions opened elsewhere. --- CLAUDE.md | 34 +++++++++++++++++++--------------- 1 file changed, 19 insertions(+), 15 deletions(-) diff --git a/CLAUDE.md b/CLAUDE.md index 4a63777..59dd286 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -5,24 +5,28 @@ This repo is backed up to `http://10.3.8.90:3000/chris/AV-Watch` (private, branch `main`). The Git login is in Windows Credential Manager, not in this repo. -1. **Pull at the start.** Before starting on the first request of every session, - pull in the repo root (`C:\Users\Live Stream\Desktop\Claude\avwatch`): +For sessions opened in `C:\Users\Live Stream\Desktop\Claude`, hooks do the syncing +(`.claude\settings.json` and `.claude\hooks\avwatch-sync.ps1` in that folder, +outside this repo): - ```powershell - # 'never' makes a bad token fail fast instead of opening a login window - $env:GCM_INTERACTIVE = 'never'; git pull --ff-only - ``` +- **At session start** a hook runs `git pull --ff-only` and adds the result to your + context as "AVWatch SessionStart hook: ...". Don't pull again. If it says the + pull was skipped, mention that in your first reply, and don't stash, reset, + rebase or merge to get past it unless asked. +- **After each reply** a hook shows the user a one-line note while anything is + uncommitted or unpushed, so don't add a reminder of your own. Only commit or + push when asked. - Report the result in one line, then carry on with the request. If the pull - fails (server unreachable, local changes in the way, history diverged), say - why in that line and carry on. Don't stash, reset, rebase or merge to get past - it unless asked. If `git` isn't found, use `C:\Program Files\Git\cmd\git.exe`. +In a session opened anywhere else the hooks don't run, so do both by hand: pull +before the first request, and end any reply that leaves work uncommitted or +unpushed with a one-line reminder and an offer to commit and push. -2. **Remind before finishing.** When you finish a piece of work and `git status` - shows uncommitted changes or unpushed commits, end your reply with a one-line - reminder of what isn't on Gitea yet and offer to commit and push. Do the same - when the user says they're wrapping up. Only commit or push when asked, and - don't repeat the reminder if nothing has changed since the last one. +```powershell +# 'never' makes a bad token fail fast instead of opening a login window +$env:GCM_INTERACTIVE = 'never'; git pull --ff-only +``` + +If `git` isn't found, use `C:\Program Files\Git\cmd\git.exe`. ## What this is