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.
This commit is contained in:
@@ -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):
|
||||
|
||||
- **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.
|
||||
|
||||
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.
|
||||
|
||||
```powershell
|
||||
# 'never' makes a bad token fail fast instead of opening a login window
|
||||
$env:GCM_INTERACTIVE = 'never'; git pull --ff-only
|
||||
```
|
||||
|
||||
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`.
|
||||
|
||||
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.
|
||||
If `git` isn't found, use `C:\Program Files\Git\cmd\git.exe`.
|
||||
|
||||
## What this is
|
||||
|
||||
|
||||
Reference in New Issue
Block a user