{"slug": "why-a-long-idle-pause-costs-you-claude-code-s-prompt-cache", "title": "Why a long idle pause costs you: Claude Code's prompt cache", "summary": "A developer measured how Claude Code's prompt cache expiry inflates usage-limit costs, finding that new tokens count roughly 67 times as much as cached ones on their account—so the first message after a long idle pause into a 300k-token session consumes about 1.8% of a 5-hour window versus 0.03% if the cache were still warm. The developer shipped a cold-cache warning in the limitcast Pro tool that holds the first message after idle time exceeds the cache lifetime (60 minutes by default) and reports the projected cost, alongside advice to /compact or /clear before stepping away.", "body_md": "You leave a long Claude Code session for lunch, come back, type one short message, and the 5-hour meter jumps. Nothing went wrong:\n\nthe prompt cache expired while you were away.\n\n**After a pause, your next message re-sends the whole conversation as new tokens.** New tokens count about 67 times as much\n\nagainst the limit as cached ones (on my account), so by those rates the first message back into a 300k-token session costs about 1.8% of a 5-hour\n\nwindow, where the same message a minute earlier would have cost about 0.03%.\n\nEvery Claude Code model call sends the whole conversation: instructions, tool definitions, every message and tool result so far. The\n\npart that hasn't changed since the last call is read back from Anthropic's prompt cache instead of being processed again. Cache reads\n\nare cheap, which is why a long session costs far less than its size suggests.\n\nThe cache doesn't last forever. Anthropic's docs: \"By default, the cache has a 5-minute lifetime. The cache is refreshed for no\n\nadditional cost each time the cached content is used\", and a 1-hour lifetime is available as an option\n\n([Prompt caching](https://platform.claude.com/docs/en/build-with-claude/prompt-caching)). Each call keeps it warm. Stop\n\nfor longer than its lifetime and it's gone.\n\nWith the cache gone, the next call writes the whole context to the cache again. Cache writes are new tokens, and new tokens are what\n\nthe usage limit mostly counts. From my own fit ([How many tokens is 1% of your limit?](https://limitcast.dev/blog/tokens-per-percent/)): 1% of\n\nthe 5-hour window was about 166k new tokens or 11.2M cached ones.\n\n| Context re-sent | Cache still warm | Cache expired | \n|---|---|---|\n| 100k tokens | ≈ 0.01% | ≈ 0.6% | \n| 300k tokens | ≈ 0.03% | ≈ 1.8% | \n| 600k tokens | ≈ 0.05% | ≈ 3.6% | \n\nShare of the 5-hour window for the context alone (the reply adds a little), from one account's measurement: 6.04% per million new\n\ntokens and 0.09% per million cached ones. Your plan's numbers differ; the ratio is what matters.\n\nOne message is a few percent. It adds up when you come back to several long sessions after a meeting, or when every subagent you\n\nstart after a break has to rebuild its context too.\n\n**Compact before you leave.** `/compact` replaces the conversation with a summary, so the cold rebuild is small.\n\n**Or clear it.** If the next task is unrelated, `/clear` and start fresh instead of paying to rebuild a context you don't need.\n\n**Come back to one session at a time.** Each expired session rebuilds separately.\n\n**Watch your context size.** limitcast Pro puts a `/compact` nudge in the status line once a session re-sends more than ~150k tokens per call.\n\nlimitcast Pro now has a cold-cache warning. When a session that re-sends 100k+ tokens has sat idle past the cache lifetime (60 minutes\n\nby default, `LIMITCAST_CACHE_MINUTES` to change it), it holds your first message once and tells you what it will cost against\n\nyour own measured limit. Send it again to go ahead, or `/compact` first:\n\n```\nlimitcast: this session sat idle for 75 minutes, so its prompt cache has\nexpired. Your message re-sends 300k tokens of context: ≈1.8% of your\n5-hour window (≈0.03% if the cache were still warm). Send it again to go\nahead, or run /compact first to shrink it.\n```\n\nIt comes with `limitcast install --guard` ([install](https://limitcast.dev/#install)); free installs record what it would have held.\n\nAlready installed with `--guard`? Run `limitcast doctor --fix` to add it. [More on the warning](https://limitcast.dev/#f-cold)\n\n```\nnpm install -g limitcast\nlimitcast install # records your limit readings from the status line\n# use Claude Code for a day or two, then:\nlimitcast results # what 1% of your 5-hour window is, in new and cached tokens\n```\n\nLocal only, never uses your Claude login. [Install details](https://limitcast.dev/#install) · [Pro plans](https://limitcast.dev/#pricing)\n\nlimitcast forecasts when each Claude Code and Codex window runs out, and its Pro plan stops runaway subagents before they burn the rest of it.\n\n[See what limitcast does](https://limitcast.dev/) · [How the 5-hour and weekly limits work](https://limitcast.dev/blog/claude-code-usage-limits/) ·\n\n[How many tokens is 1%?](https://limitcast.dev/blog/tokens-per-percent/) · [Subagents and your limit](https://limitcast.dev/blog/subagents/)", "url": "https://wpnews.pro/news/why-a-long-idle-pause-costs-you-claude-code-s-prompt-cache", "canonical_source": "https://dev.to/samstull9007/why-a-long-idle-pause-costs-you-claude-codes-prompt-cache-3jp4", "published_at": "2026-10-26 03:39:26+00:00", "updated_at": "2026-10-26 03:42:42.039520+00:00", "lang": "en", "topics": ["ai-tools", "developer-tools", "large-language-models", "ai-products"], "entities": ["Claude Code", "Anthropic", "limitcast"], "also_reported_by": [], "alternates": {"html": "https://wpnews.pro/news/why-a-long-idle-pause-costs-you-claude-code-s-prompt-cache", "markdown": "https://wpnews.pro/news/why-a-long-idle-pause-costs-you-claude-code-s-prompt-cache.md", "text": "https://wpnews.pro/news/why-a-long-idle-pause-costs-you-claude-code-s-prompt-cache.txt", "jsonld": "https://wpnews.pro/news/why-a-long-idle-pause-costs-you-claude-code-s-prompt-cache.jsonld"}}