SnackOnAI Engineering | Senior AI Systems Researcher | Technical Deep Dive | November 2, 2026
The promise: by the end of this issue you will understand how Mainplane splits an agent's brain from its hands across many computers, why its append-only sessions and /continue beat summarization on cost, and where its "no Tailscale needed" and machine-level security claims need reading closely.
The fence: we cover the Mainplane repository at v0.5.10 (230 commits from September 10 to November 1, 2026), its self-hosting and privacy docs, the harness system prompt, and two benchmarks for context: MemoryArena and OSWorld 2.0. We did not deploy a mesh; this is a source and docs read, plus our own cost modeling. Mainplane's hosted cloud is out of scope.
What It Actually Does
Mainplane is an agent harness: the loop around a model that calls the LLM, runs the tools it asks for and appends the results. Its twist is where things live. One always-on harness holds every API key, every session and the agent loop. Any number of workers, your laptop, a GPU box, a Mac Studio, a cloud VM, execute the tools. Agents reach them over a private WireGuard mesh.
Property | Value |
|---|---|
Language, license | Go (~27.7K lines), MIT |
Harness |
|
Workers |
|
Network | Self-hosted Tailscale-protocol mesh (forked |
Models | Anthropic, OpenAI, Google, Bedrock, OpenRouter, any OpenAI-compatible URL, plus ChatGPT and Claude subscriptions |
Tools | Three or four: |
Sessions | Append-only |
Shared files | NFSv4/SMB3 "drives" served by a Linux worker, mounted by all workers |
The bet is that agent progress now comes from infrastructure: persistent sessions, real machines and cheap continuation, rather than more prompt engineering.
The Architecture, Unpacked

Caption: The harness thinks and the workers act. Keys never leave the harness, and the only shared memory is files: append-only session logs and mounted drives.
Four design decisions matter most.
One: the session is a file. A .state file is an append-only stack of records (start, config, message, text, thinking, call, step, result, error). Each record is a JSON header line, a raw body of exactly len bytes, and a newline. The harness steps the file; it never rewrites history.
Two: no compaction, ever. Past context_limit the harness kills the session's processes, appends an error and marks it failed. /continue opens a new session whose first message points at the old one and tells the agent to retrieve what it needs.
Three: a tiny toolset. Every tool takes a worker argument. run executes code in a persistent interpreter (bash, pwsh or Bun JavaScript) on that machine; file tools read and modify files. Browser control is a CDP client in JavaScript, not a separate tool.
Four: the machine is the security boundary. An agent has full control of every worker its session names and no access to anything else. There is no per-command confirmation and no sandbox inside a worker.
The Code, Annotated
First, the entire tool surface, verbatim from pkg/harness/tools.go (trimmed).
run = provider.Tool{Name: "run", Description: "Execute code on a worker in the specified interpreter", ...}
write = provider.Tool{Name: "write", Description: "Write a file on a worker", ...}
edit = provider.Tool{Name: "edit", Description: "Edit a file with replacement on a worker", ...}
patch = provider.Tool{Name: "patch", Description: "Apply a patch in the apply_patch format on a worker", ...}
func Tools(name string, input []string) []provider.Tool {
read := provider.Tool{Name: "read", Description: "Read a file on a worker as text", ...}
// ← THIS is the trick: two tool sets, chosen per session, and every call names a worker
return map[string][]provider.Tool{"default": {run, read, write, edit}, "patch": {run, read, patch}}[name]
}
Caption: No browser tool, no search tool, no memory tool. A shell on the right machine plus file I/O covers everything, and fewer tool schemas mean a smaller, more stable prompt.
Second, what happens at the context limit, verbatim from pkg/harness/harness.go.
if p := statefile.ContextUsed(chain); p > conf.ContextLimit {
h.killAll(ctx, id, chain) // stop every interpreter and job the session started
_, err := h.append(s, errorRecord("", fmt.Sprintf("context %d exceeds limit %d", p, conf.ContextLimit)))
return statefile.StatusFailed, err // ← no summarize-and-continue: the session simply ends
}
Caption: A hard wall instead of a lossy summary. Because nothing is ever rewritten, every step's prompt is a pure extension of the last one, which keeps provider prompt caches warm.
Third, /continue, verbatim from pkg/connector/tui/commands.go.
func (s *session) continueAs(a *App, cf statefile.Conf, p *catalog.Cost) {
to := newSession(a, s.list, "")
to.cfg, to.price, to.started = &cf, p, true // same model, workers, limits
to.input.Clear()
to.input.Attach("[continue session "+s.id+"]",
"You are continuing session "+s.id+". Retrieve key context from it as you go.") // ← retrieval, not summary
...
}
Caption: The entire continuation mechanism is one sentence. The heavy lifting moves to the agent, which greps the old session's .log copy with rg when it needs something.
Fourth, driving a Claude subscription without letting Claude Code act, verbatim from pkg/provider/claudecode.go (trimmed).
"DISABLE_AUTO_COMPACT=1", // Mainplane owns context policy, not Claude Code
"DISABLE_COMPACT=1",
"CLAUDE_CODE_DISABLE_CLAUDE_MDS=1", // AGENTS.md is the harness's job
"CLAUDE_CODE_DISABLE_AUTO_MEMORY=1",
}
// stopHook is the PreToolUse answer: deny the call and end claude's turn, so
// no tool runs and no second request goes out.
const stopHook = `{"continue":false,"stopReason":"mainplane runs tools", ...}` // ← Claude proposes, Mainplane executes
Caption: One claude -p per step, a hook that blocks every tool call, and the call handed back to the harness to run on the right worker. Claude Code becomes a model client; the docs say to use it only on a harness you host for yourself.
Fifth, our cost model of append-only sessions.
# each step re-reads the whole prompt; assume +3K tokens per step, 15K starting context
# limit 250K: ~78 steps, 10.4M cumulative prompt tokens ( 1.0M full-price-equivalent at 90% cache discount)
# limit 500K: ~161 steps, 41.5M cumulative prompt tokens ( 4.2M)
# limit 1,000K: ~328 steps, 166.8M cumulative prompt tokens (16.7M)
# doubling the limit: 2.1x the steps, 4.0x the reads (quadratic)
# 250K session + /continue (≈10K retrieved) + 250K session: ~153 steps, 20.8M reads → 50% fewer than one 500K session
Caption: Context cost grows with the square of session length. A hard cap plus a cheap fresh start buys the same number of steps for half the tokens, before counting a summary's information loss.
It In Action
Input: from the terminal app on a laptop, the message "Move the Qwen fine-tune from the GPU server to the Mac Studio and quantize it to run there." The session config names three workers.
echo '{"model":"openai/gpt-6.1-sol","tools":"patch","context_limit":250000,
"workers":[{"name":"admin"},{"name":"gpu"},{"name":"mac"}]}' | mainplane new
mainplane chat
Step one, open. The harness appends a message record (via the connector), then a system record listing the connected workers and their drives. Every root AGENTS.md on every worker and drive is read whole at session start.
Step two, act on the right machines. The model calls run with worker:"gpu" to find the checkpoint, then run on mac to pull it over the mesh by name (gpu--home.mainplane.net, IPv6 only, direct UDP or relayed through the harness at about 40 ms extra). The quantization runs as a background: true job on mac: no 10-minute timeout, output to <scratch>/jobs/<call id>.log, and a via job message wakes the session when it exits.
Step three, budget. Every tool result ends with a footer such as time 3m12s context 48210, so the model always sees how close it is to the limit. Results over 50 KiB or 2,000 lines keep their tail; the full output goes to a scratch file.
Step four, close. When the model replies with no tool calls, the session closes. Its .state is copied to each worker as <scratch>/logs/<id>.log, with media bodies removed.
Step five, continue later. A follow-up session three days and 250K tokens later starts with [continue session <id>]. The agent runs rg -n "q4_K_M" logs/<id>.log, finds the record (the nearest {"n": line above the match is its header), and resumes at roughly 15K to 25K tokens of context instead of 250K.
Output: a quantized model on the Mac, a complete audit trail in one append-only file, and no lossy summary anywhere in the chain.
Mechanism | Limit or behavior (from source and docs) |
|---|---|
| 10 minutes default, or |
Tool output clip | 50 KiB or 2,000 lines (run keeps tail, read keeps head) |
Context limit | Set per session; catalog presets cap at 250K |
Quick tunnel capacity | 200 concurrent requests: about 95 workers (2 each) |
Relay penalty | About +40 ms through a quick tunnel when direct UDP fails |
Device-code guessing | 30 tries per minute per address, CPace exchange |
Caption: The scenario mirrors Mainplane's own README demo; the commands, record formats and limits are from the repo.
Why This Design Works, and What It Trades Away
Why it works. Separating the control plane from execution mirrors how infrastructure already works: one place holds secrets and state, many machines do work. An append-only log makes sessions auditable, forkable (/fork, /rollback) and cache-friendly, because the request prefix never changes. Refusing compaction keeps the full record available: the agent can always go back to exact tool output instead of a model's paraphrase of it. And reusing Tailscale's battle-tested client gives NAT traversal and WireGuard without inventing networking.
What it trades away.
Recall is now the agent's job.
/continueworks only if the model searches well. A summary is lossy but always present; retrieval is exact but only when the agent thinks to look.Whole-machine trust. Agents get full control of named workers, with no confirmation step. The
adminworker created by the quickstart can read the harness config, including provider keys, unless you install with--no-admin.Default privacy. Through a Cloudflare quick tunnel, TLS ends at Cloudflare, which can read API keys, prompts, command output and files between connectors and the harness. Your own URL removes that. Worker-to-worker traffic stays WireGuard-encrypted.
Root on workers.
mainplanedruns as root for the interface, routes and hosts file.Young, single-maintainer code. 224 of 230 commits come from one author, pull requests are collaborators only, and the repo has no unit test files: correctness rests on a 1,300-line end-to-end release gate that installs, upgrades and downgrades real Linux, macOS and Windows machines.
Technical Moats
Cross-platform systems work. TUN interfaces on three operating systems, NFSv4/SMB3 drives with lease tuning, Windows
wintun.dllpinning, macOS signing so privacy grants survive updates, and dozens of OS-specific fixes in the changelog. This is the unglamorous part competitors underestimate.Provider breadth with subscription support. Five API shapes plus ChatGPT and Claude subscriptions, with the Claude path implemented by driving the official binary under a tool-blocking hook.
A real release gate. Every release candidate wipes real machines, installs the previous version with live sessions, upgrades, downgrades and checks the mesh before it is tagged stable.
Opinionated defaults. A short system prompt that tells the model exactly what the harness enforces: limits, footers, lock semantics on drives, IPv6-only networking.
Insights
Insight One: "No Tailscale needed" means no Tailscale account, not no Tailscale. Mainplane's go.mod pins tailscale.com v1.102.4, replaced by a fork (mainplane-ai/tailscale v1.102.4-mainplane.8), and its coordinator is "copied from headscale's hscontrol" and trimmed to registration, maps, keepalives and deltas. In other words, every Mainplane network is a private, self-hosted tailnet speaking Tailscale's ts2021 protocol. That is the right engineering call: Tailscale's NAT traversal and DERP-style relaying are hard-won. But readers should understand the dependency they are taking on, including a pinned fork that must track upstream security fixes.
Insight Two: retrieval beats summarization on cost, not yet on evidence. Our model shows that capping sessions and continuing fresh halves cumulative tokens versus one long session. But whether an agent retrieves the right context is unmeasured: Mainplane publishes no /continue evaluation. The research is sobering. In MemoryArena, where later tasks depend on earlier sessions, the best average success rate was about 0.23, and external memory and RAG did not consistently beat long-context agents. In OSWorld 2.0, where trajectories run past 300 steps, memory is one of four main failure categories. "Search your own transcript" is a cleaner primitive than a summary, but it shifts the hard problem onto the model rather than solving it.
Surprising Takeaway
The context limit is the cheapest feature in Mainplane. Because every step re-sends the whole conversation, a session's cumulative token bill grows with the square of its length: doubling a session from 250K to 500K tokens doubles its steps but quadruples the tokens processed. Two capped sessions linked by /continue cover the same number of steps for about half the tokens, and even with a 90% prompt-cache discount, a single million-token session costs roughly 16 times a 250K one. Refusing to summarize turns out to be a cost policy as much as a memory policy.
TL;DR For Engineers
Mainplane splits agents into one always-on harness (keys, sessions, loop) and many workers (shell, files, browser, desktop) joined by a self-hosted WireGuard mesh.
Sessions are append-only files with a hard context limit;
/continuestarts fresh and the agent greps the old log. Compaction is disabled, even when driving Claude Code.Cumulative context cost is quadratic in session length: capped sessions plus continuation halve tokens versus one long session.
"No Tailscale needed" means a forked Tailscale client plus a trimmed headscale coordinator, self-hosted.
Treat every worker as fully agent-controlled. Use
--no-adminand your own URL if provider keys and Cloudflare visibility matter to you.
Explain It Like I'm New
Today's AI assistants mostly live in one app on one computer. When they need to work with your other machines, a powerful desktop or a server in the cloud, you end up copying things back and forth yourself.
Mainplane gives the AI a home base and a set of hands. The home base is one always-on computer that holds the passwords, the conversation history and the "thinking." The hands are any computers you connect: your laptop, a graphics-card server, a Mac. The AI can type commands, move files and click around on each, over a private network linking them.
It also handles memory differently. Long conversations eventually overflow what the AI can hold at once. Most tools respond by writing a summary and continuing, like replacing your notes with a short recap. Mainplane keeps the full notes forever and starts a fresh conversation that can look things up in the old ones, like opening a new notebook with the old one on the shelf.
That is cheaper, because the AI rereads less, and more exact, because nothing was paraphrased away. The catch is that the AI has to remember to look.
As AI moves from answering questions to doing long jobs across many machines, the plumbing around the model may matter as much as the model itself.
See It In Action
Mainplane README demo, Mainplane on GitHub. Repository. The TUI walkthrough shows an agent moving a Qwen fine-tune from a GPU server to a Mac Studio and quantizing it there, the scenario our worked example follows.
Self-hosting guide, Mainplane. docs/self-hosting.md. Unusually precise diagrams of the tunnel, pointer, mesh and drives, plus exactly what Cloudflare can and cannot read.
OSWorld 2.0 findings, Snorkel AI. Why computer-use agents fail most tasks. Long-horizon computer use across up to five applications, and the four failure modes that Mainplane-style agents will hit.
OSWorld 2.0 leaderboard, Yutori. Leaderboard. Where frontier agents currently stand on 108 long, real-world computer tasks.
Community Conversation
MemoryArena authors (Stanford, UCSD and others), paper. Agents near saturation on recall benchmarks such as LoCoMo still fail when memory must guide later actions; best average success around 0.23.
Snorkel AI, OSWorld 2.0 analysis. Trajectories have grown from about 30 steps to 300 or more, which makes context management, not raw model skill, a first-order problem.
LangChain, The anatomy of an agent harness. A framing of the harness as the layer that decides context, tools and control flow, the layer Mainplane rebuilds around machines.
"The Harness Beats the Model", ML Notes. Argues that harness engineering drives much of an agent's real-world performance, the thesis behind Mainplane's bet.
Fresh Starts Beat Lossy Summaries
Mainplane gets the big architectural call right: keep secrets and state in one place, treat every other computer as replaceable hands, and make the session an append-only file that nobody rewrites. Its refusal to compact looks austere until you price it: capped sessions plus /continue halve cumulative tokens and keep exact history on the shelf. Two caveats keep it from being a slam dunk. Its networking is a self-hosted Tailscale, not an absence of one, and its memory strategy rests on agents retrieving well, which current benchmarks say they often do not. Adopt the architecture, isolate your workers carefully, and measure how well your agents actually use /continue.
References
MemoryArena: Benchmarking Agent Memory in Interdependent Multi-Session Agentic Tasks, He et al., ICML 2026 (PMLR). Memory that must guide later actions, across four domains.
OSWorld 2.0: Benchmarking Computer Use Agents on Long-Horizon Real-World Tasks. 108 long, multi-application tasks with trajectories over 300 steps.
MemGPT: Towards LLMs as Operating Systems, Packer et al. The paging-memory alternative to Mainplane's "fresh session plus retrieval."
Mainplane is an MIT-licensed Go agent harness that keeps keys, sessions and the agent loop on one harness and runs tools on many workers over a self-hosted Tailscale-protocol mesh. It replaces context compaction with append-only sessions, a hard limit and /continue, which roughly halves cumulative tokens, though retrieval quality remains unmeasured.
Sponsored Ad If you enjoy practical AI insights, check out SnackOnAI and support the newsletter by subscribing, sharing, and exploring our sponsored ad—it helps us keep building and delivering value 🚀
10 Stocks Built for Growth and Income
There’s still room for growth in the market in 2026, and the all-new 10 Best Stocks to Own: Fall 2026 list is built for balance and upside.
Inside, you’ll find reliable dividend growers built to generate income...
Plus high-growth names positioned to benefit from some of the market’s biggest trends.
From AI infrastructure and energy to consumer growth and capital returns, these 10 stocks offer different ways to pursue opportunity this fall.
You don’t have to choose between income and growth.
See the 10 stocks positioned to offer both and get the full report while it’s still free.


