20 — Context Transport

How agents switch between situations without losing state. Not a stack — a transport layer over the three externalizations defined in [Foundation…

How agents switch between situations without losing state. Not a stack — a transport layer over the three externalizations defined in coordination-topology">Foundation 07.

#Problem

A single session routinely traverses multiple contexts: you start on task A, discover it requires B, B raises question C. Each transition risks losing state. Current mitigations — spawning new sessions, posting to boards, holding everything in the context window — are either expensive (multi-agent overhead) or fragile (context window compression erases working state).

#Insight: the state is already there

The initial design proposed a separate "stack" structure with frames, cursors, push/pop operations. That over-engineers a new format for state that existing structures already carry:

Existing structureWhat it holdsAxis
Board (board.md)What's happening here, messages between agentsDomain
Index (index.md)What exists here, navigational structureDomain
TasksActive work items with statusMethod
Engagement state (TBD)Where are we in the procedureMethod
Trace (TBD)Where the agent has been, why it movedActor

What's missing isn't a storage format — it's transport: the mechanism for an agent to leave one situation and enter another cleanly.

#Design

#Context switch = checkpoint + engage

Switching context is the same operation whether the agent returns to the same situation or moves to a new one:

  1. Checkpoint — update the current domain's board with what you've done and what comes next. This is the write side.
  2. Trace — record the transition in the actor's navigation log: where you were, where you're going, why.
  3. Engage — load the new situation's board and index. This is the read side.

The agent doesn't carry state across the switch. All persistent state lives at the domain (board + index) or in the method (engagement state). The agent is stateless between situations; the trace records what the agent can't hold.

#The trace

Each actor-token maintains a log of its navigation. The trace is private to the actor — different agents at the same situation have different traces.

.claude/trace.md   (or per-session: .claude/traces/<session-id>.md)

Each entry records: timestamp, from-situation, to-situation, trigger (what caused the move). This creates a directed graph of the session's traversal.

11:00 whatsapp-import → iphone-extraction | need broader extraction plan
11:15 iphone-extraction → cloud-storage   | 309GB backup needs offsite
11:20 cloud-storage → context-stack       | noticed need for context management
12:30 context-stack → write-placement     | file misplacement connects to inscription

The trace serves two purposes:

  • Resume: agent reads its own trace to recall where it's been
  • Reconstruction: trace + boards + indices = lossless session recovery (Foundation 07 claim)

#Engagement state (third externalization)

The method-axis externalization — where are we in the procedure, what's been done, what comes next. This is the state that the old "stack frames" were trying to capture, but it belongs to the method, not to a separate stack.

Design TBD. The key constraint: engagement state must be readable by any actor that enters the situation, not just the one that wrote it.

#When to use subagents vs. context switch

Not every transition is a context switch. The decision depends on how much context you need:

ScenarioUse
Quick lookup, no shared state neededSubagent (isolated, fresh context)
Sustained work in new domainContext switch (checkpoint + engage)
Deep focus that would evict current contextNew session (fresh window)
Return to previous workEngage from trace

Subagents are for reads. Context switches are for writes that need persistence.

#Relationship to existing structures

StructureScopeExternalizes
Boardinter-agentcoordination messages, situation state
Indexnavigationalcontent structure, what exists here
Tasksflat listwork items
Memorycross-sessiondurable patterns
Session logpost-sessionarchival record
Traceintra-sessionactor navigation history
Engagement statecross-sessionmethod execution position

#Connection to HAAK thesis

Context transport makes human steering cheaper. Instead of re-explaining context after a switch, the human says "go back to X" and the agent engages, reads the board, and has the state. The intervention cost drops from explanation to selection.

#What's built, what's not

ComponentStatus
Board (checkpoint target)Built, active
Index (engage target)Built, active
Engage skillBuilt
Checkpoint skillBuilt (as /checkpoint)
TraceDesigned, not built
Engagement stateDesigned (Foundation 07), not built
Automatic checkpoint-on-exitNot built — /bye updates board but doesn't record trace

Architecture 20 — 20 — Context Transport — 2026 — Zachary F. Mainen / HAAK