Skip to content

Let the summary fork choose what a thread's summary folds - #6401

Merged
max-sixty merged 1 commit into
mainfrom
thread-summary-ui
Nov 18, 2026
Merged

max-sixty merged 1 commit into
mainfrom
thread-summary-ui

Conversation

@max-sixty

Copy link
Copy Markdown
Owner

In Claude Code, the fork that writes a long thread's summary folded exactly the range summary_hint picks, a cutoff on message count and length that ends before the last two turns and starts at the opening message unless an earlier summary left it out. Now the fork gets that range as a suggestion and answers with its own from and through, or {"fold": false}, by the agent's guidance for what to fold, which threads.md now states as a goal ("Fold what compresses most") and the fork quotes. Leaf takes a range that runs forward over spoken messages and ends before the user's newest messages; admission still applies the rule from #5531. Root AGENTS.md, "Leaf's role", extends "a reasonable choice is the agent's to make" to choices Leaf's code makes in the agent's place.

Worth weighing: the AGENTS.md sentence is maintainer direction. The fold-without-prose example in threads.md drops --label 'Previous progress messages', which under #6379's summary named the fold twice, and says --label is optional.

Max asked for this. Codex reviewed it twice; its three findings are fixed.

Tests: fork model tests and the Claude Code module test pass. Evals, base → head, 3 trials each: the summary fork kept the question its kept answer replies to in 3/3 (base folded it in 3/3; both passed the summary rubric), and in a new case where the newest message asks about the earlier claims, it folded nothing in 3/3 (base folded them in 3/3). The agent's own summary cases passed 12/12 on both arms.

This was written by Claude Code on behalf of max-sixty

In Claude Code a fork writes a long thread's summary, and it folded
exactly the range `thread_context.summary_hint` picks: the earliest run
of at least four unsummarized messages, or two or more holding 2,000
characters, ending before the last two turns. So a cutoff on the
thread's length decided what the user reads in full, and every long
thread folded its opening message unless an earlier summary had left it
out.

Max decided that what a summary folds is the agent's judgment, aimed at
compressing what compresses most, and asked that this be Leaf's general
principle. Now the fork gets the hint as a suggestion and answers with
its own `from` and `through`, by the agent's guidance for what to fold,
which it quotes from `threads.md` as it already quoted the guidance for
what a summary holds. It may also answer `{"fold": false}`, and Leaf
writes nothing. Leaf takes a range that runs forward over the thread's
spoken messages and ends before the user's newest messages, which the
main session answers; admission still holds it to the rule every summary
keeps, that no message but the opening one stands in full above a
summary (#5531). A range Leaf can't take goes to the agent with the
suggested range, as a failed fork does. The diagnostics note records the
suggestion beside the range the fork chose.

This reverses the call #6318 recorded, which kept the fork to the hint
because a fork offered the range's end once dropped the range's last
question from its prose. The guidance now names that case: keep in full
the question a kept answer replies to.

- `threads.md`, "Summarize a long discussion": the range choice is a
  goal paragraph, "Fold what compresses most", which the fork quotes.
  The fold-without-prose example drops `--label 'Previous progress
  messages'`, which under the new summary named the fold twice beside
  its count, and says `--label` is optional.
- Root `AGENTS.md`, "Leaf's role": "a reasonable choice is the agent's
  to make" now covers choices Leaf's code makes in the agent's place,
  as a fork's: Leaf offers evidence, the instructions state the goal.
- The fork eval shows its judge the suggested and the folded range, and
  its rubric asks that the range fold the settled discussion and that a
  kept answer's question is kept or stated.

Tests: the summary fork's model tests cover a range the fork chose past
the suggestion's end, one whose suggestion's end no longer stands, a
fork that folds nothing, and each range Leaf refuses (into the user's
newest message, backwards, a gap); the Claude Code module test answers
with a range.
@max-sixty
max-sixty merged commit 1edb002 into main Nov 18, 2026
5 checks passed
@max-sixty
max-sixty deleted the thread-summary-ui branch November 18, 2026 18:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants