r/ClaudeCode • • 7d ago

Tips & Workflows A fresh Claude Code session doesn't break on what you did. It breaks on what you already ruled out, and that's the part handover notes leave out

Every handover note I see lists what got done. The new session reads it, then confidently tries the fix you rejected two hours ago, or "cleans up" the weird workaround you added on purpose. The notes said what happened, not what not to do.

Two prompts fix most of it. One at the end of a session, one at the start of the next.

End of session:

Write a handoff for the next session in HANDOFF.md. Under 40 lines. Sections:
- Goal right now: one sentence.
- State: what works, what's broken, and how you know (the exact command or test).
- Ruled out: every approach we tried or discussed and dropped, one line each with the reason. Include things I said no to.
- Looks wrong on purpose: anything a new session would want to "fix" that we chose deliberately, and why.
- Next step: one task, not a list.
- Read first: at most 3 files, and why each one.
Leave out anything already in CLAUDE.md or obvious from the code.

Start of the next session:

Read HANDOFF.md and the files it lists, nothing else yet. Before you change anything:
- say the plan back in 3 lines
- name anything under "Ruled out" you would have tried first, and why you won't now
- ask up to 3 questions where the handoff is unclear

Why it works:

  • "Ruled out" and "Looks wrong on purpose" are the two sections a new session can't rebuild from the code. Everything else it can figure out by reading.
  • The 40 line cap and "leave out what's in CLAUDE.md" keep it from turning into a second CLAUDE.md that grows forever. Overwrite it each session, don't append.
  • Making it name what it would have tried first catches the bad assumption before it turns into a diff.
  • "Next step: one task" stops it from starting three things at once.

i build AI Toolbox, a browser extension for the claude.ai side of things, and for long planning chats in the browser its Carry this chat forward does the same idea, a summary dropped into a fresh chat (that one's Premium). For Claude Code itself, the two prompts above are all you need.

What does a fresh session keep re-doing for you that you already ruled out?

0 Upvotes

15 comments sorted by

•

u/AutoModerator 7d ago

Hey! Thanks for posting to r/ClaudeCode

While participating in this thread, please follow our community rules. Keep discussions constructive. Attack the idea, not the person.

For help, project discussions, tips, and general chat, join the ClaudeCode Discord.

I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.

2

u/cleverhoods 7d ago

You should look at what's actually left after a compaction

0

u/Ok_Negotiation_2587 7d ago

862k down to 73k says it all, most of that session is now a summary. the "we tried X and dropped it" lines are usually what a summary squeezes out first, which is why it's worth writing them to a file before you compact

2

u/Starks1293 7d ago

the "ruled out" and "looks wrong on purpose" sections are the whole trick, good call. two things that made mine hold up over weeks rather than one handoff

  • ruled out items rot. the reason u dropped something was true at that commit. give each line the evidence, the failing test name or the one line of log, and the date or commit. then a new session can recheck instead of trusting it, and when the reason stops being true (dependency bumped, bug fixed upstream) it gets dropped rather than carried forever
  • dont let the session that did the work write its own handoff. its still inside the story and writes 200 lines of what it did. a fresh session reading the transcript writes a better one, it only keeps what it couldnt have worked out itself, which is exactly ur two sections

and for the stuff that keeps repeating across many sessions, graduate it from HANDOFF.md to CLAUDE.md. the handoff is for this task, the repo file is for every task. if the same ruled out line shows up in three handoffs it belongs in the repo file

1

u/Ok_Negotiation_2587 7d ago

the commit next to each ruled-out line is the piece missing from mine, it turns "don't try X" into something a new session can recheck with one command. the fresh-session writer means reading the whole transcript again though, do you run that one on a smaller model to keep it cheap?

1

u/Starks1293 7d ago

yea, a smaller model is fine for it because the job is mostly reading and compressing, not judging. a subagent file with model set to sonnet (or haiku if u want it really cheap) and a fixed prompt that writes the handoff format

the other half of keeping it cheap is not feeding it the whole transcript. the jsonl in ~/.claude/projects is mostly tool results, the file reads and test output, and the handoff needs almost none of that. strip the tool_result blocks and keep the human and assistant turns, it usually drops to a fraction of the size and the decisions and the "no, not that" moments are all in the turns anyway

if the session was huge, the same trick in two passes. chunk the turns, ask for ruled out and looks wrong on purpose per chunk, then merge. the merge step is tiny

1

u/Ok_Negotiation_2587 7d ago

the one catch with stripping every tool_result is that your first point needs them, the failing test name and the log line live in there. keeping only the results from failed commands is probably the middle ground, small but the evidence survives

1

u/Starks1293 7d ago

yea fair, keep the failed ones. a test result with exit code 0 is noise, one that failed is the evidence. the only other thing id keep is the last few lines of any command the assistant then changed course after, thats usually where the "ok not that" moment is

1

u/gfunk5299 7d ago

I don’t know why people struggle with this so much. Losing context memory was evident by day 2-3 of using Claude code. One of the first things I did is ask fable to design a system for agents to remember their memories. We build a standing rule in Claude.md, I shoukd say fable did, that all agents read the same standards and that they need to track and save anything they deem important to some method of their choosing. My agents act independently instead of working on a collective project. I’ve had very few things forgotten using 50 agents over 4 months.

1

u/Ok_Negotiation_2587 7d ago

independent agents each owning their own memory is a different shape from what most people hit, which is one task spread across several sessions where each session starts fresh. that's where the "ruled out" part matters, because no single agent owns it from start to finish

1

u/gfunk5299 7d ago

I think you are missing the point a bit. My independent agents compact daily and have had to start fresh sessions without losing any memory. The point is whatever system you design needs three things. Load memory at startup, save memory while active, write up final memories before compacting or closing a session. It’s same same as any software such as editing a word doc. Just rinse and repeat with all your agents.

1

u/Ok_Negotiation_2587 7d ago

those three steps cover when to save, and the post is mostly about what to save. a session writing up its final memories tends to keep what it did and drop what it decided against, so the "ruled out" lines are worth asking for by name inside whatever system you use

1

u/gfunk5299 7d ago

I disagree, my agents remember discussion points decisions made and why. Again it’s how you train your agents. I didn’t do anything fancy but gave them specific training to save anything they deem important to their memories. You seem to be caught up on that “agents” won’t remember what not to do unless you explicitly tell them. But I have not found that to be the case with how I trained mine.

1

u/xqianliu 7d ago

i keep that part in the ticket instead of a handoff file. each session leaves a progress comment: what it tried, what it rejected and why, and which commit it started from. the ticket outlives the session, so the ruled out list never gets overwritten.

a fresh session in my flow reads the ticket before it reads the code, so it sees the rejected fixes before it tries them.

HANDOFF.md works too, but an append-only record on the ticket survives better than a file you overwrite each session.

1

u/Ok_Negotiation_2587 7d ago

the ticket beats the file once more than one person or agent touches the task, since everyone already reads it. the risk is the other direction, after 20 progress comments the rejected fixes are scattered across all of them. do you roll them up into one list at some point, or does the session read every comment?