You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
- Fix "durable object" → "durable stream"
- Replace compression example with rewind, fan-out, and
"ask without polluting history" use cases
- Add Scratch contexts subsection
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Copy file name to clipboardExpand all lines: website/blog/posts/2026-04-09-fork-branching-for-durable-streams.md
+7-3Lines changed: 7 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -18,9 +18,9 @@ A fork creates a new stream from any point in an existing one. It shares everyth
18
18
19
19
## Streams are sessions
20
20
21
-
Agent infrastructure is converging on a pattern: the session — the complete log of messages, tool calls, and decisions — lives in an a durable object that lives outside the agent itself. Anthropic's recent post on [Managed Agents](https://www.anthropic.com/engineering/managed-agents) describes exactly this architecture: an append-only session log that the harness writes to, reads from, and resumes after a crash. Durable Streams provide exactly this primitive.
21
+
Agent infrastructure is converging on a pattern: the session — the complete log of messages, tool calls, and decisions — lives in a durable stream that lives outside the agent itself. Anthropic's recent post on [Managed Agents](https://www.anthropic.com/engineering/managed-agents) describes exactly this architecture: an append-only session log that the harness writes to, reads from, and resumes after a crash. Durable Streams provide exactly this primitive.
22
22
23
-
A session log is linear but agent workflows aren't. An agent goes down a path that isn't working and wants to rewind a few turns. You want to preserve the full uncompacted history while compressing the working context. Multiple agents need to fan out from the same starting point. These all require the same operation that a linear log doesn't have: the ability to take the session at any point and diverge.
23
+
A session log is linear but agent workflows aren't. An agent goes down a path that isn't working and you want to rewind a few turns. Multiple agents need to fan out from the same starting point. You want to ask an agent a question without putting it in its history. These all require the same operation that a linear log doesn't have: the ability to take the session at any point and diverge.
24
24
25
25
## Fork: branching for streams
26
26
@@ -102,7 +102,11 @@ Fork the session once per agent. Each gets its own branch while the shared histo
102
102
<imgsrc="/img/blog/fork-branching-for-durable-streams/fork-parallel-paths-diagram.svg"alt="Parallel paths: a shared session forks into three agents, each pursuing a different strategy independently" />
103
103
</figure>
104
104
105
-
Fork also enables speculative work. An agent can branch into a scratch context to test a hypothesis or try a risky tool call without affecting the main session. If the result is useful, summarize it back. If not, the branch is just left behind — still there for debugging or audit, but with no effect on the source.
105
+
### Scratch contexts
106
+
107
+
Sometimes you need to interrogate an agent without changing its state. A developer debugging a misbehaving agent wants to ask "what do you think the user wants?" without that meta-question influencing the next real turn. A harness wants to test whether the agent can answer a factual question before committing to a tool call.
108
+
109
+
Fork the session, run the side conversation in the fork, read the result. The main session is untouched — no phantom turns in the history, no context pollution. If the answer is useful, the harness can bring it forward explicitly. If not, the fork is just abandoned.
0 commit comments