Waiting agents give their memory back

An agent session waiting for the owner now ends its process once its prompt cache has expired anyway, and the owner's next word resumes it. Measured first, as the task demanded: does resuming cost more tokens than keeping the process?

No extra tokens for Claude Code, once one gap was closed (below). Its process now goes after 65 minutes of waiting. Codex's cache lifetime could not be measured (its usage limit stopped the run), so Codex sessions rest only after 24 hours for now.

1. How long Claude Code keeps the cache: one hour

Every request of Obeya's agents over the last week, by the pause before it: was the conversation read from the cache?

Pause before the requestRequestsRead from cache
under 4 min25,27525,262
6 – 30 min223222
30 – 55 min5959
55 – 65 min84
65 – 120 min290
over 2 hours1640

Every cache write used the one-hour tier. After an hour of waiting, even a process that was kept pays for its whole conversation again.

2. Kept against rested: the same messages after the same pause

Sessions with the same first turn (a conversation of about 81,000 tokens), then a short message after the pause and another 90 s later.

SessionRead from cacheWritten to cacheNew tokens, 1st msgNew tokens, 2nd msg
Kept, 2 min pause81,1291641920
Rested, 2 min pause81,1391841920
Kept, 65 min pause081,3151920
Rested, 65 min pause081,2781920

Within the hour a resumed session reads its whole conversation from the cache; after it, both write the same amount. Over a week of Obeya restarts, 666 of 669 resumed sessions read their whole conversation from the cache. The other three had their instructions rebuilt; a resting session keeps its own.

3. The gap the measurement found, and its fix

A session resumed too early told the agent that the claude.ai connector tools (Docs, Calendar) were gone, then announced them again once they had connected. That cost about 2,300 tokens per resume that a kept process never pays. A resumed session now waits until all its tool servers are listed and connected before it takes the message. That takes 1 to 2.5 seconds, and it waits 15 seconds at most.

ResumesWith extra tokens
Before the fix (12)4 (≈ 640 tokens to drop the tools, ≈ 1,700 to add them back)
After the fix (16)0 (19 and 20 new tokens, the same as kept)

This also applies to the resumes after each restart of Obeya, so those no longer cost the extra tokens either.

4. In a running Obeya

  1. A real worker asked the owner a question and waited. The rest time was set to 60 seconds for this check.
  2. 63 seconds later its process was gone.
  3. The owner answered. 3 seconds later the agent replied in the same conversation ("You picked 'Good day'"), and nothing on the card showed that its process had ended.
  4. The reply read 34,259 tokens from the cache and wrote 60.

5. What it frees

On 9 November, 15 waiting sessions held 3.9 GB, and each Claude Code process held 250 – 460 MB. A session that waits longer than an hour now holds none. This covers card workers, ideas' agents, project agents and the Koordinator alike.

Open