{"slug": "we-built-a-bare-minimum-agent-kernel", "title": "We Built a Bare-Minimum Agent Kernel", "summary": "Sikemux rebuilt its multi-agent coding framework around a \"bare-minimum agent kernel\" of deterministic Rust OS primitives, cutting its MCP turn-1 tool surface from 70 direct tools to 26 and to 1,164 tokens — 97.9% leaner than Anthropic's 55K-token baseline. Sikemux reported the orchestrator prompt fell 84.9% from 1,009 to 152 tokens, background LLM memory summarizers were replaced by a 0-token deterministic linter running in under 10 ms, and warm isolated workspaces dropped from 21.6 s and 1.18 GB to about 2 s and 103 MB, a 99.96% disk saving on a 40.8 GB Rust cache. The company cited Anthropic's CL-Bench finding that prescriptive memory rules helped older models but degraded newer ones, and Vercel's cut from 17 tools to 2 lifting pass rates from 80% to 100% at 3.5x speed, to argue that code-written cognitive scaffolding depreciates every six months.", "body_md": "# Why We Built a Bare-Minimum Agent Kernel\n\nHow we deleted heuristic scaffolding from Sikemux, cut MCP turn-1 overhead 97.9% vs Anthropic's baseline, saved 99.96% disk on warm worktrees, and enforced 0-token guardrails.\n\nEvery six months, a new frontier model turns half of a multi-agent framework into dead weight.\n\nAuditing [Sikemux](https://sikemux.com) exposed thousands of lines of Rust trying to out-think the model: an English cue-word memory engine, background LLM summarizers, compiled orchestrator prompts, fixed character caps slicing rules mid-word, and 70 upfront MCP tools.\n\nWe deleted that scaffolding and rebuilt around a **bare-minimum agent kernel**: deterministic OS primitives in Rust, with cognition left to plain Markdown and editable skills. Below are the measurements that actually moved the needle (Apple Silicon, macOS APFS, `tiktoken o200k_base`) and the traps they exposed.\n\n## Before and After: What Actually Moved the Needle\n\n| Subsystem | Before | After | Impact | \n|---|---|---|---|\n| **MCP turn-1 surface** | 70 direct tools (Anthropic baseline: 55K tok) | **26 direct tools** /**1,164 tok** gateway | **-62.9% tools** ,**97.9% leaner** than 55K baseline | \n| **Orchestrator prompt** | 1,009 compiled tokens | **152 tokens** (+ on-demand skills) | **-84.9% prompt tokens** | \n| **Memory maintenance** | Background LLM summarizers + cue rules | **0 tokens** deterministic linter | **-100% LLM spend** , runs in**<10 ms** | \n| **Warm isolated workspace** | 21.6 s / 1.18 GB cold clone | **~2 s / ~103 MB** (42.3 GB warmed) | **99.96% disk saved** on 40.8 GB Rust cache | \n| **Credential handling** | Prompt rules around secrets | Host-side blind-fill vault | **0 plaintext secret bytes** in transcripts | \n\n## Multi-Agent Coding Architecture: Why Heavy Frameworks Decay\n\nThe strongest signal in coding harnesses is what frontier teams **deleted**:\n\n- **Memory heuristics:** Anthropic showed prescriptive memory rules helped older models but*degraded* newer ones on CL-Bench.\n- **Bloated tool surfaces:** Vercel cut a data agent from 17 tools to 2 (`bash` and SQL), lifting pass rates from 80% to 100% and running 3.5x faster. Anthropic saw 58 upfront MCP schemas burn 55K to 134K tokens before turn 1.\n- **Prompt walls and locks:** Cursor deleted 66% of its system prompt and found flat locks collapsed parallel throughput, while isolated trees scaled cleanly.\n\nOne law unifies all three: **cognitive scaffolding written in code depreciates every six months, while OS physics and security invariants appreciate with every model jump.**\n\nAn **agent kernel** draws that OS boundary:\n\n```\n+----------------------------------------------------------+\n|       MODEL-OWNED COGNITION (Plain Files & Skills)       |\n|  Planning, Markdown notes, skills, swappable harnesses   |\n+==========================================================+\n|          DETERMINISTIC AGENT KERNEL (Rust)               |\n|  1. Worktrees & Landing   APFS CoW, ports, linear queue  |\n|  2. Shared State & Lint   CRDTs, SHA-256 blobs, 0-LLM    |\n|  3. Signed Rooms & Specs  OS caller ID, 8-turn breaker   |\n|  4. Verifiers & Sandbox   Receipts, blind-fill, taint    |\n+----------------------------------------------------------+\n```\n\nBecause the kernel owns thread logs and workspace state, Claude Code, Codex, and Gemini stay swappable drivers. See the [agent kernel docs](https://docs.sikemux.com/agents/agent-kernel) and [chats guide](https://docs.sikemux.com/agents/chats).\n\n## MCP Tool Token Overhead and the 3.38x Always-Load Trap\n\nFolding tool families into multiplexed tools cut our direct MCP catalog by **62.9%** (70 down to 26 tools), exposing a trap that hits most MCP redesigns:\n\n1. **Multiplexing alone barely shrinks schemas:** Every sub-action’s parameter schema still lives inside its parent tool.\n2. **The 3.38x `alwaysLoad` trap:** Our eager`alwaysLoad` tier previously marked frequent flat tools at**979 tokens** . Propagating`alwaysLoad` onto consolidated parent families dragged every cold sibling action onto turn 1, ballooning the eager tier to**3,306 tokens: 3.38x larger.**\n3. **Gateway indexing delivers the win:** Exposing only`guide` and`call` plus a compact index brought turn-1 context to**1,164 tokens** ,**97.9% leaner** than Anthropic’s 55,000-token baseline.\n\n**Takeaway:** Never pair multiplexed families with eager loading. Keep cold actions behind a lazy index, and move role playbooks into on-demand Markdown skills, cutting our orchestrator prompt by **84.9%** (1,009 to 152 tokens).\n\n## Why Heuristic Agent Memory Silently Rots\n\nOur deleted memory stack paired background LLM summarizers with a heuristic contradiction detector using English stop-words, cue lists, and Jaccard similarity.\n\nAuditing that engine showed how string heuristics rot silently. Putting **`\"on\"`** in the positive-cue list broke verbatim opposites:\n\n- **Note A:**`\"Always push commits directly on main\"`\n- **Note B:**`\"Never push commits directly on main\"`\n\nBecause Note B matched both `\"never\"` (negative) and `\"on\"` (positive), its polarity canceled out and the detector passed both rules as non-contradictory. Complementary tooling rules falsely tripped, differently worded opposites slipped through, and a fixed character cap sliced a project rules block mid-word (`\"...never bypass vault_r\"`).\n\nWe deleted both systems. Memory now lives in plain Markdown under a bounded index, trimming respects complete lines on window-relative budgets, and a **0-token deterministic linter** runs in **under 10 ms** to catch oversized indexes, broken links, dead wikilinks, leaked API keys (skipping fenced code), and stale code anchors via git diff. Salience stays with the model.\n\n## Parallel Coding Agents With Git Worktrees and APFS Copy-on-Write\n\nShared checkouts corrupt git indexes, clobber diffs, and clash on ports; cold clones trigger multi-minute rebuilds. Measuring on our live repo disproved our guess that recursive APFS `cp -cR` would make cloning instant:\n\n| Operation | Wall Time | Apparent Size | Physical Disk Delta | \n|---|---|---|---|\n| Fresh `git clone --no-hardlinks` | 21.6 s | 1,165.5 MB | 1,180.2 MB | \n| Naive recursive `cp -cR` (full repo) | 11.75 s | 1,165.5 MB | 86.5 MB | \n| Warm Rust `target/` (`clonefile` ) | **1.17 s** | 40.8 GB | **17.6 MB** (**99.96% saved** ) | \n| **Combined warm isolated workspace** | **~2.0 s** | **~42.3 GB** | **~103 MB** | \n\nNaive `cp -cR` spent almost twelve seconds walking `.git` objects file by file. Pairing `git worktree add` with directory-level `clonefile` on `node_modules/` and `target/` beats `cp -cR` by **~6x**, warming a **42.3 GB** workspace for **~103 MB** of disk.\n\nFinished commits land through **line-level edit ownership** and a serialized linear queue: disjoint edits merge cleanly alongside sibling work, while colliding lines refuse cleanly without mutating `main`. We dogfood this daily building Sikemux itself, with parallel Claude and Gemini agents landing signed commits onto a linear `main` without lock contention. See [worktrees and handoffs](https://docs.sikemux.com/agents/worktrees-and-handoffs).\n\n## Sub-Millisecond Deterministic Guardrails Outside Model Context\n\nThinning cognition only holds when verification and security run **outside** model context:\n\n1. **Blind-fill vault:** Agents use opaque`vault:<id>` handles while the kernel injects credentials directly into browser fields or proxies.**0 plaintext secret bytes** enter transcripts; payments and first-time access require human approval. See[vault and browser automation](https://docs.sikemux.com/browser/vault-and-automation) .\n2. **SHA-256 MCP manifest pinning:** External MCP schemas are hash-pinned on approval, with sub-millisecond drift checks halting execution if a remote server mutates a schema.\n3. **Lethal-Trifecta taint:** Sessions reading both private data and untrusted content have unapproved egress blocked in sub-millisecond time until cleared out of band.\n4. **8-turn loop breaker:** Signed rooms stamp OS caller identity and pause agent-only loops at turn 8 without human input or verified progress.\n5. **External verifiers, hash-chained logs, and OS kill:** The kernel runs checks, SHA-256 chains transcripts, and kills runaway agents at the OS process tree.\n\n## Scope Boundaries and Two Regressions We Caught\n\nThese benchmarks prove **structural token overhead, deterministic latency, and APFS disk economics**. They are **not** controlled SWE-bench pass-rate or full-trajectory A/B evals (such as measuring how often lazy `guide` calls offset turn-1 gateway savings).\n\nShipping the kernel also caught two real regressions, now fixed and tested:\n\n- Folding flat tools into families broke packaging smoke checks still calling legacy flat names.\n- Our first egress-taint pass flagged zero-exposure blind-fill and memory-list calls as private reads, causing false-positive blocks until we narrowed taint to true secret reads and added clean-origin exceptions.\n\n## Betting With the Model Curve\n\nHardcoding orchestration graphs or cue heuristics bets *against* next quarter’s models. Keep cognition flat and model-owned while enforcing worktrees, shared state, external verification, and OS security in a thin kernel.\n\nInspect the code on [GitHub](https://github.com/nodelike/sikemux), read the [Agent Kernel docs](https://docs.sikemux.com/agents/agent-kernel), or compare approaches on [sikemux.com/vs](https://sikemux.com/vs).\n\n## Frequently asked questions\n\n## What is an agent kernel in multi-agent coding architecture?\n\nA thin, deterministic runtime owning OS primitives (worktree isolation, shared state, caller identity, blind-fill secrets, external verifiers) while leaving planning and memory layout to the model.\n\n## How do you cut MCP tool token overhead without breaking discovery?\n\nKeep cold actions behind a compact gateway index (guide + call) instead of loading full schemas on turn 1. Folding flat tools into families without lazy loading can bloat eager tiers by 3.38x.\n\n## How do parallel coding agents share git without rebuild storms?\n\nIsolate each agent in a git worktree warmed via APFS copy-on-write caches, enforce line-level edit ownership, and merge through a serialized linear queue. A 42.3 GB workspace warms in ~2 s and ~103 MB.\n\n## Why use deterministic guardrails instead of prompt safety rules?\n\nCompaction drops prompt rules and prompt injection overrides them. Blind-fill secrets (0 plaintext bytes), sub-millisecond SHA-256 MCP pinning, taint checks, and an 8-turn loop breaker run outside model context.", "url": "https://wpnews.pro/news/we-built-a-bare-minimum-agent-kernel", "canonical_source": "https://sikemux.com/blog/bare-minimum-agent-kernel", "published_at": "2026-12-06 14:59:29+00:00", "updated_at": "2026-12-06 15:15:50.359758+00:00", "lang": "en", "topics": ["ai-agents", "ai-tools", "large-language-models", "agent-protocols", "developer-tools"], "entities": ["Sikemux", "Anthropic", "Vercel", "Cursor", "Claude Code", "Codex", "Gemini", "MCP"], "also_reported_by": [], "takeaway": "Multiplexing MCP tool families cut Sikemux's direct catalog 62.9% (70 to 26 tools) and 1,164 gateway tokens versus a 55K baseline, but propagating the eager alwaysLoad tier onto consolidated parent families re-inflated schemas 3.38x, so keep always-loaded schemas minimal.", "recommendation": {"advice": "Fold MCP tool families into multiplexed tools but keep the alwaysLoad tier off consolidated parents — Sikemux measured a 3.38x schema inflation from propagating it, versus 1,164 gateway tokens with 26 direct tools.", "playbook": "agent-architecture", "playbook_url": "https://wpnews.pro/playbooks/agent-architecture"}, "alternates": {"html": "https://wpnews.pro/news/we-built-a-bare-minimum-agent-kernel", "markdown": "https://wpnews.pro/news/we-built-a-bare-minimum-agent-kernel.md", "text": "https://wpnews.pro/news/we-built-a-bare-minimum-agent-kernel.txt", "jsonld": "https://wpnews.pro/news/we-built-a-bare-minimum-agent-kernel.jsonld"}}