DEV Community

Cover image for I thought adding 3 more OpenClaw agents would help but the real problem was AI agent handoff state
Lars Winstand
Lars Winstand

Posted on • Originally published at standardcompute.com

I thought adding 3 more OpenClaw agents would help but the real problem was AI agent handoff state

AI agent handoff state is the thing that separates a fun OpenClaw demo from a multi-agent system you can trust.

One agent can get away with thread memory.

Three agents usually can’t.

Once agents start sharing work, you need structured shared memory for facts and artifacts. Not a 100k-token transcript that gets slower, more expensive, and less reliable every week.

I keep seeing the same failure mode in OpenClaw setups.

The first agent feels incredible.

It writes specs. It drafts outbound. It triages bugs. It kicks hard tasks to Claude or GPT-5. You feel like you found a cheat code.

Then you add a second agent.

Then a reviewer.

Then a researcher.

Then something that posts updates to Discord or Slack.

And now the system isn’t exactly broken. It’s worse than broken.

It’s flaky.

One agent discovers something important and the next one behaves like it never happened. Or it remembers the wrong detail. Or you "fix" that by shoving the entire transcript into every prompt, and now latency spikes, token usage gets ugly, and your orchestration starts feeling like a hostage negotiation with stale context.

That’s when OpenClaw stops being a prompt problem and becomes a systems problem.

While looking into this, I found a thread on r/openclaw where someone asked the right question: how are people sharing knowledge between multiple OpenClaw agents?

That is the bottleneck.

Not model quality.

Not prompt cleverness.

Handoff state.

The common mistake: treating memory like one giant transcript

A lot of teams start here:

  1. Agent A does 20 turns of work
  2. Pass all 20 turns to Agent B
  3. Agent B adds 15 more turns
  4. Pass all 35 turns to Agent C
  5. Wonder why everything got slower, pricier, and dumber

That architecture is a junk drawer with a context window.

LangGraph’s docs make a useful distinction here:

  • Checkpointers handle short-term, thread-level state
  • Stores handle long-term shared data across threads

That maps cleanly to OpenClaw.

The real split is not one-agent vs multi-agent.

It’s this:

  • thread-scoped memory
  • cross-thread shared memory

If your research agent found a competitor pricing page, your coding agent probably does not need the whole chat that led to it.

It needs something like:

{
  "fact": "Competitor X charges $99/month for 10k runs",
  "source": "https://example.com/pricing",
  "captured_at": "2026-07-20T10:22:00Z",
  "confidence": 0.93,
  "status": "verified"
}
Enter fullscreen mode Exit fullscreen mode

That is a handoff.

A transcript is not.

Yes, Claude can handle huge prompts. That’s not the point.

This is where people get tripped up.

Anthropic has shown Claude handling very large prompts. Their older 100k context announcement framed 100,000 tokens as roughly 75,000 words. They’ve also shown long-context retrieval examples like scanning a 72k-token copy of The Great Gatsby.

So yes, giant prompts are real.

And for some workloads, they’re fine.

If you have:

  • one agent
  • one bounded corpus
  • one workflow that resets cleanly

then prompt stuffing can be the simplest correct answer.

Anthropic also points out that prompt caching can reduce latency and cost substantially for repeated long prompts.

That’s all true.

But it falls apart as an architecture once you have ongoing multi-agent work.

Because then your transcript becomes:

  • larger every run
  • less relevant every run
  • harder to trust every run
  • more expensive every run

LangGraph explicitly warns about long histories increasing latency and cost, exceeding context windows, and degrading model performance because the model gets distracted by stale or irrelevant content.

That matches what people see in production.

The Reddit posts stop sounding like demos very quickly

What got my attention is that OpenClaw users are already talking in real spend, not toy-project numbers.

In one r/openclaw thread, a user said:

About 3k a month. GTM, product de (mostly specs, coding done by Claude/Codex/GHCP), Sales... Multi model - depending on task. Not fully convinced it is worth the cash. But it does make a lot of tasks easier and faster, which is invaluable.

Another said:

we've used it to basically build and run a real estate brokerage, real estate investment business, and openclaw-for-realtors SaaS product called "Homies AI" burn rate on it running the business is like $30k/yr the businesses make like $500k/yr

And in another thread:

Since I installed OpenClaw 4 months ago I have spent over $10k on tokens via OpenRouter.

That’s the part people miss.

Once agents are attached to real work, memory design becomes a cost decision.

Bad handoffs are not just messy.

They’re expensive.

That’s exactly why pricing starts to matter too. If your agents are constantly summarizing, re-reading, re-handoffing, and carrying giant prompts around, per-token billing punishes every architectural mistake. Teams running multi-agent automations on OpenClaw, n8n, Make, Zapier, or custom workflows feel this fast.

That’s also why flat-rate API access is interesting. If you’re iterating on agent architecture and doing lots of retries, summarization, routing, and tool calls, predictable cost matters more than people admit. Standard Compute is basically built for this kind of workload: OpenAI-compatible API, flat monthly pricing, and no per-token panic while you tune agent systems.

What should one agent actually pass to another?

OpenAI’s Agents SDK has a clean mental model here.

It separates:

  • handoffs: who gets control next
  • sessions: conversation history for a run or thread
  • application state: local state that should not be sent to the model

That distinction is gold.

Because not all state belongs in the prompt.

The 3 buckets you should keep separate

1. Model-visible conversational state

What the next agent genuinely needs to read.

Examples:

  • current task
  • recent decisions
  • a compact summary
  • explicit constraints

2. Trusted application state

Stuff your app needs, but the model does not need verbatim.

Examples:

  • auth tokens
  • internal IDs
  • workflow flags
  • rate limit counters
  • customer account metadata

3. Shared durable knowledge

Things other agents may need later.

Examples:

  • extracted facts
  • approved decisions
  • source links
  • generated artifacts
  • verified outputs

If you collapse all three into one giant prompt blob, you get the worst combination possible:

  • more tokens
  • less control
  • less trust
  • worse debugging

A minimal handoff pattern

Here’s a tiny Python example showing the shape of a better handoff.

from dataclasses import dataclass
from typing import Literal

@dataclass
class HandoffArtifact:
    kind: Literal["fact", "decision", "artifact"]
    title: str
    content: str
    source_url: str | None
    confidence: float
    status: Literal["draft", "verified", "approved", "stale"]
    created_by: str
    created_at: str

pricing_fact = HandoffArtifact(
    kind="fact",
    title="Competitor pricing",
    content="Competitor X charges $99/month for 10k runs",
    source_url="https://example.com/pricing",
    confidence=0.93,
    status="verified",
    created_by="research-agent",
    created_at="2026-07-20T10:22:00Z",
)
Enter fullscreen mode Exit fullscreen mode

Now the next agent gets the useful output, not the entire cognitive mess that produced it.

A practical OpenClaw memory layout

If I were wiring this up today, I’d use something like this:

openclaw-memory/
├── threads/
│   ├── thread_123.json
│   └── thread_124.json
├── artifacts/
│   ├── facts.jsonl
│   ├── decisions.jsonl
│   └── outputs.jsonl
└── indexes/
    └── embeddings.sqlite
Enter fullscreen mode Exit fullscreen mode

And the flow would look like this:

  1. Thread memory keeps the current run coherent
  2. Each agent emits structured artifacts
  3. Artifacts are stored centrally
  4. Retrieval selects only relevant artifacts for the next agent
  5. Old or low-confidence artifacts get pruned

That last step matters a lot.

A shared store can turn into a second junk drawer if you let every half-baked thought into it.

Example: don’t pass chats, pass artifacts

Bad handoff:

"Here are the last 14 messages from the research agent, plus 8 web snippets,
plus 3 abandoned ideas, plus a summary of a summary. Use all of that to write the spec."
Enter fullscreen mode Exit fullscreen mode

Better handoff:

{
  "task": "Write implementation spec for competitor-monitoring job",
  "constraints": [
    "Use Postgres",
    "Must support retryable fetches",
    "Run daily at 09:00 UTC"
  ],
  "artifacts": [
    {
      "kind": "fact",
      "title": "Competitor X pricing",
      "content": "$99/month for 10k runs",
      "source_url": "https://example.com/pricing",
      "confidence": 0.93,
      "status": "verified"
    },
    {
      "kind": "decision",
      "title": "Storage backend",
      "content": "Use Postgres instead of Redis for auditability",
      "source_url": null,
      "confidence": 1.0,
      "status": "approved"
    }
  ]
}
Enter fullscreen mode Exit fullscreen mode

That’s shorter, clearer, cheaper, and easier to debug.

You can prototype this locally in an afternoon

A very simple setup using Python, SQLite, and JSON is enough to prove the pattern.

Install basics:

python -m venv .venv
source .venv/bin/activate
pip install sqlite-utils pydantic
Enter fullscreen mode Exit fullscreen mode

Create a tiny artifact store:

import sqlite3
import json

conn = sqlite3.connect("memory.db")
cur = conn.cursor()

cur.execute("""
CREATE TABLE IF NOT EXISTS artifacts (
  id INTEGER PRIMARY KEY AUTOINCREMENT,
  kind TEXT NOT NULL,
  title TEXT NOT NULL,
  content TEXT NOT NULL,
  source_url TEXT,
  confidence REAL,
  status TEXT,
  created_by TEXT,
  created_at TEXT
)
""")

artifact = {
    "kind": "fact",
    "title": "Competitor X pricing",
    "content": "$99/month for 10k runs",
    "source_url": "https://example.com/pricing",
    "confidence": 0.93,
    "status": "verified",
    "created_by": "research-agent",
    "created_at": "2026-07-20T10:22:00Z"
}

cur.execute(
    """
    INSERT INTO artifacts
    (kind, title, content, source_url, confidence, status, created_by, created_at)
    VALUES (?, ?, ?, ?, ?, ?, ?, ?)
    """,
    (
        artifact["kind"],
        artifact["title"],
        artifact["content"],
        artifact["source_url"],
        artifact["confidence"],
        artifact["status"],
        artifact["created_by"],
        artifact["created_at"],
    ),
)

conn.commit()
conn.close()
Enter fullscreen mode Exit fullscreen mode

Retrieve only what the next agent needs:

import sqlite3

conn = sqlite3.connect("memory.db")
cur = conn.cursor()

cur.execute(
    """
    SELECT kind, title, content, source_url, confidence, status
    FROM artifacts
    WHERE status IN ('verified', 'approved')
      AND confidence >= 0.8
    ORDER BY created_at DESC
    LIMIT 5
    """
)

rows = cur.fetchall()
for row in rows:
    print(row)

conn.close()
Enter fullscreen mode Exit fullscreen mode

That alone is already better than forwarding raw transcripts forever.

Which memory pattern actually wins?

Approach What it’s good for
Giant shared prompt Fastest way to prototype. Fine for one agent and a small bounded corpus. Gets worse as history grows.
Thread/session memory Good for continuity inside one run or one conversation. Not enough for cross-agent knowledge sharing.
Shared store + retrieval Best pattern for multi-agent systems. Better for facts, artifacts, and trusted handoffs. Requires schema and pruning discipline.

My opinion is simple.

If you’re testing one agent on a narrow task, use the giant prompt and move on.

If you’re building an OpenClaw workflow with multiple specialists, a shared transcript is the wrong architecture.

Use:

  • thread memory for continuity
  • a shared store for durable knowledge
  • selective retrieval for handoffs

That’s the line between a demo and a system.

The real problem is trust, not storage

The hardest question in agent handoff is not:

"Can Agent B access what Agent A saw?"

It’s this:

"What can Agent B trust?"

A raw transcript is terrible at answering that.

It mixes:

  • facts
  • guesses
  • abandoned plans
  • temporary confusion
  • old context that should have died three runs ago

A structured memory layer is better because it lets you attach metadata to knowledge:

  • source URL
  • authoring agent
  • timestamp
  • confidence
  • approval state
  • freshness

That’s what makes multi-agent systems feel solid.

Not more context.

Better contracts.

What I’d do if I were fixing an OpenClaw setup this week

If your current setup is flaky, I’d start here:

  1. Stop passing full transcripts between agents
  2. Add a structured artifact schema for facts, decisions, and outputs
  3. Store only durable artifacts in shared memory
  4. Retrieve only approved or high-confidence artifacts
  5. Add TTLs or stale markers so old junk doesn’t keep resurfacing
  6. Keep app state out of prompts
  7. Measure prompt size and handoff size per run

If you want one blunt rule:

Every agent should produce artifacts that another agent can consume without reading the whole backstory.

That’s the architecture change that matters.

And if you’re running these systems at scale, this is also where API pricing stops being a side issue. Multi-agent workflows naturally create retries, summaries, handoffs, and long-running automation loops. Per-token billing makes all of that stressful. Predictable flat-rate compute is a much better fit when agents are running 24/7 and you don’t want every design choice to show up as a surprise bill.

That’s the appeal of Standard Compute for this exact crowd: it’s a drop-in OpenAI-compatible API with flat monthly pricing, built for AI agents and automations. If you’re wiring OpenClaw into n8n, Make, Zapier, or custom orchestrators, having unlimited compute changes how aggressively you can test and refine memory architecture.

The big shift is this:

People think they need more memory.

Usually they need better handoffs.

And once you see that, a lot of multi-agent weirdness suddenly makes sense.

Top comments (0)