Repository navigation
Replies: 4 comments
|
Some research that may help turn this into a feature, checked on 2026-09-27 against T3 For Claude, the TTL can be read instead of guessed. Every API response breaks cache writes down by TTL: Codex needs different wording. Codex sends only Rank by what a cold start costs, not by the clock. A cold 20K-token thread is cheap; a cold 400K one is not. At API prices, next request with a warm vs a cold cache:
On a ChatGPT plan, Codex is billed in credits, and OpenAI's rate cards list no 272K multiplier and no cache-write charge for Codex. T3 already has what it needs to compute this: the rate table with its tiers ( Compaction. The cheapest action here is compacting before the cache expires; I opened a separate issue with measurements for that: #13988. Where it would pay off most:
|
|
I built a version of this for the composer's context meter: n0ah37#3. The popover shows the time left on Claude's prompt cache, taken from the last usage report plus the lifetime Claude reported. It only updates while the popover is open. If you approve the direction, I'll open it against this repo. |
|
I opened #19469 for the same problem before I found this thread, sorry for the duplicate. Linking them so the discussion stays in one place. There are now two prototypes, and both read the TTL from
The main open question for maintainers seems to be where it should live: inside the context meter popover, as a separate composer chip, or per thread in the sidebar as proposed here. One more thing to account for: ixtli reports that Claude Code can compact an idle session at about 90% of a 1h cache window behind a remote flag. If that happens, a client side countdown would no longer match the cache. Happy to close #19469 in favour of this thread if that's easier to track. |
|
@juliusmarminge, a yes/no on a narrow scope before I write any code. This picks up the "notify before the cache window closes" half of your triage in #18011, which #21682 left open after building the compact half. Why: in a review of my own usage, returning to cold Claude threads cost 132 full re-caches, 23M tokens in all. The worst was one 875K-token thread written back to the cache in a single request. If I could have seen that a thread had gone cold, I would have started a new thread instead. Where things stand on
Proposed scope: Claude only, off by default. Each slice is its own PR, and each waits for your go-ahead.
The UI copy will present the time as an estimate, since switching model or effort can also invalidate the cache. Would you take slice 1 on its own, and if so, should 2 and 3 follow? If you'd rather it go somewhere else, tell me where; I'm also fine with a "no". |
Uh oh!
There was an error while loading. Please reload this page.
I keep a dozen threads open across projects and I can never tell which ones have
gone cold. I find out by sending a message and watching the whole conversation
get re-read at full price.
The sidebar row already shows how long since a thread last did anything. It just
doesn't say what that costs me.
So I put a small chip in each row, left of the status label. It counts down the
prompt-cache window: 47m, amber under fifteen minutes, red under five, then
cold. Blank if the row has no timestamp to count from. Hover gives last activity
and the clock time it goes cold, in a card styled like the composer's
context-window popover.
Two things I'd fix before this was real. I built it by patching the shipped
bundle, so my version parses the row text. Inside the app it would read
session.statusand the same timestampresolveWorkingStartedAtalready uses.And the window isn't always an hour. It's an hour on a Claude subscription, five
minutes on an API key, and it drops to five minutes on a subscription too once
you start spending usage credits, unless
ENABLE_PROMPT_CACHING_1His set. Aclock also can't tell when the cached prefix stops matching, which is what
switching model, changing effort,
/compactor an update actually do. So thenumber is a hint, not a promise, and the copy should say so.
All reactions