close-session — Claude Code skill for session handoffs
This skill reviews a work session, updates project memory, and prepares a handoff. Run it when you’re wrapping up and want the next session to know where to pick up.
npx skills add awrshift/agent-memory-kit --skill close-session -a claude-codeWhat close-session does
The skill scans the session for useful observations and adds them to .claude/memory/MEMORY.md as dated lines under topic headings. It checks older entries for patterns seen on different dates, then asks before turning candidates into rules or knowledge articles. Repetition alone does not authorize a promotion.
It replaces the current-work summary at the top of MEMORY.md and fills out a handoff using context/handoffs/HANDOFF-TEMPLATE.md. The closing checks also cover project maps and backlog statuses. Plans, research findings, and QA records belong in the project folder rather than in memory.
What it helps with
- record session observations under relevant memory topics
- spot recurring patterns and request approval before promoting them
- refresh the current-work summary in
MEMORY.md - prepare a handoff for the next session
- check backlog statuses and project maps
Example prompts for the agent
- Run
/memory-kit:close-sessionand prepare a handoff for the next session. - Wrap up: review today’s observations and update project memory.
- We’re done for today; check for recurring patterns before closing.
How to install close-session
1Skills CLI (Vercel)
npx skills add awrshift/agent-memory-kit --skill close-session -a claude-code2Manually: put the files in place
~/.claude/skills/close-session/SKILL.mdCopy the whole skill folder; for one project use .claude/skills/close-session/
1Skills CLI (Vercel)
npx skills add awrshift/agent-memory-kit --skill close-session -a codex2Manually: put the files in place
.agents/skills/close-session/SKILL.mdFor all projects use ~/.agents/skills/
1Skills CLI (Vercel)
npx skills add awrshift/agent-memory-kit --skill close-session -a cursor2Manually: put the files in place
.cursor/skills/close-session/SKILL.mdCursor also reads .agents/skills/ and .claude/skills/
1GitHub CLI
gh skill install awrshift/agent-memory-kit close-session2Manually: put the files in place
.github/skills/close-session/SKILL.md1Skills CLI (Vercel)
npx skills add awrshift/agent-memory-kit --skill close-session -a gemini-cli2Platform CLI
gemini skills install https://github.com/awrshift/agent-memory-kit --path plugins/memory-kit/skills/close-sessionManually: put the files in place
.devin/skills/close-session/SKILL.mdThe legacy .windsurf/skills/ path still works
Skills CLI (Vercel)
npx skills add awrshift/agent-memory-kit --skill close-session -a opencodeClaude.ai
Zip the folder and upload it in Settings → Capabilities → Skills
Step by step, with commands for each platform: How to install skills in Claude Code: five ways
Questions about close-session
How do I install close-session in Claude Code?
Run npx skills add awrshift/agent-memory-kit --skill close-session -a claude-code. The skill file is available at ~/.claude/skills/close-session/SKILL.md.
What does close-session do?
It reviews session notes, refreshes MEMORY.md, and writes a handoff for the next session. It can suggest promoting recurring patterns, but needs the user’s approval first.
When can a memory pattern become a rule or concept?
The skill looks for a pattern recorded on at least three different dates and presents candidates for approval. It only writes a rule or concept after the user agrees.
Source text
SKILL.md · MIT
--- name: close-session description: End-of-session ritual — audit today's patterns against accumulated memory, propose promotions, refresh MEMORY.md, and write the session handoff. Use when the user says "/memory-kit:close-session", "закрой сессию", "закрываем", "we're done for today", "wrap up". allowed-tools: Read, Grep, Glob, Edit(.claude/memory/**), Edit(context/handoffs/**), Edit(knowledge/**) --- # /close-session — the end-of-session ritual You close the session in four steps. Don't just dump — **audit**. Everything you write, you announce briefly; anything promoted to rules/concepts needs the user's verbal "yes" first. ## Step 1 — Capture what's new Scan this session for observations worth keeping. Append each to `.claude/memory/MEMORY.md` as a ONE-LINE `[YYYY-MM-DD]`-prefixed entry. Short, scannable, no essays (long rationale belongs in a concept article, step 2). - **File each line under a TOPIC heading** of the patterns section (engineering, process, infra, the domain…) — create the topic if none fits. Never open a heading named after the session or the date (`### s66 (2026-09-25)`, `## Session 65 wrap`): the date lives in each line's prefix, the session narrative lives in the handoff (step 4). The SessionStart hook flags such headings. - **Don't capture what the always-loaded layer already says** (`CLAUDE.md`, rules without `paths:`) or a number whose source of truth lives elsewhere (a price table, a config) — point at the source instead of copying the value. ## Step 2 — Audit & promote (the valuable part) Read the date-tagged entries in MEMORY.md. Look for repetition: **did this pattern appear on 3+ different dates?** Surface 2-4 candidates, be specific: "noticed [date], [date], [date] you said X — codify as a rule or a concept article?" - User says yes → write `knowledge/concepts/<topic>.md` (facts + rationale; frontmatter per `knowledge/index.md` spec) or `.claude/rules/<name>.md` (mechanical always/never constraint; only for patterns stable 6+ months). Update `knowledge/index.md` (one line per concept). - Promoted or long-absorbed entries get PRUNED from MEMORY.md — that's how it stays under its caps (180 lines / 32 KB / 3000 chars per line). - Writing a fact into a second place? `reference/doc-governance.md` — one SSOT per fact, and when a fact changes you grep its restatements in the same pass. A product or architecture decision goes to the ledger instead — `projects/<name>/decisions-log.md`, format in `reference/decisions-log.md`. A plan, a spec, a research finding or a QA record is NOT memory: it belongs in that project's folder, per the map in its `README.md`. ## Step 3 — Refresh the MEMORY.md header The header (everything above the first `---`) is «current state of work», 2-3 sentences, **REPLACED** every close — never a chronicle of past sessions. Per-session detail lives in the handoff, not stacked in the header. ## Step 4 — Write the handoff Copy `context/handoffs/HANDOFF-TEMPLATE.md` → `context/handoffs/<topic>-<YYYY-MM-DD>.md` and fill its five sections (what was done · where things stand · memory updates · next steps · opening note). The SessionStart hook injects the newest handoff next time — this file IS the "remember where we left off" mechanism. ## Also check (30 seconds) - **Experiment hygiene:** any `experiments/*-YYYYMMDD/` older than 30 days → ask: still active or close (distill → delete)? - **Backlogs:** `projects/*/BACKLOG.md` task statuses reflect today's reality — a `DONE` nobody verified is still `IN PROGRESS`. - **Project map:** anything you wrote today into a project folder is a row in that project's `README.md` map, and the map's `Last verified` is today's date. - **Specs vs code:** any spec still `building` after a merge, or any `assumed` spec → run `/memory-kit:code-sync` (it reconciles statuses from repo evidence; this ritual does not). - **Caps:** if MEMORY.md is near any cap, do a deeper prune now, not "next time". ## What NOT to do - Don't promote without the user's yes. Repetition makes a CANDIDATE, not a rule. - Don't stack "Prior session" paragraphs in the MEMORY header — replace it. - Don't group today's lines under a session heading — see Step 1. - Don't write a handoff longer than ~1 screen (about 4,000 characters). It's a note, not a transcript. Session start injects 6,000 characters of it; the opening-note section always arrives whole, the rest is cut — so the next session's first move belongs in that section, not in step 4's list.
© awrshift · MIT · awrshift/agent-memory-kit