- OpenClaw ships a new opt-in context mode for subagents.
- Clean isolated sessions stay the default; fork branches the requester transcript into the child when prior context actually matters.
- Here is what changed, when to use it, and the defaults you should know.
TL;DR
OpenClaw now lets subagents fork the requester's transcript on spawn. A new context field on sessions_spawn (and the /subagents spawn slash command) accepts isolated (default, clean child transcript) or fork (branches the parent conversation into the child before it starts). The docs are blunt: “Use fork sparingly. It is for context-sensitive delegation, not a replacement for writing a clear task prompt.”
What's new
Before this change, every subagent in OpenClaw started with a clean slate. If the child needed anything from the parent session — prior tool outputs, files the requester just read, a decision the user and agent agreed on — you had to re-brief it inside the spawn task string. That worked, but it was lossy and verbose.
The new mode flips that restriction into a first-class primitive:
context: "isolated"— default. Fresh child transcript. Lower tokens, stronger isolation.context: "fork"— branches the parent transcript into the child session before the child starts.
Same sessions_spawn call otherwise. It still returns immediately with { status: "accepted", runId, childSessionKey } and pushes the run into the subagent concurrency lane.
Why it matters
Clean isolation is the right default — it keeps bills down and stops context rot from propagating through a tree of agents. But there is a real class of tasks where the parent transcript is the brief: “summarize what we just figured out,” “continue the refactor using the plan we agreed on,” “write the PR description based on what the tests showed.”
Treating transcript inheritance as a configurable switch (instead of forcing devs to choose between re-pasting everything or giving up) matches how people actually delegate to colleagues — sometimes you want a fresh pair of eyes, sometimes you want someone who was already in the room.
Technical facts
Key parameters on sessions_spawn:
task— required, the work descriptioncontext—isolated(default) orforkmodel,thinking— per-run overridesrunTimeoutSeconds— abort after N secondsthread— opt into persistent Discord thread bindingcleanup—delete(archive immediately) orkeepsandbox—inheritorrequire
Defaults live under agents.defaults.subagents:
| Setting | Default | Range / notes |
|---|---|---|
maxSpawnDepth | 1 | 1–5, 2 recommended to enable orchestrator patterns |
maxChildrenPerAgent | 5 | 1–20, concurrent children per session |
maxConcurrent | 8 | global concurrency for the subagent lane |
archiveAfterMinutes | 60 | auto-archive finished subagent sessions |
runTimeoutSeconds | 0 | 0 = no timeout; set per spawn or globally |
Session keys follow a stable shape: main agents are agent:<id>:main, depth-1 subagents are agent:<id>:subagent:<uuid>, and depth-2 workers append another :subagent:<uuid>. Leaf workers never spawn further.
Model resolution order: explicit sessions_spawn.model > per-agent agents.list[].subagents.model > agents.defaults.subagents.model > requester's model.
Comparison
Other agent frameworks take different stances on parent context:
- OpenClaw before this change — always isolated. Devs had to bake everything into the task string.
- Claude Agent SDK's
Agenttool — subagents receive only the prompt, with an optionalworktreeisolation mode for filesystem. Transcript inheritance is not an option; re-briefing is the norm. - OpenClaw now — isolated by default,
forkas an explicit sharp tool. Closest to “branch the whole conversation” semantics.
The interesting choice is keeping isolated as the default. It signals that fork is power-user territory, not the happy path.
Use cases
- Context-sensitive handoff. “Draft the report from what we just discussed” — fork so the child sees the tool outputs and discussion that made the plan.
- Mid-thread continuation. User decides a background worker should take over. Fork preserves all the setup without a paste-dump.
- Orchestrator → worker with reasoning state. When the orchestrator's prior tool results are load-bearing for the worker's job.
- Still use isolated for: web research, broad searches, slow tool runs, anything briefable from a prompt. Smaller bills, no context rot, no accidental leakage of earlier private state.
Limitations & pricing
- Fork inherits tokens. That is the whole point, and also the whole cost. Forked children start heavier and grow faster.
- Announce is best-effort. The docs warn: “Sub-agent announce is best-effort. If the gateway restarts, pending ‘announce back’ work is lost.”
- Context-limit handling gap. Subagent sessions that hit the context limit get aborted (
abortedLastRun: true) rather than auto-compacted like main sessions — issue #6042 tracks this. - Auth is per-agent. Subagent auth resolves from the target agent's
agentDir, with main agent profiles as an additive fallback. Allowlist viaagents.list[].subagents.allowAgents(defaults to requester only).
What's next
The natural next step is context compaction for subagent sessions so forked children do not just die when they run long — that backlog item is already open. Until then, fork is the sharp tool: reach for it when prior transcript is the brief, and keep isolated as the default everywhere else.
Sources: OpenClaw Sub-Agents docs, openclaw/openclaw on GitHub, announcement tweet.
