Summarize a Too-Long Claude Chat and Hand It to a New One
When a chat hits its length limit, ask for a handoff note, check its numbers against the original with grep, then paste it into a new chat and keep going.
When one chat gets too long to continue, you have to move to a new one. Pull a summary first, and check it against the original before you rely on it.
[1] Work out which limit you hit. The official help pages separate them: usage limits control how much you can use Claude over a time period, and length limits relate to the context window, the amount of information Claude can work with in a single chat. For a length limit, the help page says to start a new conversation, or use projects for larger amounts of material.
[2] Window size depends on the model. The 2026-10 help page (chat, paid plans) splits models into 1M, 500K and 200K token windows. Which model falls where changes often, so check the help page.
[3] Ask the current chat for a handoff note. Fix the sections and make it list changed values separately. Otherwise the note keeps both the first value (500) and the later one (200).
This conversation is too long to continue. I will paste your summary into a new chat, so write a handoff note that lets a fresh assistant continue without me re-explaining anything. Rules:- Use exactly these sections: GOAL, DECISIONS (final values only), SUPERSEDED (values that were changed, with what replaced them), NUMBERS (every figure with its unit and what it measures), OPEN QUESTIONS, NEXT STEP.- Copy numbers, names and dates exactly as written. Do not round, do not add figures that are not in the conversation.- If something was never decided, put it under OPEN QUESTIONS, not DECISIONS.- Plain text, no preamble.[4] For the test, a 30-line made-up chat (chat.txt) covers moving a nightly invoice export to a queue worker. The batch size changes from 500 to 200, and the alert owner is never decided. Append the chat to the prompt and run it with claude -p. In claude.ai, send the same prompt at the end of that chat.
$ (cat handoff-prompt.txt; echo; echo "<conversation>"; cat chat.txt; echo "</conversation>") > prompt.txt$ claude -p --model claude-sonnet-5-5 --tools "" < prompt.txt > handoff.txt$ wc -l chat.txt handoff.txt 30 chat.txt 36 handoff.txtThe start of handoff.txt (abridged):
DECISIONS (final values only)- Queue: database queue, table jobs_export. No Redis.- Batch size: 200 invoices per job (91 jobs for 18,200 invoices).…SUPERSEDED (values that were changed, with what replaced them)- Batch size 500 (37 jobs) was replaced by 200 (91 jobs), because 500 per batch peaked at 610 MB on staging and the worker was killed.…OPEN QUESTIONS- Who owns alerting when a job fails 3 times: Dana from ops or the dev on call? Not decided. Ask Dana and decide before the production switch on 2026-11-12.[5] Check that every number in the note appears in the chat. Extract the number tokens, look each up with grep -F, and report only the misses.
#!/bin/bash# usage: check.sh chat.txt handoff.txtmiss=0for t in $(grep -oE '[0-9][0-9,.:-]*[0-9]|[0-9]' "$2" | sort -u); do grep -qF -- "$t" "$1" || { echo "NOT IN CHAT: $t"; miss=$((miss+1)); }doneecho "$miss not found"; [ "$miss" -eq 0 ]$ chmod +x check.sh$ ./check.sh chat.txt handoff.txt; echo "exit $?"0 not foundexit 0All 21 distinct number tokens in the note were in the chat. The failure output below comes from handoff-bad.txt, where 238 MB was changed to 283 MB by hand (the model did not get it wrong).
$ ./check.sh chat.txt handoff-bad.txt; echo "exit $?"NOT IN CHAT: 2831 not foundexit 1[6] Open a new chat and paste the note, with one line on top saying to continue from it. In the test, a fresh claude -p call got only the note plus one question.
Below is a handoff note from an earlier conversation. Continue from it. Do not ask me to repeat anything it already says. <handoff>(contents of handoff.txt)</handoff> Question: what batch size and bucket do we use in production, and how many jobs is that per night?Production uses a batch size of **200 invoices per job** and the bucket **`exports-eu-2`**. That gives **91 jobs per night** for 18,200 invoices (18,200 ÷ 200 = 91).It answered with the changed value 200, not the first 500, and with the production bucket, not staging. Ask about one changed value as your first question and you know at once whether the handoff worked.
[7] Files or images uploaded in the old chat are not in the note. Upload them again in the new chat.
In a Claude Code terminal session, use /compact instead of passing a summary by hand. See Claude Code Forgets Rules in Long Chats: /compact vs /clear. Checking quotes in a summary against the source is covered in Make Claude quote its sources, then check the quotes with grep.