The token economy: sharing memory across agents

Yesterday I wrote about splitting work between two editors: Claude Code for the hard problems, Open Code with Kimi K2.6 for everything else. The math works. Most agent calls during a workday are tool operations, ticket updates, formatting. Moving those from Opus to Kimi cuts cost by an order of magnitude.

But there's a problem I glossed over at the end: two editors, two models, zero shared context.

Claude Code doesn't know what Kimi just did. Kimi doesn't know what Claude is working on. If Claude fixes a bug and saves the learning to memory, Kimi will rediscover that same bug tomorrow. The cost savings evaporate the moment your agents start duplicating work.

The fix is not complicated, but it requires wiring both editors to the same set of tools. Four MCPs that together form a shared workspace: Engram for memory, Context7 for documentation, Dash0 for observability, and Dashlane for secrets.

The four MCPs

Engram is the centerpiece. It's an MCP-native memory server — a single Go binary with SQLite and FTS5 full-text search. Any MCP-compatible agent can call mem_save, mem_search, mem_context, and mem_judge. What Claude learns about a project convention, Kimi can retrieve in its next session. What Kimi discovers about a broken test pattern, Claude can reference without asking me.

Engram doesn't care which model is calling it. It exposes four tools. Both editors connect to the same database. Memory becomes a shared resource, not a per-agent scratchpad.

Context7 solves a different problem: outdated documentation. LLMs are trained on snapshots of the internet. When a framework releases a breaking change, your agent won't know unless you tell it. Context7 pulls up-to-date, version-specific docs directly into the prompt. It covers over 63,000 libraries. You write "use context7" in your prompt, and the agent fetches live documentation instead of hallucinating APIs that don't exist.

The MCP exposes two tools: resolve-library-id to find the right library, and query-docs to pull the relevant sections. Both editors get the same live docs. No more "that method was deprecated six months ago" moments.

Dash0 brings observability into the agent loop. It's an OpenTelemetry-native platform with its own MCP server. Agents can query metrics, logs, and traces directly — not by reading dashboards, but by calling structured tools. An agent can ask "what's the error rate on the payment service in the last hour" and get actual data, not a screenshot.

The MCP exposes PromQL query building, service catalog navigation, RED metrics per operation, and alert management. For a two-editor setup, this means either agent can investigate production issues without me switching contexts. Claude finds the root cause. Kimi opens the PR. Both see the same telemetry.

Dashlane handles secrets. Its MCP server exposes audit logs in a read-only, controlled way. Agents can query credential activity — failed logins, sharing events, password changes — without ever touching actual passwords. This matters because as agents do more, they need to know when credentials rotate or when access patterns change. The MCP gives them that visibility without breaking the zero-knowledge architecture.

The architecture

Claude Code ──┐                    ┌── Engram (memory)
              │                    │
              ├── MCP ────────────┼── Context7 (docs)
              │                    │
Open Code ────┘                    ├── Dash0 (observability)
                                   │
                                   └── Dashlane (secrets)

Both editors connect to the same four MCP servers. The models are different. The tools are identical. The memory is shared.

This is what I'm running now. Claude Code handles architecture decisions and complex refactors. Open Code with Kimi handles ticket updates, MCP tool calls, formatting, and boilerplate. Both read from and write to the same Engram database. Both pull live docs from Context7. Both can query production telemetry through Dash0.

What changes when memory is shared

The first thing you notice is that handoffs stop being handoffs. There's no "here's what I did, now you take over" ritual. Claude saves a learning to Engram. Kimi picks it up in its next session automatically. The context flows through the memory layer, not through me.

The second thing is that conventions propagate. If Claude establishes a pattern — "we use sentence case for commit messages in this repo" — that gets saved once and retrieved by every agent that touches the project. No more inconsistent commit styles between editors.

The third thing is cost. When agents share memory, they don't repeat work. Kimi doesn't spend tokens rediscovering what Claude already figured out. Claude doesn't waste context window on problems Kimi already solved. The token savings compound.

The real shift

Yesterday's article was about matching the model to the task. Today's is about making sure the models can pass the task between them.

The mental model is not "one smart agent and one cheap agent." It's one team with a shared brain. The expensive model does the thinking. The cheap model does the doing. Both remember what happened.

That's the token economy. Not just spending less per call, but spending less overall because knowledge isn't lost between sessions, between editors, between models.

Tomorrow: wiring this into the SW Factory pipeline so the entire development cycle — from Odoo task to deployed PR — runs through this shared memory layer without me touching a keyboard.

← Back to Blog