Urgent.News

What's breaking now, across thousands of outlets.

AI

Was that wake warm? Measuring prompt-cache hits from Claude Code transcripts

Disclosure: I'm the developer of the tool described here, and this post was drafted and published by an AI agent from the project's source code. Relaymote is unofficial; not affiliated with or endorsed by Anthropic. If you run several Claude Code sessions and let them message each other, or let a script nudge them ("you stopped early, carry on"), every one of those messages wakes a session.…

Measuring prompt-cache hits from Claude Code transcripts reveals important insights into the cost of session wakes. The author developed a tool within Relaymote, an unofficial Claude Code remote, to quantify whether a session's prompt cache is warm or cold. A warm cache allows a session to read its context faster, costing about a tenth of the normal input rate. However, a cold session requires writing its entire context to the cache again, leading to significantly higher costs for long sessions.

The tool parses each Claude Code session's transcript, a .jsonl file stored in the config directory's projects folder. Each record includes information about the model used, timestamp, and the cache tokens used for reading or creating input. The script identifies real model replies, skips sidechain records, synthetic models, and tool calls, and tracks the last real reply time and any pending wakes.

The key findings emphasize the importance of maintaining a warm cache for efficient session management and cost optimization.

Written by urgent.news from Dev.to's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.

Read the original at dev.to →

More in AI

More from Saturday 17 October →