---
title: "Fork the workers, isolate the judges"
date: 2026-09-15
series: 23
summary: "Every subagent that starts from a blank context is a cost and safety decision, not a neutral default. LangChain just made it a one word flag per subagent. The question is which word for which role."
voice: architect
tags: [forked-context-subagent, prompt-cache-preserving-delegation, worker-vs-verifier-context-mode, supervisor-prefix-stability]
image: "/notes/forked-context-subagents/image.png"
imageAlt: "Comparison card: deepagents subagent context modes, isolated (default, fresh context, cold cache, for reviewer and researcher) versus fork (full supervisor state, shared prefix cache, for fixer and memorizer), with the byte-stable prefix trap"
linkedin: "urn:li:share:7505493891899457536"
sources:
  - title: "deepagents subagents now take mode: \"fork\" or mode: \"isolated\". Fork receives the supervisor's full state with the trailing tool call removed. Prompt caching is respected by design. Isolated subagents may redo file reads. Organizing context in a multi-agent harness, LangChain blog, Thushanth Bengre and Chester Curme"
    url: https://www.langchain.com/blog/organizing-context-in-a-multi-agent-harness
    date: 2026-09-08
  - title: "mode parameter, values \"isolated\" (default) and \"fork\". Forking needs deepagents 0.7.13 or newer and is in beta. deepagents subagents docs"
    url: https://docs.langchain.com/oss/python/deepagents/subagents
  - title: "Harrison Chase on X: \"forking subagents is a useful context engineering trick that is now built into deepagents.\""
    url: https://x.com/hwchase17/status/2097410530717704546
dateApprox: false
---

Every subagent that starts from a blank context is a cost and safety decision, not a neutral default. LangChain just made it a one word flag per subagent. The question is which word for which role.

What shipped in deepagents: each subagent takes mode: "isolated" or mode: "fork". Isolated, the default, is a fresh context with only the task. Fork hands over the supervisor's entire state, history included, cuts the trailing tool call and appends the task as a user message.

Fork is not the expensive one. The forked prompt shares the supervisor's prefix byte for byte, so prompt caching hits, provider side or prefix caching on your own SGLang or vLLM box. The isolated subagent starts cold and, as LangChain notes, often redoes file reads the supervisor already did. Measure on your stack, but don't assume the smaller prompt is cheaper.

My design doc rule: fork the workers, isolate the judges. A fixer or memory agent needs the history. A reviewer needs none of it. In a security pipeline it earns its keep twice: the reviewer doesn't anchor on the supervisor's conclusion, and doesn't inherit whatever an earlier tool result injected into context.

The trap: fork only stays cheap while the supervisor prefix is byte stable. One timestamp in the system prompt, a reordered tool list, or a summarization pass, and every forked subagent pays full prefill again.

Pin the supervisor prefix first, then pick the mode per role, and write both next to the tool permissions.
