Skip to content

[BUG] Disabling telemetry also disables 1-hour prompt cache TTL #45381

@EmpireJones

Description

@EmpireJones

Preflight Checklist

  • I have searched existing issues and this hasn't been reported yet
  • This is a single bug report (please file separate reports for different bugs)
  • I am using the latest version of Claude Code

What's Wrong?

When telemetry is disabled (e.g., via DISABLE_TELEMETRY=1 or CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC=1), sessions that would otherwise receive 1-hour prompt cache TTL appear to fall back to the 5-minute TTL instead.

What Should Happen?

Prompt cache TTL selection should be independent of telemetry. If a user/session would otherwise qualify for 1-hour prompt cache TTL, it should still receive it even when telemetry is disabled.

Error Messages/Logs

Steps to Reproduce

  1. Start a session with telemetry enabled.
  2. Confirm the session is using the 1-hour prompt cache tier.
  3. Start a comparable session with either DISABLE_TELEMETRY=1 or CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC=1.
  4. Compare the cache metadata between the two sessions.
  5. Observe that the 1-hour TTL is no longer applied when telemetry is disabled.

Note: This may not be reproducible if using bedrock and ENABLE_PROMPT_CACHING_1H_BEDROCK=1 is set. I only tested with an Anthropic Claude Max plan.

What metadata to check:

In session transcripts, check the assistant response usage.cache_creation metadata for the prompt cache tier:

  • usage.cache_creation.ephemeral_1h_input_tokens
  • usage.cache_creation.ephemeral_5m_input_tokens

If 1-hour TTL is active, ephemeral_1h_input_tokens should be non-zero.
If 5-minute TTL is active, ephemeral_5m_input_tokens should be non-zero.

Claude Model

Opus

Is this a regression?

I don't know

Last Working Version

No response

Claude Code Version

2.1.96

Platform

Anthropic API

Operating System

Windows

Terminal/Shell

VS Code integrated terminal

Additional Information

No response

Metadata

Metadata

Assignees

Labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions