Tantra chat engineering, 19 Nov 2026. Internal review page.

How the Tantra chat serves 1,000 people at once

Today every person who opens the chat gets their own small computer (a container) running a full coding agent. The new design gives every conversation a tiny always-ready home instead, and borrows the best ideas from OpenClaude's agent loop without copying its code.

1. Why OpenClaude, and our chat today, need one computer per person

OpenClaude is excellent at one thing: running one agent for one person on one machine. Three habits make it single user.

It rewrites its own settings to switch provider

To move from Claude to another model it overwrites the process's environment variables. Two people in one process would overwrite each other's keys.

It keeps one global session

Session id, working folder and running cost live in one global state object. A second person would share them.

It stores memory in home-folder files

Settings, keys, memory and team mailboxes are files on the machine. Its server and daemon modes are empty stubs.

Our chat today has the same shape for a different reason: it runs the Claude Agent SDK, the Claude Code harness, which expects a machine. So each person holds a container (half a CPU, 4 GB memory) that stays awake 30 minutes after their last message. We cap it at 60.

The hard limit is not Cloudflare: an account may run 60 TiB of container memory, and 1,000 containers need 4 TiB. The real costs are cold starts, 30 minutes of paid idle per visit, a page reload killing the turn, and every chat deploy recycling everyone. Customer chats also never use the shell, file or web tools the container exists for: they are switched off for customers already.

2. The architecture, before and after

3. How we achieve it

State lives outside the code

Each conversation is a Durable Object: a tiny named home on Cloudflare's network with its own small database. The transcript, the open approval cards and the turn in progress live there. Any Cloudflare machine can wake it in milliseconds, so there is nothing per person to boot.

The provider travels with the request

Where OpenClaude rewrites its environment, the router decides provider, model and key for each call and passes them along with that call. Thousands of people with different models share the same code safely. Keys come from the encrypted store per request.

The loop is a function, not a program

OpenClaude's best idea: a loop that always ends with a typed reason (done, needs a tool, too long, retry) and gets its model call injected. We write that loop clean room inside the object. Every tool call is guaranteed a result, so an aborted turn never corrupts the chat.

It sleeps for free

Between messages the object hibernates. A hibernating object costs nothing, unlike a container that bills memory for 30 idle minutes. When the tab closes mid-turn, the object finishes the turn anyway and replays it on return.

4. The nine layers of the merged harness

Borrow the patternfrom OpenClaude, written clean room Keepfrom Tantra chat today Build newin the PRD Drop

5. What it costs per user

Model tokens are over 95 percent of the cost in both designs. The platform cost falls from cents to fractions of a cent, and the model cost falls because the script engine parses answers with a cheap call and only writing goes to Opus.

Today (container per person, Opus)

Per user a month
$0
All users a month
$0

Merged (object per chat, routed)

Per user a month
$0
All users a month
$0

The busiest hour: 1,000 people mid-conversation at once

TodayMerged
Compute for that hour1,000 containers awake: about $421,000 objects running turns: about $5.80
After everyone stopsContainers bill memory 30 more minutes: about $20Objects hibernate: $0
Start-up waitSeconds per cold container, "starting up" past the capMilliseconds; past the model rate limit people queue with a position shown
CeilingOur cap of 60, then costThe AI provider's rate limit (checked first, FC-00)

6. Assumptions and sources

InputValueSource
Everyday message today$0.15 average on Opus 5.5 (3 to 4 model calls)Measured on 20 typical questions, CHAT_COST_PER_MESSAGE.md, 16 Nov
Funnel build todayabout 40 messages at $0.25 (change turns carry the full funnel tool list)19 Nov live test: 17 answers, about 40 approval rounds
Funnel build merged40 answers parsed on Sonnet at about $0.017, 15 writing turns on Opus at about $0.20PRD: script engine, phase-scoped tools under 8k tokens
Everyday message mergedOpus about $0.08, Sonnet about $0.04 (cached 1 hour prefix)Opus 5.5 $4 / $20, cache read $0.20; Sonnet 5.5 $2 / $10, cache read $0.10 per million tokens
Containerstandard-1: 1/2 vCPU, 4 GiB, about $0.042 an awake hour; 50 awake minutes per visit, 8 messages a visitCloudflare Containers pricing: memory $0.0000025 per GiB-s, CPU $0.00002 per active vCPU-s
Durable Object128 MB while a turn runs, about 20 s a turn; $0 hibernatingCloudflare Durable Objects pricing: $12.50 per million GB-s, hibernation not billed
Own providerModel cost moves to the customer's own key; Tantra pays only platformOwner decision, 19 Nov

Estimates, not invoices. Phase 4 of the PRD replaces them with measured cost per completed funnel from the load test.