From 2433e74131582e7010fba4e561f40d793bdc5334 Mon Sep 17 00:00:00 2001 From: Craig Jennings Date: Tue, 2 Jun 2026 21:14:56 -0500 Subject: feat(flush): read notes.org before the anchor on resume On a flush resume, the SessionStart(clear) hook now reads .ai/notes.org key sections before the session-context anchor. The anchor carries session state. notes.org carries the project's standing knowledge (code-repo paths, conventions, key contacts) that a resumed session needs to act correctly. A resume with the anchor alone floundered on context notes.org already documents, hunting for a repo whose path notes.org records. The hook guards on notes.org presence: when it's absent, the resume reads the anchor alone. flush/SKILL.md documents the same read order so the skill and the hook agree. The handoff rationale is preserved in docs/design/2026-06-02-flush-promotion.org. --- flush/SKILL.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'flush') diff --git a/flush/SKILL.md b/flush/SKILL.md index d46c18b..4c2709a 100644 --- a/flush/SKILL.md +++ b/flush/SKILL.md @@ -72,9 +72,11 @@ That is the wrap/restart rhythm. When both conditions hold, run Phase 1 and end This half is driven by the `SessionStart(clear)` hook, not by this skill — but it is documented here so the loop is legible. -1. The user types `/clear`. The hook `~/.claude/hooks/session-clear-resume.sh` fires and injects "read the anchor, reply 'flushed.', resume" into the fresh context. +1. The user types `/clear`. The hook `~/.claude/hooks/session-clear-resume.sh` fires and injects the resume instruction into the fresh context. 2. The user sends any message (e.g. "go", "resume"). The injected context loads at `/clear` but the model waits for the user's next message before acting — that one keystroke is expected, not a bug. -3. The fresh agent reads the anchor, replies `flushed.` on its own line, restates the Active Goal and immediate Next Step, and continues. It does NOT run startup or re-sync anything — this is a resume, not a fresh start. +3. The fresh agent reads `.ai/notes.org` key sections (Project-Specific Context, Active Reminders, Pending Decisions) first, then the anchor, replies `flushed.` on its own line, restates the Active Goal and immediate Next Step, and continues. It does NOT run startup or re-sync anything — this is a resume, not a fresh start. + +The notes.org-before-anchor order matters: the anchor carries session-specific state, but notes.org carries the project's standing knowledge — code-repo paths, conventions, key contacts — that a resumed session needs to act correctly. Reading the anchor alone has led a resumed session to flounder on context notes.org already documents. When notes.org is absent, the hook resumes from the anchor alone. If the anchor is absent (a stray `/clear` with no prior flush), the hook instead points the fresh session at the startup workflow. -- cgit v1.2.3