Three slash commands that implement a surgical handoff system — so no session starts cold and no decision gets re-litigated from scratch.
Every time you start a Claude Code session, Claude wakes up with complete amnesia. The project you've been building for three weeks, the decision you made Thursday about why you're not using Redis, the half-finished design sitting in your last conversation — gone.
The reflex solution is to save everything. Dump the whole context into memory files. But that's just moving noise. Claude can't tell which of the forty remembered facts is the one that matters right now, and you end up re-litigating decisions you already settled.
When a surgeon hands off to another, they don't read the full patient chart — they write a one-page note: what changed on this shift, what decisions were made and why, what's still open. That's it. Everything else is reconstruction the incoming surgeon can do. These commands implement that system for Claude Code.
docs/sessions/ with a timestamp filename.The code shows you what was built. Only this document shows you why the obvious alternative wasn't chosen — and where to be careful even when nothing looks obviously wrong. Nine sections. Each one signals to Claude what's load-bearing so it doesn't have to infer.
IdempotencyKey model entirely · Switched to Stripe's built-in Idempotency-Key header · Updated payment_processor.rb · Removed migration (rolled back before drop)stripe_event_id is unique per logical charge attempt across retries — never explicitly verified against Stripe's retry docs, just inferred from observed staging behavior. If Stripe ever reuses an event ID across two distinct charge attempts, this strategy would silently swallow a legitimate second charge.Pass an argument to control how far back to look. For 3+ session files, /opening delegates to a subagent — the raw archaeology never enters your context window.
| Command | What it loads |
|---|---|
| /opening | Last session (default) |
| /opening 2 | Last 2 sessions |
| /opening today | All sessions from today |
| /opening last-week | Sessions from the past 7 days |
| /opening all | Every session — full arc |
| /opening summary | Every session as a narrative — "how did we get here?" |
| /opening search <question> | Searches history to answer a specific question — always delegates to subagent |
| /opening file <path> | Loads a specific session file directly |
The summary mode is what you want after a long break — it tells the story of how the project arrived at its current shape. The search mode finds specific decisions: /opening search why did we drop the webhook approach
One session document answers "what happened last time?" Thirty session documents answer a harder question: what is the accumulated state of all deferred work, locked constraints, standing assumptions, and fragile areas across the entire project history? The report collapses that into a single load — four sections, not two.
last_session cursor from the report frontmatter and only processes new sessions. At 20+ sessions you're not re-paying the synthesis cost on history already captured.Claude Code compacts automatically when the context window fills — and compaction is lossy. Don't wait until the end of a session to run /closing. These hooks automate the safety net.
/opening delegates to a subagent. The subagent reads all the documents and returns a finished synthesis — the raw archaeology never enters your context window. For /opening search, the subagent always runs regardless of file count, because question-answering across a history of decisions is exactly the kind of synthesis a subagent handles well.last_session cursor in the report frontmatter means you don't re-pay the synthesis cost on history already captured — subsequent runs only process new sessions./closing captures the handoff before it's lost. /opening reads the handoff and orients the new session in seconds. /report collapses accumulated sessions into one load when individual files become too many to read. Each command operates at a different time horizon — and together they cover the full lifecycle of a project that outlasts any single context window.Install globally — these commands are useful in every project, not just one. Claude Code picks up .md files in commands/ directories automatically.
~/.claude/commands/, hooks to ~/.claude/hooks/, and checks whether hooks are wired in settings.json — printing the required JSON if not. Existing files are overwritten without prompting./opening to start. The first session will tell you there are no previous sessions yet — run /closing before you end it.~/.claude/settings.json to enable the three-layer compaction defence.The commands are global (~/.claude/commands/). The output files are local to each project under docs/sessions/ and docs/reports/. Commit both to your repo — the session history and the report are the institutional memory of the project and belong in version control next to the code.
Simple Context Memory — by Robert Evans · github.com/revans/simple-context-memory · MIT License