Prompt for Claude Code and Cowork · version 1.0 · 23 October 2026

End Session

One prompt for the last message of every session: a complete check, so nothing learned in the session is lost. Afterwards a new session can go on from the files alone, without the old chat.

Close it properly, and tomorrow starts where today ended.

How it works

  1. Paste it as the LAST message of a session: always before you close, at once when about 20 % of the context is left before compaction, or when Claude shows an alarm (a summary of older messages, a wrong path, the same mistake twice).
  2. Claude lists everything the session did, decided and left open, compares it with CLAUDE.md, MEMORY.md and the session notes, and runs a health check. It changes nothing until you say "go".
  3. After your go it backs up each file, writes the changes in a safe order (session notes first, then MEMORY.md, then CLAUDE.md) and checks that no line was lost.
  4. It ends with "Safe to close: YES" or "NO – <reason>", and the exact first message for the next session.

What's inside

One prompt in six steps, with notes on when to use it:

  • Step 1: what happened in this session (tasks, files, new facts, decisions, drafts that must not be sent, open points)
  • Step 2: compare with the files (what is recorded, what is missing, what is out of date or in the wrong file)
  • Step 3: health check (sizes and limits, line endings, the search index)
  • Step 4: the proposal, line by line, before anything is written (also when MEMORY.md is full)
  • Step 5: after your go: backups, writing in a safe order, checking the result
  • Step 6: final report, "Safe to close: YES / NO" and the first message for the next session

Would you like the End Session prompt?

It is free under the MIT licence, in English, as a Markdown file. It is the complete version of Safe Start's Prompt D, it is also in the Safe Start zip, and the Close session button of the AI Usage Meter mod uses it.

Download End Session

A question or an idea about this prompt?

Your details are only used to answer you. See privacy.