ttft-prompt-caching-audit

Audits LLM request paths for prefix-cache stability and time-to-first-token latency.

10|1|Updated Jul 7, 2026
One-click install
npx skills add https://github.com/catalystctl/catcode --skill ttft-prompt-caching-audit-catalystctl
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: ttft-prompt-caching-audit
Source: https://github.com/catalystctl/catcode/tree/main/.catalyst-code/skills/ttft-prompt-caching-audit
Command: npx skills add https://github.com/catalystctl/catcode --skill ttft-prompt-caching-audit-catalystctl

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Slow time-to-first-token in an LLM agent harness is usually caused by a broken prompt prefix cache or oversized requests, and this Skill walks the exact code paths that decide both so you can find and fix the bottleneck. ## Core Features & Use Cases - Prefix-cache stability audit: Verifies the system prompt is built from stable sources and that transient work-state messages stay at the tail so they never bust the cached prefix. - Per-provider caching check: Confirms implicit caching on OpenAI-compatible paths and detects missing explicit cache_control breakpoints on the Anthropic path, the single biggest TTFT lever. - Cache-hit measurement: Uses already-captured metrics like cached_tokens, cache_read_input_tokens, and ttft_ms to diagnose cache health without writing new code. - Use Case: When chat turns feel slow to start responding, run this audit to discover that the Anthropic request builder never sets cache_control, then add explicit breakpoints on the stable system block and last persisted message. ## Quick Start Ask the agent to audit the TTFT and prompt-caching health of the provider request path and report the one concrete fix that would improve first-token latency.

Frequently Asked Questions about ttft-prompt-caching-audit

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I reduce time to first token in an LLM agent?

Reduce TTFT by maximizing the prompt prefix-cache hit rate and shrinking request size. Ensure the system prompt is stable across turns, keep changing content at the message tail, enable provider caching, and tune compaction so stale tool results are digested early.

How do I enable prompt caching for the Anthropic API?

Anthropic does not cache by default, so you must set cache_control either as a top-level field or as explicit breakpoints on content blocks. Place breakpoints on the last stable system block and the last persisted message, never on content that changes every turn.

Does OpenAI prompt caching require explicit configuration?

No, OpenAI-compatible endpoints perform implicit prefix caching with no opt-in required. You can verify it is working by reading cached_tokens from prompt_tokens_details in the usage response and comparing it to total input tokens.

Why is my Anthropic cache_read_input_tokens always zero?

Zero cache reads usually mean no cache_control breakpoints are set, or the breakpoint sits on a block that changes every turn such as a transient work-state tail. Automatic caching targets the last block, so a changing tail yields zero hits.

How do I measure prompt cache hit rate in an agent harness?

Compare cached_tokens or cache_read_input_tokens against total input tokens logged per turn. If cached tokens roughly equal input tokens the cache is healthy; if near zero, something in the prompt prefix is mutating between turns.