aider-1h-ttl
Aider uses 5min TTL by default and works around long pauses with keepalive pings. Wire up the 1h TTL beta instead.
Ladder-aware Roo Code Anthropic caching — verify the rolling read/write ladder on the wire, then close the real gaps (Vertex 4-block budget, MiniMax path).
$ npx -y skills add OnlyTerp/prompt-cache-skills --skill roo-fix-volatile-msg --agent claude-codeHow it fires
How this skill gets triggered: by you, by Claude, or both.
/roo-fix-volatile-msgContext preview
The summary Claude sees to decide when to auto-load this skill.
Ladder-aware Roo Code Anthropic caching — verify the rolling read/write ladder on the wire, then close the real gaps (Vertex 4-block budget, MiniMax path).
name: roo-fix-volatile-msg description: Ladder-aware Roo Code Anthropic caching — verify the rolling read/write ladder on the wire, then close the real gaps (Vertex 4-block budget, MiniMax path). target_harness: Roo Code target_repo: RooCodeInc/Roo-Code target_files: - src/api/transform/caching/anthropic.ts - src/api/providers/anthropic.ts - src/api/providers/anthropic-vertex.ts - src/api/providers/minimax.ts target_commit: v3.54.0 (ladder verified live 2026-08-28; transform moved to src/api/transform/caching/) estimated_savings: avoids a harmful "fix" + protects Vertex 4-block budget
> **REANALYZED 2026-08-28.** The previous version of this skill > replaced Roo's last-two-user-messages marking with a single "last > stable message" breakpoint. Direct source recon shows Roo (a Cline > fork) carries the same documented rolling read/write ladder as > Cline — the inline comment explains it verbatim. Applying the old > diff would remove a working cache write point. Verify the ladder > instead; the real Roo-specific wins are below.
`src/api/transform/caching/anthropic.ts` in `RooCodeInc/Roo-Code` (moved there by v3.54.0 — the ladder function `addCacheBreakpoints` lives in that file now; `src/api/providers/anthropic.ts` calls it).
Permalink: https://github.com/RooCodeInc/Roo-Code/blob/v3.54.0/src/api/transform/caching/anthropic.ts
Same shape as Cline (see [cline-fix-volatile-msg](../cline-fix-volatile-msg/SKILL.md) for the full ladder explanation — Roo's inline comment documents it verbatim): current user turn = write point, previous user turn = read point, system prompt has its own breakpoint.
Same 3-turn capture as the Cline skill. **Ladder holds** → leave the breakpoints alone. **Thrash** → real bug, apply the Cline skill's diagnosis. Do not skip this step on the strength of the source code alone — the ladder only proves itself on the wire.
Roo's `anthropic-vertex.ts` documents Vertex-specific limits: max 4 `cache_control` blocks, text-only, user/assistant restrictions — and implements an explicit strategy (system + last text block of each of the last two user messages). If you patch message-level caching on direct Anthropic, make sure the Vertex path still fits its own budget:
unless it replaces a message breakpoint.
Roo scans show **zero** `prompt_cache_key` usage across the codebase (665 TS files checked, 2026-08-28). Its OpenAI-native handler relies on automatic prefix matching only. That works for single-session use but leaves multi-worker pod routing to chance — the same gap Cline has. See [cline-openai-cache-key](../cline-openai-cache-key/SKILL.md) for the hash-derivation pattern; the same fix applies to `src/api/providers/openai-native.ts` (derive the key from system prompt + model slug, NOT a per-session UUID).
Roo's `minimax.ts` handler (and any Anthropic-compatible provider added later) re-implements `addCacheControl` with the same last-two-user-messages shape. Any future provider handler copied from it inherits the ladder — apply the same verify-don't-rip rule, and check the compat endpoint actually honors `cache_control` (gotcha 17: a 200 response proves nothing).
3-turn capture on the direct Anthropic path unchanged in shape; Vertex capture shows ≤4 blocks per request; OpenAI path shows stable `prompt_cache_key` across turns and non-zero `cached_tokens` by turn 2.
Drop-in prompt-caching fixes for the LLM agent harness you use. Point your AI coding agent at this repo and it ships the patches.
Aider uses 5min TTL by default and works around long pauses with keepalive pings. Wire up the 1h TTL beta instead.
Aider's --cache-prompts is off by default. Flip it on for supported models.
Ladder-aware Cline Anthropic caching — verify the rolling read/write ladder on the wire, then add the tools breakpoint and tune…
Cline OpenAI native provider sends no prompt_cache_key. Add a stable per-task key so cached_tokens stops being zero.
Cline's system prompt includes a timestamp that may be recomputed per request, invalidating the system-prompt cache.
Continue's prompt caching is opt-in via config and off by default. Flip the default to systemAndTools.