Repository navigation
Hand over to a fresh thread instead of compacting, with a handoff note kept from the first turn #20408
Replies: 3 comments
|
Update after three days of running this locally (16–19 Oct) As promised, here's how the local version went. Numbers come from the outcome log my
Three refinements to the proposal, from using it:
One small snag: threads launched through MCP have ids like |
|
+1, I'd like this too. One thought on where it lives: the composer already has the Compact chip with the token count (mine shows "Compact 309k" on a busy thread that never hit the idle trigger). That chip is already where you decide what to do about context, so the handover could sit there as a second option: "Compact" / "Continue in a fresh thread". That would cover your "Prepare handover" refinement without adding a new button anywhere else. |
|
Adding a data point from a different angle, in case it's useful. I run a twelve-phase project with one fresh thread per phase. Instead of an agent-written note at handover time, I keep a capped (10 KB) briefing file in the repo, updated after each finished task with the next task's details. A hook generates its status block (branch, recent commits, open tasks), so the volatile facts are never written by hand. That targets the kind of drift described in the update above, such as stale numbers. I measured it with replayed fresh-agent runs on one project. Starting a phase from the file used about 7,500 fewer tokens than rediscovering the repo from scratch, and took about half the time. Keeping it current costs roughly 1,000 tokens per update in a thread that already holds the file, so at around 11 tasks per phase it's close to break-even on tokens. The gains are mostly speed and consistent starts. It needs nothing from T3 Code. The one thing that would help is seeing how many tokens a new thread spent before its first useful action. Write-up with method and limits: https://www.akashdamle.in/blog/a-context-pack-for-ai-sessions-measured |
Uh oh!
There was an error while loading. Please reload this page.
Problem
T3 compacts a long Claude thread in one case: before my next message, once the thread has 100k+ tokens and has sat idle longer than the prompt-cache TTL.
To be clear about evidence: I haven't measured compaction dropping facts. The case is reasoning (a summary written once, after the fact, keeps only what that pass picks out) and per-turn cost.
Prior art, and what's different
What's different here:
Proposal
/compact.Compact(today) /Ask/Hand over.Askasks before sending: "This thread is at 180k tokens. Compact, or hand over to a fresh thread?" A busy thread could get the same question at the end of a turn once it passes a size threshold.What I'm running locally
Since agents can now launch T3 threads themselves, I'm trying a local version: rules in my agent instructions, a small
handoverscript that reads the transcript for context size and compactions, an ask/auto/off switch (default ask), and a Claude CodeSessionStarthook (matchercompact) that tells the agent to re-read the note after a compaction. I'll report how it goes.All reactions