$ cat stop-letting-your-ai-coding-sessions-die.md
Stop Letting Your AI Coding Sessions Die

I was deep into a Claude Code session, rebuilding an authentication flow for a product we are working on. We'd tried two approaches, rejected both for good reasons, landed on a third that worked, and figured out a weird edge case along the way. Real progress. Hard-won decisions.
Then I closed the terminal.
The next morning I opened a fresh session and loaded all the things one needs to do when startinga. new session. Yes, Claude has memory and yes there's project memories and yes, the setup is far from perfect. If you're using Claude Code, Cursor, Windsurf, OpenCode, or any AI coding terminal, you've felt this.
AI is really good at being a note-taker and recall. So I started asking it to write a summary before I closed out. Not bullet points. Not a changelog. A narrative of what actually happened, written like I'd tell a coworker about my afternoon.
That's the whole pattern..
You need three things: a directory, a prompt, and a habit.
The directory is just a folder in your project called session-logs/. Flat, no subfolders. Each file is a dated markdown file like 2026-03-22_1400_auth_flow_rebuild.md.
Wire this up as a slash command or skill. Here's what I use:
Review this entire session and write a narrative summary of what happened.
Save it as a markdown file in session-logs/ with this format:
Filename: YYYY-MM-DD_HHMM_brief_description.md
Structure:
# [Descriptive title]
**Date:** YYYY-MM-DD HH:MM
## What happened
[Write this as a narrative, like you're telling a colleague what we did today.
Include what we built, why, what approaches we tried and rejected, and any
surprising discoveries. 300-600 words. Prose, not bullet points.]
## Decisions made
- [Key decisions and the reasoning behind them]
## What's still open
- [Unfinished work, open questions, things to pick up next]
## Artifacts
- [Files created or modified, with paths]
The habit is the part that actually matters. When you're about to close a session, run the command. It takes about thirty seconds. The AI writes the summary, you skim it to make sure nothing's wildly wrong, and you move on.
Why narrative and not bullet points
I tried bullet points first. They're useless three days later. "Refactored auth module" tells you nothing about why, what you tried before that, or what tradeoff you made. It's like meeting notes that say "discussed roadmap" when what actually happened was a forty-minute debate about whether to cut the enterprise feature.
The narrative captures reasoning, not just outcomes. When you open a new session next week and say "read session-logs/ and tell me where we left off on auth," the AI can actually reconstruct the full picture. It knows you rejected approach A because of the token expiry issue. It knows you chose approach C because it played nicely with the existing middleware. That's the stuff that matters and the stuff you'll never remember to write down yourself.
Wiring it up in your tool
The copy-paste approach works fine. But if you want to make it a one-word command, every tool has a way.
In Claude Code, save that prompt as a file in .claude/commands/session-log.md and you can run /session-log at the end of any session. In OpenCode, it goes in .opencode/commands/. Cursor and Windsurf both support custom rules files where you can define similar shortcuts. Or just keep the prompt in a text file on your desktop and paste it. The mechanism doesn't matter. The habit does.
After a few weeks, your session-logs/ directory becomes something genuinely useful. It's searchable institutional memory for your project. You can grep it. You can point a new AI session at it for context. When someone asks "why did we go with approach X?" you can find the exact session where that decision was made, with the full reasoning attached.
I went a step further and built full-text search indexing over mine (SQLite FTS5, if you're curious). That's optional and kind of overkill for most people. The directory full of markdown files is already searchable enough with basic tools.
The real value shows up in ways I didn't expect. I've pulled decision rationale into product docs. I've gone back and found that one weird workaround I figured out two months ago that I definitely would have lost otherwise.
If you take one thing from this, let it be the habit, not the infrastructure. You don't need the perfect directory structure or the search indexing or the custom command. You need to ask your AI assistant "write a summary of what we did" before you close the terminal. Everything else is refinement.
Your AI coding sessions are full of decisions, context, and hard-won knowledge. Right now you're throwing all of that away every time you hit Ctrl+C. Stop doing that.
$ _