◉CLAUDE LABJP
●2.1.296 — Sonnet 5.5 cache reads drop to $0.10/Mtok (was $0.20), and the MCP description limit rises to 4,096 characters●2.1.295 — Hooks gain onFailure: "block", so a failed or timed-out hook no longer lets the action through●SONNET 4.5 — Retires on the Claude API on 11/30, 51 days left. Migrate to Sonnet 5.5●Q&A — A long-running report: the console jumps back to the top of history whenever output is appended●HAIKU 5.5 — Code written for Haiku 4.5 hits a 400 error on budget_tokens●NEW — When first requests keep missing, hand over a one-page description of your work first●2.1.296 — Sonnet 5.5 cache reads drop to $0.10/Mtok (was $0.20), and the MCP description limit rises to 4,096 characters●2.1.295 — Hooks gain onFailure: "block", so a failed or timed-out hook no longer lets the action through●SONNET 4.5 — Retires on the Claude API on 11/30, 51 days left. Migrate to Sonnet 5.5●Q&A — A long-running report: the console jumps back to the top of history whenever output is appended●HAIKU 5.5 — Code written for Haiku 4.5 hits a 400 error on budget_tokens●NEW — When first requests keep missing, hand over a one-page description of your work first
Articles/Claude Code
⟐ Claude Code/2026-08-26Advanced

I decide the prompt cache TTL by where I come back to, not how long I was away

Claude Code v2.1.242 added promptCacheTtl and subagentPromptCacheTtl. Whether the one-hour cache pays off depends on returning to the same directory and the same git state, not on how long the break was. Here is the order I check things in.

claude-code132prompt-caching15promptCacheTtlcost-optimization31statusline

✦ Premium Article

Mornings in the iOS wallpaper app repo, afternoons on the web side, back into Xcode by evening. Running several products as an indie developer means moving between working directories many times a day. Every switch, Claude Code seemed to be re-reading the conversation from the top, and the waiting added up.

Claude Code v2.1.242 introduced two settings: promptCacheTtl and subagentPromptCacheTtl. They let you stretch the prompt cache lifetime from five minutes to one hour. My first reaction was that this would suit someone who steps away as often as I do.

Then I read the specification before writing the setting, and the deciding factor turned out not to be the length of the break. Whether the cache is still there when you return depends less on how long you waited and more on where you return to. If the destination has changed, stretching the TTL buys you a cache that never gets read once.

Two knobs, two buckets

Claude Code does not let you place cache_control yourself. It decides both the position and the boundaries. What you get to set is the lifetime, for requests split into two fixed buckets.

BucketRequests it coversSetting key
Main conversationInteractive turns, non-interactive -p runs, Agent SDK turns, and the helpers that run inline with thempromptCacheTtl
Everything elseSubagents, workflows, in-process teammates, forks, compaction, session titlessubagentPromptCacheTtl

Both accept exactly two values, 5m and 1h. Anything else is ignored. Write 30m and it is not rejected with an error; it quietly falls back to the default. That quiet fallback matters later, so keep it in mind.

{
  "promptCacheTtl": "1h",
  "subagentPromptCacheTtl": "5m"
}

The defaults, meanwhile, depend on how you are billed.

BucketClaude subscription, within plan usageUsage credits, API key, or cloud provider
Main conversationOne hourFive minutes
Everything elseFive minutes, except a small set of server-controlled helper requests that get one hourFive minutes

While you are on a subscription and inside your plan's included usage, the main conversation already runs on the one-hour cache. The moment you go over the limit and start drawing on usage credits, that usage is billed to you, so Claude Code drops back to the cheaper five-minute TTL. Sign in with an API key or go through a cloud provider and everything starts at five minutes.

So writing promptCacheTtl explicitly is worth doing in two situations: you are on an API key or a cloud provider, or you are on a subscription and want to keep the hour after passing your plan's limit. If you are comfortably inside your plan, setting "1h" changes nothing that was not already true.

Subagents start at five minutes no matter what you pay

This is where I tripped first. On a subscription, the main conversation is running on a one-hour cache. Call a subagent and that child lands in the five-minute bucket. Exactly when you fan work out in parallel, the side that would benefit most from a warm cache is the side that starts cold.

The reasoning makes sense once you read it. A subagent opens its own conversation with its own system prompt and tool set, separate from the parent's. The prefixes differ, so it cannot read the parent's cache at all. It warms one of its own across its turns instead.

A fork inverts this. A fork inherits the parent's system prompt, tools, and conversation history exactly, so its first request reads the parent's cache. Two ways of splitting work, and from the cache's point of view they are not the same thing. I wrote about their broader differences in branching cuts loose, delegation stays in the session, but the caching behaviour alone is enough to change the choice sometimes.

Does that mean you should set subagentPromptCacheTtl to "1h"? I do not. One-hour writes are billed at a higher rate than five-minute writes, and subagents are short-lived — most finish their job in a handful of turns. There is no reason to pay the expensive write for something that disappears before it can earn it back.

The one case that flips this is calling the same subagent definition repeatedly within an hour. For that, I run the numbers through the break-even formula further down before deciding.

✦

Thank you for reading this far.

Continue Reading

What follows includes implementation code, benchmarks, and practical content we hope you'll find useful. This site runs without ads — server and development costs are supported entirely by members like you. If it's been helpful, we'd be truly grateful for your support.

WHAT YOU'LL LEARN
✦You'll be able to tell, before flipping the switch, whether your own working rhythm can actually benefit from a one-hour cache
✦You'll understand why subagents and forks are treated differently by the cache, and pick the right one when you split work
✦You'll avoid the quiet days where a setting is in place but doing nothing, by checking precedence and unsupported environments up front
Secure payment via Stripe · Cancel anytime
✦

Unlock This Article

Get full access to the rest of this article. Buy once, read anytime. This site is ad-free — your support goes directly toward keeping it running.

or
Unlock all articles with Membership →
Share

Thank You for Reading

Claude Lab is ad-free, supported entirely by members like you. We publish practical guides daily with implementation code, benchmarks, and production-ready patterns. If you've found it useful, we'd love to have you on board.

  • ✦Copy-paste ready implementation code
  • ✦New advanced guides published daily
  • ✦$5/mo or $15 for lifetime access
View Membership →

Related Articles

⟐ Claude Code2026-08-28
A small script that catches invisible characters in plugin names before you install
Control characters and zero-width characters hiding in plugin or skill names are invisible in a terminal listing. I built six deliberately confusing names, compared what ls actually shows, and wrote a short check you can run before installing anything — plus an honest note on what that check misses.
⟐ Claude Code2026-06-12
Untangling Android Back-Button Ad Gates: A Parallel, Priority-Ordered Redesign with Claude Code
Nested back-button ad gates fired at the wrong moments. The parallel, priority-ordered redesign we shipped in v2.1.0, with Claude Code, Kotlin, and tests.
⟐ Claude Code2026-05-27
11 Days in Crashlytics: A Claude Code Debug Loop Across Two Android Wallpaper Apps
After shipping Beautiful Wallpapers v2.0.0 and Ukiyo-e Wallpapers v1.7.0 in early May, Crashlytics and Play Console threw more than 30 new issues at me in 11 days. This is the operations log of how I drove the fix list down to v2.1.1 / v1.8.1 using Claude Code as a triage partner.
📚RECOMMENDED BOOKS
Build a Large Language Model (From Scratch)
Sebastian Raschka
LLM Dev
Prompt Engineering for LLMs
Berryman & Ziegler
Prompting
AI Engineering
Chip Huyen
AI Eng
* Contains affiliate links