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 description
  • contextisolated (default) or fork
  • model, thinking — per-run overrides
  • runTimeoutSeconds — abort after N seconds
  • thread — opt into persistent Discord thread binding
  • cleanupdelete (archive immediately) or keep
  • sandboxinherit or require

Defaults live under agents.defaults.subagents:

SettingDefaultRange / notes
maxSpawnDepth11–5, 2 recommended to enable orchestrator patterns
maxChildrenPerAgent51–20, concurrent children per session
maxConcurrent8global concurrency for the subagent lane
archiveAfterMinutes60auto-archive finished subagent sessions
runTimeoutSeconds00 = 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 Agent tool — subagents receive only the prompt, with an optional worktree isolation mode for filesystem. Transcript inheritance is not an option; re-briefing is the norm.
  • OpenClaw now — isolated by default, fork as 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 via agents.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.