explainx.ai0k
TrendingAI News TodayPathwaysSkills
Pricing
explainx.ai

Upskill in AI — 16 free pathways, live workshops & bootcamps, and 50+ courses from practitioners. Plus the skills, tools, and MCP servers to practice on.

follow us

follow on google

Add explainx.ai as a preferred source

corporate training

support@explainx.ai

get started

Find your pathTake Free Evaluation

community

Join the community

learn

mind: share how you thinkpathways — start freeworkshopsbootcampscoursescompare Explainxcertificationsmock testsexplainx universitycorporate traininglearn skills & mcp

discover

skillsmcp serversexplainx mcptoolsmdx readeragentsllmsdesignsdictionarypeopleagi trackerfelony benchranks

company

aboutvisionmissionteaminstructorsteach on explainxpartnershipscommunityhackathonscareers

content

daily AI newsstate of AI — live resultsblogreleasespromptsgeneratorsresource libraryfor LLMsexplainx.ai kids

solutions

all solutionsdeveloper upskillingmarketing upskillingproduct manager upskillingleadership upskilling

newsletter · weekly

Get AI news, tools, and insights in your inbox.

supportcontactprivacytermsdata rightshow we create contentsubmission guidelines

© 2026 AISOLO Technologies Pvt Ltd

explainx.ai

On this page

  • TL;DR: the questions people will ask
  • Why this matters for anyone building agents
  • What the paper actually found
  • How Fork-and-Flush works
  • The numbers
  • Why best-of-N is not the same thing
  • Does it get better with stronger models?
  • What to try in your own agent harness
  • Limits and open questions
  • Bottom line
  • Related reading
← Back to blog

explainx / blog

Fork-and-Flush: Why Clearing Chat History Helps Long-Running AI Agents

AI Agents, Research, Microsoft, Context Engineering, Agent Harness

Part of AI Agents

Microsoft researchers say long-running agents get stuck in idea basins. Fork-and-Flush clears chat context and beat best-of-4 by 44.4%. What to copy.

Oct 12, 2026·8 min read·Yash Thakker
add explainx.ai
go deep
Fork-and-Flush: Why Clearing Chat History Helps Long-Running AI Agents

Long-running AI agents do not just run out of context. According to a new paper, they also get stuck in the kind of solution they have already tried. Researchers including Microsoft-affiliated authors call these traps "idea basins", and their fix is to fork the agent into parallel branches that keep the files but forget the conversation. The method, Fork-and-Flush, beat a single run by 66.0% and a best-of-4 baseline by 44.4% at equal compute across 13 tasks, as The Decoder reported.

If you run coding or research agents for hours, this is a practical result: the cheapest intervention may be to clear the chat while keeping the work.

TL;DR: the questions people will ask

table · 2 cols
QuestionShort answer
What is the problem?Repeated runs of the same autoresearch agent on the same task plateau at very different scores (68.3 to 100.0 in one example), even with far more compute
What is the proposed fix?Fork-and-Flush: fork into K branches that inherit the workspace, flush each branch's chat context, continue from the best
How big is the gain?+66.0% over a single run, +44.4% over best-of-4, on min-max normalized average score over 13 tasks
Does flushing alone help?Yes, per The Decoder: average 0.45 to 0.55 on 11 tasks with no branching
Is it more consistent?Normalized standard deviation fell from 0.26 to 0.16
Is code available?No paper-specific repo is linked on the arXiv page
Who wrote it?Ziyang Cai, Christos Ziakas, Vasilis Kontonis, Tim Pearce, Siddhartha Sen, Akshay Krishnamurthy, Shivam Garg and Dimitris Papailiopoulos; affiliations are not listed on the arXiv abstract page
Weekly digest3.6k readers

Catch up on AI

Curated AI updates on agents, skills, and MCP — delivered to your inbox. Unsubscribe anytime.

Why this matters for anyone building agents

Most agent harnesses treat the transcript as the agent's memory and try to preserve it with summaries and compaction. This paper argues the opposite for long optimization-style work: the transcript is also a source of lock-in. Every earlier decision, justification and dead end sits in the prompt and nudges the next step toward more of the same. For teams paying for hours of agent time, that means the marginal token spent late in a long session may be worth less than a token spent in a fresh session over the same files. It also reframes parallelism: the value of running several agents is not only speed but diversity of approach, which is exactly what a shared long context erodes.

What the paper actually found

The study looks at "autoresearch" agents: systems that repeatedly propose a change, evaluate it against a score, and refine. Think of an agent that spends hours improving a scheduler, a packing algorithm or a cryptanalysis attack, saving files and results as it goes. It is the same loop pattern we cover in the loop engineering guide.

The authors ran the same agent on the same task eight times. Final scores landed anywhere from 68.3 to 100.0. Giving the runs much more compute did not close that gap. When they embedded the candidate artifacts by functional similarity, each run appeared to stay in its own small neighborhood of the solution space. That is the "idea basin": once an agent commits to an approach and the conversation fills with reasons why that approach is right, it keeps polishing instead of trying something different.

Long-running agent loop where the context window fills and idea basins form, shown for the Fork-and-Flush agent researchLong-running agent loop where the context window fills and idea basins form, shown for the Fork-and-Flush agent research

How Fork-and-Flush works

The method has two verbs.

  • Fork: the agent splits into K parallel branches. Each branch inherits the previous workspace, meaning code, files and saved results.
  • Flush: each branch discards its chat context. It starts a fresh conversation, but on top of the existing work.

After a fixed horizon the system picks the best-scoring branch and continues from it. The reported intuition is that branches that keep their old context tend to slide back into the same basin, while fresh context restores diversity. Because the workspace carries over, nothing learned in the files is lost.

Parallel branches diverging from one trunk, illustrating forking an agent workspace in Fork-and-FlushParallel branches diverging from one trunk, illustrating forking an agent workspace in Fork-and-Flush

This is structurally close to the Git-worktree pattern many Claude Code and Codex users already run by hand: several agents, same repo, separate sessions. If you use that setup, see our Claude Code commands reference for the building blocks.

The numbers

According to The Decoder's summary of the paper, the evaluation used 13 long-running tasks, including polyomino packing, job-shop scheduling and cryptanalysis, with GPT-5.6-terra and GPT-5.5 as the agent models.

table · 2 cols
MethodNormalized average score
Single run0.47
Best-of-40.54
Fork-and-Flush0.78

Other reported results:

  • Fork-and-Flush had the highest mean score on 12 of the 13 tasks.
  • Normalized standard deviation dropped from 0.26 for single runs to 0.16.
  • On 11 tasks, clearing context without branching raised the average from 0.45 to 0.55, about 22%.

A caution on reading these figures: they are min-max normalized per task, so they show relative ordering, not absolute quality. The 66.0% and 44.4% numbers are relative improvements on that normalized average, and we have only read the abstract and the secondary summary, not the full paper's appendix on limitations.

Why best-of-N is not the same thing

Best-of-N spends compute on N independent runs and keeps the top one. Each run still accumulates its own long conversation and drifts into its own basin, so you are sampling a handful of basins. Fork-and-Flush instead periodically branches from the best current state and resets the context, so later compute builds on earlier progress rather than restarting from nothing. That is why it can beat best-of-4 at the same budget: it reuses work and re-diversifies ideas.

Does it get better with stronger models?

The authors also tested how this variance changes with model capability, using MAX-3-SAT with Qwen3.5 at 4B, 9B and 27B. Run-to-run variance followed an inverted U: it peaked on tasks at the edge of a model's ability. Easy tasks are solved reliably and impossible ones fail reliably; the middle is where early choices decide the outcome. The authors expect this pattern to persist as models improve, because frontier agents will simply be pointed at harder tasks. That suggests periodic context resets may stay useful for frontier agents rather than being a workaround for weak ones.

A long context ribbon passing through an agent loop, representing why long-running agents benefit from context resetsA long context ribbon passing through an agent loop, representing why long-running agents benefit from context resets

What to try in your own agent harness

You cannot download the authors' implementation today, but the pattern is easy to approximate.

  1. Persist state outside the chat. Keep a notes file, a results log and the code in the working directory. A flush is only safe if the next session can reconstruct what happened from files.
  2. Reset on a schedule. After a fixed number of iterations or a plateau in the score, start a new session in the same directory with a short handoff summary rather than the full transcript.
  3. Fork when you have budget. Copy the directory into K worktrees, run each with a fresh session, and keep the best by your own evaluator.
  4. Tell the new session what failed, not why it was right. A handoff that rehearses the old argument can pull the agent right back into the basin.
  5. Always keep an objective score. The method relies on picking the best branch; without a trustworthy evaluator, forking just multiplies noise.

This lines up with other recent findings about what agents do and do not need to carry around. Our post on why agents need documentation more than memory makes the same bet from the other side: durable files beat long transcripts. For the cost trade-off of running several agents, see the Vals AI comparison of agent teams versus a single agent. And for how Microsoft's other agent research is positioned, see Agent Lightning v1.

Limits and open questions

  • Compute framing. The comparison is at equal compute, but wall-clock time, orchestration complexity and the cost of the evaluator are separate concerns. Forking K branches in parallel is faster per step than serial work only if you have the capacity to run them.
  • Evaluator dependence. All 13 tasks have a score. Open-ended work with no clean metric, such as most product coding, does not give you a branch-selection signal.
  • Task coverage. Packing, scheduling and cryptanalysis are optimization-style problems. Whether the same gains hold for multi-file refactors or agentic coding on messy repos is not shown by this summary.
  • No public code yet. Without a reference implementation, replication will vary by harness.
  • Model names. The model labels come from The Decoder's report; check the paper for exact configurations before citing them.

A related reminder from human-AI work: a Berkeley and CMU study found that people persist less after AI assistance, a different failure but a similar theme of getting stuck early in how a problem is approached.

Bottom line

The practical takeaway is modest and actionable: if an agent has been working for a long time and its score has flattened, start a fresh conversation over the same files before you throw more compute at the same context. Branching and picking the best result pushes the gain further. Treat the headline percentages as relative results on one benchmark suite from one paper, and watch for the authors' code release.

Related reading

  • Loop engineering for coding agents
  • Claude Code commands reference
  • Agents don't need memory, they need documentation
  • Agent teams vs a single agent: token cost and quality
  • Agent Lightning v1 from Microsoft
  • AI assistance and persistence study
  • Paper: Fork-and-Flush on arXiv

Figures and paper details are accurate as of October 12, 2026 and come from the arXiv abstract page and The Decoder's summary.

Spotted something out of date? Let us know.
Yash Thakker

Written by

Yash Thakker

Yash is an AI expert with over 300K learners. Join his workshops →

View Yash Thakker in People in AI →

Related posts

Oct 12, 2026

SelfCompact: Apple and Johns Hopkins Let Agents Decide When to Compress Their Own Context

A new Apple Machine Learning Research paper, written with Johns Hopkins, gives a model a compaction tool and a short rubric so it decides when to summarize its own context. Here is how it works, what the numbers say, and what to copy in your own agent harness.

Jun 29, 2026

Context vs Prompt vs Loop vs Harness Engineering: The Four-Layer Agent Stack

Most teams conflate prompt writing with context design, loop orchestration, and harness code. They are four layers of the same stack. Here is how they nest, what breaks when you skip one, and which layer to fix when agents fail.

Oct 12, 2026

DigitalOcean Signals and Simulations: Catching AI Agents That Fail Silently

DigitalOcean has launched Agent Learning Services: Signals watch live agent traffic for frustrated users and failing tools, Simulations replay scenarios in a sandbox to test fixes, and Agent Data Services stores traces. Signals, Simulations and Insights are in public preview.