Closing Ritual
Leave the work clean, verified, and handed off — so the next session (you or
anyone) resumes in one step and nothing rots between now and then.
This is universal. It is NOT tied to any one project. "Use the closing skill" runs
the same on a product repo, a skills folder, a one-off script — because the first move is
always: figure out which project this was and gather its documents. You don't carry
memory between sessions; the close re-grounds on the real artifacts every time.
Run these in order. Verify each with a command — never claim done from memory.
If a step can't be satisfied, name the gap explicitly; do not paper over it.
The checklist
Create a Codex task checklist item per step and work them top to bottom.
Locate the project & gather its docs. Establish what you were working in this
session: the git repo root (git rev-parse --show-toplevel from where the work
happened), or the working dir if it's not a repo. Then collect that project's
living documents — whatever it actually has: README, CHANGELOG, docs/, a
status/handoff doc (e.g. SOTU/NEXT_SESSION/PROGRESS/TO-DO), ADRs, a domain
index (e.g. SKILLS-INDEX.md for the skills folder), punch-lists. Don't assume a
doc set — discover it. State the project and the docs you found; this is the ground
truth the rest of the close reconciles against.
Merge & branch check. For every PR opened this session (in this repo), confirm
state is MERGED (gh pr view <n> --json state). Delete merged feature branches.
List any still-open PRs and say whose call the merge is. No orphan branches.
Tests green. Detect and run this project's test suite (e.g. npm test, pytest,
make test, a scripts/ check). Report the real pass count from the output, not a
remembered number. If the project has no suite, say so plainly and run whatever
verification does exist (scripts, linters, a manual exercise). If anything fails, stop
and surface it.
Session snapshot — context-keeper. BEFORE reconciling docs, write the append-only
flight recorder for THIS project: invoke context-keeper (it defaults to the
current repo's .codex/sessions/; it scaffolds the next-numbered file — fill its five
sections from this session's real history). The raw record runs first.
Docs zero-drift. Reconcile the project's living docs (gathered in step 1) to what
the code/state actually is now. Spot-check the claims that changed this session, or
spawn a verifier agent for a true zero-drift check; fix any drift. Use the
project-agnostic doc-keeper skill (it discovers and reconciles whatever docs
the project has); for the Tiger Claw repo use the specialized tiger-doc-keeper
(it knows that repo's SOTU/PROGRESS set + doc-CI guards). Leave evergreen process
docs (AGENTS.md / GROUND_TRUTH-style) alone.
Memory — local AND Jumbo, both, always.
6a. Local: write the session's durable facts to this project's memory files: what
shipped, key decisions and why, any new working rule. Convert relative dates to
absolute. Add/refresh the one-line pointers in MEMORY.md. Don't save what the
repo/git already records.
6b. Jumbo (shared memory): capture the same durable facts to Jumbo using this
harness's brent-dev-memory capture tool (MCP memory_capture, or the local capture
hook if MCP is absent) — one capture per fact-cluster, not one giant blob. Each
capture carries: what shipped with its receipt (sha/tx/UTC), decisions in Brent's own
words where he ruled, and any lesson worth other agents knowing. If this session
proved an existing Jumbo memory WRONG, supersede it (memory_supersede) so the stale
fact is retracted, never left beside the correction. Verify: the capture returns
accepted_ids — read them and list them in the close report. If Jumbo is
unreachable, say so loudly in the report (RED line) — a silent skip is a quiet state
and forbidden. Never store counts that rot; store the query that produces them.
Git clean. End on the project's default branch, pulled up to date, no uncommitted
changes. Confirm with git status --short --branch. (For a skills/library change,
"clean" means backed up too — see its own backup flow, never a direct push to main.)
Handoff. Write a short Resume here: where things stand + the single concrete
next step. Put it in the project's memory or a NEXT/handoff doc so it's found first.
Report. Give the operator one scannable close: the project, what shipped, the
verified test count, doc/memory/git state, open PRs (and whose call), and the next
step. State "done" only for what a command proved. Name any unverified gap plainly.
Honesty bar
This ritual exists to prevent silent rot and false confidence. A green claim without
command output is not done. If you didn't verify it, say so. If a step doesn't apply to
this project (no PRs, no test suite, no dashboard docs), mark it N/A with the reason —
don't fabricate an artifact to satisfy the step.
Scope
A wrap-up, not new work. Don't start features here. If the close reveals a real problem
(failing test, drift, un-merged work), surface it and let the operator decide — fixing it
may be its own task, not part of the close.
Codex Runtime
Write current session snapshots only under .codex/sessions/.
Treat historical .claude/sessions/ files as read-only evidence; never write new snapshots there.
Never expose or print secret, credential, or token values.
Mandatory dependencies:
target Git repository
repository test toolchain
Preflight each dependency using MCP/app capability discovery, CLI availability/version checks, read-only filesystem or Git checks for repositories, and provider auth-status commands without printing secrets, credentials, or tokens.
If any mandatory dependency is unavailable, stop and report a concise blocked state naming the missing dependency and the next action needed.
1---2name: closing-ritual3description: Run the end-of-session closing ritual on ANY project so a working session ends clean and verified — all work merged, tests green, the project's living docs matching the code (zero drift), durable state saved to memory, git clean, and a short handoff. Project-agnostic: it locates whatever project you worked in and gathers ITS docs (you don't remember anything between sessions — collect the real artifacts). Use when the user says 'close out', 'closing ritual', 'wrap up', 'wind down', 'end of session', 'let's call it', or is otherwise ending a session.4---56# Closing Ritual78Leave the work **clean, verified, and handed off** — so the next session (you or9anyone) resumes in one step and nothing rots between now and then.1011**This is universal.** It is NOT tied to any one project. "Use the closing skill" runs12the same on a product repo, a skills folder, a one-off script — because the first move is13always: figure out *which* project this was and gather *its* documents. You don't carry14memory between sessions; the close re-grounds on the real artifacts every time.1516Run these in order. **Verify each with a command — never claim done from memory.**17If a step can't be satisfied, name the gap explicitly; do not paper over it.1819## The checklist2021Create a Codex task checklist item per step and work them top to bottom.22231. **Locate the project & gather its docs.** Establish what you were working in this24 session: the git repo root (`git rev-parse --show-toplevel` from where the work25 happened), or the working dir if it's not a repo. Then **collect that project's26 living documents** — whatever it actually has: `README`, `CHANGELOG`, `docs/`, a27 status/handoff doc (e.g. `SOTU`/`NEXT_SESSION`/`PROGRESS`/`TO-DO`), ADRs, a domain28 index (e.g. `SKILLS-INDEX.md` for the skills folder), punch-lists. Don't assume a29 doc set — discover it. State the project and the docs you found; this is the ground30 truth the rest of the close reconciles against.312. **Merge & branch check.** For every PR opened this session (in *this* repo), confirm32 state is `MERGED` (`gh pr view <n> --json state`). Delete merged feature branches.33 List any still-open PRs and say whose call the merge is. No orphan branches.343. **Tests green.** Detect and run *this project's* test suite (e.g. `npm test`, `pytest`,35 `make test`, a `scripts/` check). Report the **real** pass count from the output, not a36 remembered number. If the project has no suite, say so plainly and run whatever37 verification does exist (scripts, linters, a manual exercise). If anything fails, stop38 and surface it.394. **Session snapshot — `context-keeper`.** BEFORE reconciling docs, write the append-only40 flight recorder for THIS project: invoke **`context-keeper`** (it defaults to the41 current repo's `.codex/sessions/`; it scaffolds the next-numbered file — fill its five42 sections from this session's real history). The raw record runs first.435. **Docs zero-drift.** Reconcile the project's living docs (gathered in step 1) to what44 the code/state actually is now. Spot-check the claims that changed this session, or45 spawn a verifier agent for a true zero-drift check; fix any drift. Use the46 project-agnostic **`doc-keeper`** skill (it discovers and reconciles whatever docs47 the project has); for the **Tiger Claw** repo use the specialized **`tiger-doc-keeper`**48 (it knows that repo's SOTU/PROGRESS set + doc-CI guards). Leave evergreen process49 docs (AGENTS.md / GROUND_TRUTH-style) alone.506. **Memory — local AND Jumbo, both, always.**51 **6a. Local:** write the session's durable facts to this project's memory files: what52 shipped, key decisions and *why*, any new working rule. Convert relative dates to53 absolute. Add/refresh the one-line pointers in `MEMORY.md`. Don't save what the54 repo/git already records.55 **6b. Jumbo (shared memory):** capture the same durable facts to Jumbo using this56 harness's brent-dev-memory capture tool (MCP `memory_capture`, or the local capture57 hook if MCP is absent) — one capture per fact-cluster, not one giant blob. Each58 capture carries: what shipped with its receipt (sha/tx/UTC), decisions in Brent's own59 words where he ruled, and any lesson worth other agents knowing. If this session60 proved an existing Jumbo memory WRONG, supersede it (`memory_supersede`) so the stale61 fact is retracted, never left beside the correction. **Verify:** the capture returns62 `accepted_ids` — read them and list them in the close report. **If Jumbo is63 unreachable, say so loudly in the report (RED line) — a silent skip is a quiet state64 and forbidden.** Never store counts that rot; store the query that produces them.65667. **Git clean.** End on the project's default branch, pulled up to date, no uncommitted67 changes. Confirm with `git status --short --branch`. (For a skills/library change,68 "clean" means backed up too — see its own backup flow, never a direct push to main.)698. **Handoff.** Write a short **Resume here**: where things stand + the single concrete70 next step. Put it in the project's memory or a NEXT/handoff doc so it's found first.719. **Report.** Give the operator one scannable close: the project, what shipped, the72 verified test count, doc/memory/git state, open PRs (and whose call), and the next73 step. State "done" only for what a command proved. Name any unverified gap plainly.7475## Honesty bar7677This ritual exists to prevent silent rot and false confidence. A green claim without78command output is not done. If you didn't verify it, say so. If a step doesn't apply to79this project (no PRs, no test suite, no dashboard docs), mark it `N/A` with the reason —80don't fabricate an artifact to satisfy the step.8182## Scope8384A wrap-up, not new work. Don't start features here. If the close reveals a real problem85(failing test, drift, un-merged work), surface it and let the operator decide — fixing it86may be its own task, not part of the close.8788## Codex Runtime8990Write current session snapshots only under `.codex/sessions/`.91Treat historical `.claude/sessions/` files as read-only evidence; never write new snapshots there.9293Never expose or print secret, credential, or token values.9495Mandatory dependencies:96- `target Git repository`97- `repository test toolchain`9899Preflight each dependency using MCP/app capability discovery, CLI availability/version checks, read-only filesystem or Git checks for repositories, and provider auth-status commands without printing secrets, credentials, or tokens.100If any mandatory dependency is unavailable, stop and report a concise blocked state naming the missing dependency and the next action needed.