session-close
Skill1 starsChanged 4 months agoMITView on GitHub
Use at the end of larger work to capture outcomes, fallbacks, durable learning, pending proposals, and next-load context without turning task logs into memory. Runs close v2 — the drafter subagent does the mechanics, the head approves + does the retro.
22 other projects use a version of this.
Adopted by
Most recently taken up by
- kimkon1011/orgiast-claude-rulestheir own version, first seen Nov 8, 2026
- paureis/pau-skillstheir own version, first seen Nov 8, 2026
- pankaj-mahaur/Agent-Daemontheir own version, first seen Nov 6, 2026
- NathanForster/claude-commandstheir own version, first seen Nov 1, 2026
- ngmeyer/skillstheir own version, first seen Nov 1, 2026
- albertomarturelo/siitheir own version, first seen Nov 1, 2026
Used with
Projects with it also use session-open and handoff.
Other files people use alongside this one.
Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
vishnujchandranSkillsession-open
Restart-safe session starter that restores context, validates readiness, and creates a focused execution plan for the current development session.
Also in 4 projects that use this
MicrosoftSkillhandoff
Compact the current conversation into a handoff document for another agent to pick up.
Also in 3 projects that use this
Other versions22 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 22
- albertomarturelo/sii★ 18same name
- tornikebolokadze1-cyber/agent-foundation-kit★ 6same name
- ngmeyer/skills★ 4same name
- paureis/pau-skills★ 2same name
- PUNCKe/manuscript-context-integrity★ 2same name
- toper2525ua-eng/claude-longrun★ 2same name
- vardan6/trackline★ 2same name
- AN0099/toothpaste-kit★ 1same name
- CorvusWing/CorvusWing★ 1same name
- NathanForster/claude-commands★ 1same name
12 more not listed
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository6 other files it gives its agents.
- capability-auditSkill
- capability-routingSkill
- memory-routingSkill
- no-silent-fallbackSkill
- skill-authoringSkill
- using-containerSkill
The file
We split this skill into the rules it gives an agent
2 rules. 0 are common, 1 is distinctive, and 1 is very specific to this project.
0
Common
Most of the 18 edited versions we read keep these.
1
Distinctive
This author's own choices. Worth a look.
1
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 15
Use full close when a workstream ends, pauses, changes direction, has multi-step work, produced fallback/durable learning, has open …
- Very specific: line 76
If a boot surfaces RECOVERY (an UNCLOSED marker from a session that ended with work but no close), recover it before starting new work: run …
“Common” is measured: kept by at least 6 in 10 of the 18 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Session Close (v2 — quiet close)
When To Use
Use full close when a workstream ends, pauses, changes direction, has multi-step work, produced fallback/durable learning, has open TodoWrite items, or the user asks for close/handoff. For small one-shot work without durable learning, a short normal final answer is enough.
Principle (v2)
The machine does the mandatory memory work; the head decides and approves. A close is no longer a
10-step manual ritual — the fmc-close drafter subagent does the mechanics and hands you a finished
DRAFT; you only review it, do the retro, and approve. This is why every session actually gets a
close (and why the next instance keeps getting smarter): the burden that used to be skipped now lives
in a subagent, not in the head's memory.
Flow
- Spawn the drafter (
fmc-close, NORMAL mode). It readssession.md+ git +todo.mdand produces the full draft: writesSTATE.md, compilessessions/YYYY-MM-DD-topic.md+ thelog.mdindex line, reconciles the ledger (strike done + carry open with--step), logs fallbacks, proposes durable lessons/decisions (approval-gated), and surfaces 2–3 retro candidates. It does NOT do the retro. - Review the draft — mainly
STATE.md. Would a cold next instance know what & why to do in 1 min? Edit if not. Roles never conflate:STATE.md=now (overwritten) ·log.md=archive (append) ·sessions/=per-session story ·todo.md=checklist. - Do the RETRO — this is YOUR job, not the subagent's (only the main head has the live context of
what was wanted and how it was meant). Start from the drafter's candidates, pass the session through
four lenses: MEMORY (docs/handoff structure), BEHAVIOR (recurring mistake / wrong assumption /
workflow step to change), SAFEGUARD (what to automate with a script/hook/lint/test), SKILLS (a
skill was missing · one underdelivered & how to improve it · a procedure learned, not yet a skill).
Learn from wins too: a pattern that worked → add a tagged line to
memory/todo.md:- [ ] CANDIDATE(win): <pattern> (occurrences: <date>). The 2-occurrence rule still applies (one win is an anecdote) — when the same pattern recurs, promote it to a rule/skill. (The kandidat script was retired; candidates now live as tagged todo lines.)- A lesson that should change behavior does NOT stay in KNOWLEDGE.md — promote it NOW into CLAUDE.md / a skill (the actively-read layer). KNOWLEDGE is raw material, not a graveyard. Capturing a just-executed pattern is a NOW job, not a "next fresh session" job — the context does not survive.
- Form-gate: each note is a HOW-TO ("this is done thus"), never a complaint. Don't self-edit governance — surface a proposal (type · target · reason · text/diff · awaiting approval), or say "retro: nothing" (anti-spam: propose only on a repeatable pattern).
- A proposal awaiting a HUMAN decision must NOT die as a passive carry line (that's where
approvals go to die — next boot it's just one row in a list). Write it as a PENDING item:
scripts/ledger_carry.sh --item "PENDING(<owner>): <WHAT I want> / <WHY you> / <impact of yes-no> (proposed YYYY-MM-DD)"— phrased humanly (what/why/impact), no tool-name shorthand. Thepending_injectboot nerve then announces it EVERY session start until the human resolves it (ledger_carry --done '<full item text>'). Same for any decision explicitly waiting on the human (direction picks, approval of canon/skill changes).
- Persist approved durable learning:
scripts/memory_route.sh --text "<note>" --kind lesson|decision --commit --approved-by <who> --reason <why>. Facts too, not only lessons: a durable fact that surfaced this session (an account name, a URL, an artifact location — "which GitHub account hosts the public repo") goes in as--kind fact— facts that stay only in chat/STATE are exactly the ones the next instance cannot recall (proven live 2026-07-15). - Settle the close-debt tracker:
scripts/close_state.sh --memory-dir ./memory --close-done --ledger-ok(--ledger-okasserts step 1's reconcile happened). Hook-driven modes resolve identity from an explicit--session-id, hook payload,$CODEX_THREAD_ID, then$CLAUDE_CODE_SESSION_ID; interactive--close-donehas no hook payload and uses the same order without that step. If no real identity is available, stop and surface the binding gap; never create or settle sharednosessionstate. Without this SessionEnd leaves an UNCLOSED marker that boot-recovery surfaces next start. - FMC self-report:
scripts/capability_report.sh --close --project-dir .shows which FMC nerves were WIRED this session vs. which are available but NOT turned on, and emits anADOPTION.md-ready line if a gap exists. This lets an adopter self-hail a hole instead of running half a container silently (an un-wired nerve is invisible until found by accident). On a fully-wired setup it just says "All wired".
Auto-recovery (advisory recovery) — an unclosed PRIOR session
If a boot surfaces RECOVERY (an UNCLOSED marker from a session that ended with work but no close),
recover it before starting new work: run the drafter in AUTO <SID> mode. It reconstructs that
dead session from the marker's ts-range over session.md + git, writes the draft labeled
"AUTO-RECONSTRUCTION — auto, unapproved", and clears that marker (--close-done --session-id <SID>). You
have no live context for it, so you do NOT invent a retro — the banner is the receipt; the next head with
real context validates it. /close --auto <SID> (SID from the boot queue) is the command.
Cross-platform honesty
The drafter is a subagent — active on Claude Code. On the Codex host subagents are spec-only, so
there session-close degrades to running the backbone scripts inline (session_close.sh,
ledger_carry.sh, fallback_log.sh, memory_route.sh) and writing STAV/sessions by hand — same
artifacts, no subagent. Do not claim a subagent close where the host has none.
(In Claude Code the scripts live at ${CLAUDE_PLUGIN_ROOT}/scripts/.)
Output
Container close (v2):
- Drafter: NORMAL | AUTO <SID>
- STATE.md reviewed/edited:
- Session record + log index:
- Ledger: struck / carried:
- Fallbacks / Durable learning committed:
- Retro (MEMORY/BEHAVIOR/SAFEGUARD/SKILLS — proposal awaiting approval, or "nothing"):
- Gate: close_state --close-done (0 ok):Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

