Follow Discord
Sweep 22 Oct 2026 · 04:32Z Build v2.1.308 527 read Stable v2.1.308 Latest v2.1.308 Next v2.1.308 Feeds RSS JSON llms.txt llms-full.txt Unofficial

Claude Code v2.1.248 ·

Agents can set their own prompt cache lifetime in frontmatter

An agent file can set its own prompt cache lifetime under experimental cacheTtl.

Use it now Notable New Features
JSON All of v2.1.248
Use it nowTier: how much it should matter to you
3Useful: my rating, 1 to 5
4Signal: worth watching, 1 to 5
SubagentsArea: what it touches
New FeaturesKind: in v2.1.248,
What probably matters to youSection of the release
What

An agent definition file can declare a prompt cache time-to-live under experimental: { cacheTtl }, and that value is carried into the query as an agent-level override of how long the prompt cache entry lives. It only takes effect when no higher-precedence setting is present, so agents that leave it out behave exactly as before. Nothing like this existed in the previous build.

Details
  • The CLAUDE_CODE_PROMPT_CACHE_TTL environment variable and the promptCacheTtl setting both win over the frontmatter value, which applies only when the subagentPromptCacheTtl setting and its environment variable are both absent, and is recorded with the reason agent_frontmatter.
  • A value of "1h" is rejected when the caller is in a mode where a one-hour cache is not permitted, and the field's own description notes that a one-hour value is ignored while a Claude subscription is in overage.
  • The experimental object is permissive: unrecognised keys inside it are ignored rather than rejected by the otherwise strict agent frontmatter check.
  • The override is only passed along when the agent actually sets it, so the default path is unchanged.
Evidence

{ ttl: t, reason: "agent_frontmatter" }, agentCacheTtlOverride, Experimental per-agent options; unknown keys are ignored.

Strings lifted out of the shipped bundle, so the claim above can be checked against them.

Read from
Names in the bundlecacheTtlexperimental
Since it was published

The entry above is what we published on the day. These lines were added later, as Anthropic's own pages caught up, and they sit beside the original rather than replacing it.

Added since A small documentation edit on TypeScript SDK V2 session API (removed) touched a line naming experimental after this was published. V2 was an experimental session API that removed the need for async generators and yield coordination. Instead of managing generator state across turns, each turn was a separate `send()`/`stream()` cycle. The API surface reduced to creating… agent-sdk/typescript-v2-preview see the edit
Confirmed since Anthropic's documentation has since written up experimental, on Plugins reference. | `experimental.themes` | string\|array | Color theme files/directories (replaces default `themes/`). See [Themes](#themes) | `"./themes/"` | plugins-reference see the edit
How sure we are
Two sources agreeTwo things we can check say the same as this entry.
Anthropic's documentation agreesAnthropic's documentation has since written up experimental, on Plugins reference.
Anthropic's release notes agreeAdded experimental.cacheTtl ("5m" or "1h") to agent frontmatter: a per-agent prompt cache TTL used when no subagent TTL setting is…

See this entry in the whole of v2.1.248 →

Feedback