close-out
Session close-out procedure (the user says "start the close-out" or /close-out) — archive NOW.md + rewrite it from scratch, verify, lessons into RULES.md, tests, commit, resume_prompt.md.
SKILL.mdskills/now-kit/assets/template/claude/skills/close-out/SKILL.md
GitHub/close-out — session close-out procedure
Before the context fills up, when the user triggers it. Steps IN ORDER; [script] steps are commands, [assistant] steps are you.
If a step fails, stop and write the reason in one line; don't move on.
Windows: if python3 is missing or opens the Microsoft Store, run the same commands with py -3 instead of python3.
- [script]
python3 .claude/hooks/close.py archive→ copy ofNOW.mdatevidence/now_archive/<date>_NOW.md; "Dead ends" items + "Decision:" lines are appended toevidence/DECISIONS.md(never trimmed). Read thedecisions:line of the output. - [assistant] Self-review (goes into NOW, not the chat). Scale it to the session: for a simple session one honest line ("nothing suspicious; X deferred") is enough — don't invent worries. Ask: (a) What am I least sure of? (b) What did I not do, skip or assume? (c) If this breaks in 3 months, what is the most likely cause? For every (a)/(b) item write the command that would confirm or refute it; a doubt without a command is filler. Findings → NOW "Pending" / "MISTAKES I MADE"; DON'T try to fix them now (it derails the close-out).
- [assistant] Write
NOW.mdfrom scratch with the RULES.md §1 template:# NOW · <date> · commit <hash|none>+ 8 sections (Active task ≤2 · Next ONE step ≤3 · Pending ≤6 · Scheduled ≤2- YYYY-MM-DD: task· Background debt ≤3 · Dead ends ≤5 · MISTAKES I MADE ≤5 · Saved to memory ≤1). ≤40 lines. Forbidden: history, rationale paragraphs, tables, "LATEST", "(old:". History lives inevidence/INDEX.md. Write "Next ONE step" as if for someone who never saw this chat: file path + command to run + what counts as done. "Continue with X" is forbidden. - [script]
python3 .claude/hooks/now_check.py NOW.md→ if notOK, fix and rerun. - [assistant] Is every R-{{PREFIX}} receipt written this session listed in
evidence/INDEX.md? (grep -n "R-{{PREFIX}}-NN" evidence/INDEX.md) - [assistant] Lasting lesson (a recurring CLASS of mistake) →
RULES.md §6 MISTAKES I MADE(date + R-{{PREFIX}} pointer). First ask: where did the user correct me this session? Every correction becomes a lesson or a memory line, or the reason it doesn't is known. Machine/person specific things (file location, account, preference) →~/.claude/projects/.../memory/+ aMEMORY.mdline. DON'T copy project facts into MEMORY.md (they live in the repo). Thenpython3 .claude/hooks/memory_audit.py(read-only). If it saysMEMORY <N> warning(s), fix each one (update a dead path, merge duplicate notes, add the missing index line) or write in NOW "Pending" why it stays. - [script] If
tests/run.pyexists, run it (.venv/bin/pythonorpython3). If it fails, the close-out STOPS; fix it first. If there is no test folder, mark this step "no tests". - [assistant] Commit (if it's a git repo): only this session's files.
git add <files>andgit commitas SEPARATE commands; readgit diff --cached --statbefore committing — ifdata/,.xlsx,.pdf,.envor a token shows up, STOP.--no-verifyis forbidden. Push: only if the user asks. - [script]
python3 .claude/hooks/close.py finish --session "${CLAUDE_SESSION_ID}"→ verifies, writesresume_prompt.md, marks this session closed, prints a summary. - [assistant] One line to the user:
NOW.md <N> lines · commit <hash> · tests <result>+ BELOW it the FULL contents ofresume_prompt.mdin a code block (so it can be copied). Saying "ready" without giving it is FORBIDDEN. No narration.