Hosting a More Efficient TeaParty¶
After the 13-hour POC, I rebuilt TeaParty as v0.99. Four architectural changes:
- CFA implemented as a skill graph. The Conversation-for-Action protocol (intent, plan, execute, phase gates, backtracks) is expressed as a skill graph rather than as custom orchestrator code. Each node is a skill; transitions are edges; the graph is the protocol.
- Bus-driven dispatch with session resume on wake. Parents sleep on the bus until a child message arrives, then resume their prior Claude session to handle it rather than starting a fresh one. No CPU burned waiting, and the conversation prefix stays cached across the wait. Replaces the POC's polling fan-in. The
[wake]and[send]rules and the per-instance state continuity (Claude session handle + worktree) live in the CFA engineering spec. - Bounded fan-out at every dispatching parent, capped at three children with bus-driven backpressure. The cap is per-parent, not global: with the project-lead fanning out to three team-leads and each team-lead fanning out to three specialists, up to nine specialist threads could run concurrently in principle. That ceiling has not been hit in practice; parents stagger their dispatches and the observed peak stays lower. Replaces the POC's unbounded burst dispatch that hit provider rate limits in wave 1. The cap (currently 3) lives in the CFA engineering spec.
- Configurable workgroups. In the POC, workers were generated on the fly with default prompts. In v0.99, the workgroup is part of the project configuration: each role has a committed
agent.md(system prompt), tool allowlist, model choice, and skill set. The stable per-role prompts give Anthropic's prompt cache a consistent prefix to key on across sessions. They also encode role-specific disciplines such as the POINT-NOT-PASTE rule (specialists reference files by path, never paste content into messages). See markdown-writer'sagent.mdfor an example.
This post compares v0.99's measured behavior against the POC's on the same prompt. Token-level numbers for both runs come from the Claude SDK's per-session stream archive (~/.claude/projects/...), which captures input/output/cache token counts per turn for every agent in either architecture. The May 2 run produced a 70,601-word manuscript in 10 hours 36 minutes of wall-clock, with zero rate-limit failures across 75 dispatches and 93% prompt-cache hit on input.
The run¶

Same byte-identical prompt as the POC: I would like a book on the universal nature of humor… Same shape: intent gate, plan gate, fan-out at exec, fan-in at work-assert. Across 10h36m of wall clock the system dispatched 75 sub-agent sessions and zero hit a rate limit. The work-assert gate cleared and the manuscript was kept.
Bus-driven fan-in¶
The POC post named the lead-side waste: "The fan-in was a polling loop that blocked until every child responded. Six chapter drafts couldn't start until the seventh spec arrived, even though their own inputs were ready. The loop also burned CPU for the full eleven-minute wait."
v0.99 replaces the polling loop with a message bus. Child responses queue on the bus in arrival order. The parent processes them when it goes idle, one per turn. If the queue is empty and there's no other work, the parent suspends until the next message arrives.
Send(member, message) is the dispatch primitive. It puts a message on the bus and immediately returns a conversation_id handle. The recipient runs on its own session branch and worktree. Send doesn't end the sender's turn; a parent fans out by issuing successive Sends within one turn.
{"status": "message_sent",
"conversation_id": "dispatch:25efca0319b3",
"message": "Dispatched to 'voice-editor'. The child has its own worktree on
branch session/25efca0319b3; nothing it writes is visible in your worktree
until you call CloseConversation.
To continue this thread: call Send again with
context_id='dispatch:25efca0319b3' — the handle stays valid (the child is
re-entered, not recreated) until you close it.
When you judge the work acceptable: CloseConversation(
conversation_id='dispatch:25efca0319b3'). That squash-merges the child into
your branch and ends the thread."}
The conversation_id is the sender's handle on a thread. Re-passing it as context_id puts another message on the bus to the same recipient, which resumes its prior session rather than booting a fresh one. CloseConversation(conversation_id) terminates the subagent and squash-merges its branch into the sender's. The sender decides the thread's lifetime and what messages it carries.
The per-parent cap surfaces as a Send refusal:
{"status": "failed",
"reason": "You already have three open conversations.
Wait for them to complete or use CloseConversation."}
Rather than blocking the caller inside the dispatch primitive, the bus refuses the fourth Send. A slot frees when the parent processes a queued completion and calls CloseConversation on that thread.
Agents have autonomy over managing their conversation threadspace.
Stability¶
| Failure mode | POC | v0.99 |
|---|---|---|
| Rate-limit dispatch failures | 14 (waves 1–3 of research) | 0 |
| Head-of-line block in fan-in | 11-minute block on the slowest sibling | 0 (bus delivers each completion as it arrives) |
| Recovery waves needed | 4 (wave-1 retry storm took ~4 hours) | 0 |
The POC's eight-wide research dispatch failed in wave 1 because the provider rate-limited it. v0.99 caps fan-out at three children per parent and uses bus-driven backpressure: the parent dispatches three, waits for the bus to deliver a completion, dispatches the fourth.
The cap is visible in the Gantt above. Look at any band of specialist bars under one team-lead, fact-checkers under an editorial-lead, voice-editors under another. They cluster in groups of three that start within seconds of one another, run for some minutes, then complete around the same time. After the third bar in a wave ends, the next three start within a minute or two: the parent received a completion message on the bus and dispatched the next batch. A team-lead with seven children draws three threes plus one tail; with eight, three threes plus a two. The cap holds at every level of the dispatch tree, including the exec-lead's dispatch of writing-leads and editorial-leads at the top.
Token usage¶
Both runs streamed Claude SDK output to disk; the per-session usage is recoverable from ~/.claude/projects/... for either. Totaling deduped assistant messages across all sessions of each run:
| Category | POC (March 16) | v0.99 (May 2) | Δ |
|---|---|---|---|
| Distinct Claude sessions | 269 | 75 | −72% |
| Raw input | 505,599 | 8,174 | −98% (62× drop) |
| Cache write (5m TTL) | 17,741,375 | 0 | shifted entirely |
| Cache write (1h TTL) | 8,903,396 | 13,415,293 | shifted to 1h |
| Cache read | 148,142,371 | 213,403,354 | +44% |
| Output | 973,266 | 3,083,594 | +217% |
| Total tokens transacted | 176,266,007 | 229,910,415 | +30% |
| Cache-read share of input-side | 84.5% | 92.8% | +8 pts |
| Manuscript output (words) | ~55,000 | 70,601 | +28% |
A few things stand out.
The POC was already at 84.5% cache-read share of input-side traffic. v0.99's 92.8% is a few points higher, not a different regime.
Where the two runs diverge is raw input. The POC sent 505,599 tokens of fresh content across the run; v0.99 sent 8,174. The 62× drop comes mostly from how often each architecture creates a fresh Claude session. The POC dispatched 41 tasks across 269 distinct sessions, about 6.6 sessions per worktree, because each polling pause, auto-compaction, and rate-limit retry restarted the conversation as a new session that paid system prompt and tools afresh. v0.99 dispatched 79 tasks across 81 sessions, about 1 per worktree, because session resume on wake keeps the same Claude conversation alive across every bus-driven sleep/wake cycle. Cache TTL settings compound the effect: POC wrote 17.7M tokens to 5-minute-TTL cache and 8.9M to 1-hour, so a session that paused longer than five minutes during fan-in lost its prefix and re-paid it as raw input on the next turn. v0.99 writes 0 to 5m and 13.4M to 1h exclusively, so the 1-hour cache survives the bus-driven wait pattern. POINT-NOT-PASTE contributes a smaller piece on top of these by keeping inter-agent bus messages to paths rather than bytes.
The output side runs the other direction. v0.99 produced 3.2× more output tokens than the POC, mostly from extra editorial passes: fact-checking, voice editing, copy edits running in parallel under different leads. Per-manuscript-word total cost was nearly identical, around 3,200 tokens per word in either run. v0.99 didn't make existing work cheaper. It ran more passes at the same per-pass cost.
The efficiency gain shows up in two derived ratios:
| Ratio | POC | v0.99 | Δ |
|---|---|---|---|
| Tokens transacted per output token | 181 | 75 | 2.4× lower overhead |
| Output tokens per wall-minute | ~2,700 | ~4,840 | 1.8× higher output rate |
v0.99 emits 1.8× more output per wall-minute and pays 2.4× less coordination overhead per output token. Cache utilization was already high in the POC. What improved is how much manuscript gets produced per unit of coordination.
What I'm not claiming¶
-
The prose got better. A blind A/B on five matched-content passages between the May 2 manuscript and a different attempt on the same prompt came back near 50/50 on engagement and page-turn. The same agent stack produces comparable prose at the paragraph level; the differences that ship a kept book over a withdrawn one are book-shaped, not sentence-shaped.
-
The proxy got smarter. The proxy implementation evolved between the POC and v0.99 too, but I'm not making a quantitative claim about it here.
-
v0.99 caches dramatically better than the POC. The cache-hit rate moved from 84.5% to 92.8%, a real but modest improvement. The 62× drop in raw input is a larger effect, and it's attributable mostly to fewer fresh Claude sessions (269 in POC vs 81 in v0.99) plus the cache TTL move from 5-minute to 1-hour. Both of those depend on the bus-driven session-resume pattern. POINT-NOT-PASTE contributes a smaller piece.
-
Per-pass token cost dropped. Cost per manuscript word barely changed (POC ~3,200 tokens/word, v0.99 ~3,260). What v0.99 changed is throughput per wall-minute, not the per-pass cost.
-
These observations generalize. This is one POC run and one v0.99 run completing the same prompt.
The TeaParty source is at github.com/dlewissandy/teaparty. The case-study artifacts for both runs live under docs/case-study/ in that repo.