---
title: "cache-keep"
url: "https://claudemods.dev/en/builds/cache-keep-deb3e1"
source: "https://github.com/maseungsidea/cache-keep"
source_type: "github"
repo: "https://github.com/maseungsidea/cache-keep"
author: "maseungsidea"
author_handle: "maseungsidea"
stars: 0
category: "Dashboards & HUD"
categories: ["hud"]
tags: ["hooks", "prompt-cache", "report-command", "statusline", "ttl-monitor"]
permission_level: 0
scan_complete: true
install: "claude plugin marketplace add maseungsidea/cache-keep\nclaude plugin install cache-keep@cache-keep"
added: "2026-10-22T08:52:25.395Z"
updated: "2026-10-22T12:02:27.782Z"
locale: "en"
---

# cache-keep

A Claude Code mod that tells you when your prompt cache silently dropped to a 5-minute TTL, measured from the session transcript, with zero model calls and no settings edits.

## Description

cache-keep is a Claude Code plugin that makes prompt-cache behavior visible without any model calls or settings edits. It reads the cache TTL from the session transcript, and infers it where the transcript can't be read. Its status line shows cache warmth (e.g. "🔥 cache warm ▰▰▰▰▱ 47m · 312k · hit 94% · 1 miss" or "🧊 cache cold · next message rewrites 312k"), where one bar cell is a fifth of the TTL (12 minutes at 1 hour); under a measured 5-minute TTL the countdown runs from 5 and the line ends "· 5m TTL". The /cache-keep command prints an immediate session report covering time left, context size, hit rate, misses and the tokens they rewrote, and the cache TTL, measured or inferred, answering even mid-turn. The alarm is one toast per session. Measured: after each main turn, cache-keep reads the newest cache write in the transcript (cache_creation.ephemeral_5m/1h_input_tokens); a 5-minute write raises the alarm and suggests checking promptCacheTtl: "1h", and while writes stay 1-hour it stays quiet. Inferred: until the TTL is measured, or where the transcript can't be read, a large context rewritten whole after a 5–55 minute gap, twice within a rolling hour, raises "5-minute TTL suspected". It counts only the main thread, skipping subagent writes, treats a miss as a request that rewrote at least half of a 50k+ context, and ignores the first request of a session plus those right after compaction or a model switch. Install via /plugin install cache-keep --marketplace maseungsidea/cache-keep or the shell equivalent; a language option (en/ko) sets the language of the status line, report and alarm. Note that API-key, cloud or extra-usage sessions run on a 5-minute TTL by design, where the alarm only confirms that choice, and where an organization manages Claude Code the Stop hook isn't delivered, so the TTL is inferred only. MIT licensed.

## Install

```
claude plugin marketplace add maseungsidea/cache-keep
claude plugin install cache-keep@cache-keep
```

## Original README

cache-keep is a Claude Code plugin that makes prompt-cache behavior visible without any model calls or settings edits. It reads the cache TTL from the session transcript, and infers it where the transcript can't be read. Its status line shows cache warmth (e.g. "🔥 cache warm ▰▰▰▰▱ 47m · 312k · hit 94% · 1 miss" or "🧊 cache cold · next message rewrites 312k"), where one bar cell is a fifth of the TTL (12 minutes at 1 hour); under a measured 5-minute TTL the countdown runs from 5 and the line ends "· 5m TTL". The /cache-keep command prints an immediate session report covering time left, context size, hit rate, misses and the tokens they rewrote, and the cache TTL, measured or inferred, answering even mid-turn. The alarm is one toast per session. Measured: after each main turn, cache-keep reads the newest cache write in the transcript (cache_creation.ephemeral_5m/1h_input_tokens); a 5-minute write raises the alarm and suggests checking promptCacheTtl: "1h", and while writes stay 1-hour it stays quiet. Inferred: until the TTL is measured, or where the transcript can't be read, a large context rewritten whole after a 5–55 minute gap, twice within a rolling hour, raises "5-minute TTL suspected". It counts only the main thread, skipping subagent writes, treats a miss as a request that rewrote at least half of a 50k+ context, and ignores the first request of a session plus those right after compaction or a model switch. Install via /plugin install cache-keep --marketplace maseungsidea/cache-keep or the shell equivalent; a language option (en/ko) sets the language of the status line, report and alarm. Note that API-key, cloud or extra-usage sessions run on a 5-minute TTL by design, where the alarm only confirms that choice, and where an organization manages Claude Code the Stop hook isn't delivered, so the TTL is inferred only. MIT licensed.
