Claude Code status line

Claude Cache Guard

Local-only Claude Code statusLine bridge for usage-aware session handoff.

Install

Install
npm install -g claude-cache-guard

Found in the project README. Check it for setup steps after installing.

From source
git clone https://github.com/yuliang615/claude-cache-guard.git

From the README

Claude Cache Guard

English | 繁體中文 | 简体中文

claude-cache-guard (CLI: ccg) is a local-only usage guard for Claude Code. Before your 5-hour usage window runs out, it has Claude write a compact handoff file (next_session.md) so you pick the work back up in a fresh, small session — no re-reading the old conversation as uncached tokens, no /clear-style loss of detail.

Why: Claude Code re-sends the whole conversation every turn, and prompt caching normally absorbs that — but the cache goes cold while you wait out a spent window. Resume a big session then, and the entire conversation is re-read as uncached input tokens, charged in full against your usage, before any real work starts — and the window didn't hold much to begin with.

Quick start

Step 1 — Install (once per machine)

The installer asks one question:

Press Enter to accept the default (90), or type a number from 1 to 99 — you can change it per project later.

After installing, restart Claude Code — exit and run claude again (or open a new session in the app). That's what loads the /ccg* slash commands, which then work in every project. /clear is not enough: it clears the conversation but does not reload commands.

From source instead of npm:

Step 2 — Enable for the project

In the project's directory, start claude and run:

That's it — the handoff workflow is now active for this project. On Claude Code v2.1.169+ it takes effect right away; on older versions, start a new session for it to fully kick in (the command prints a note about this). Prefer the terminal? ccg enable in the project directory does the same thing. What it actually sets up is covered in How it works below.

Step 3 — Work as usual

When 5-hour usage reaches the threshold, ccg asks Claude to write a compact next_session.md and stops the goal —…
Read the full README on GitHub

How status lines work

  • A status line is a command Claude Code runs to draw the bar under the prompt. It gets the session as JSON on stdin (model, folder, cost, context) and prints one or more lines.
  • Point the statusLine setting in ~/.claude/settings.json at it: { "statusLine": { "type": "command", "command": "<the command from the README>" } }.
  • Or run /statusline inside Claude Code and describe what you want.
Claude Code docs

Details

Language
JavaScript
License
MIT
Last updated
5 July 2026

FAQ

What is Claude Cache Guard?

Local-only Claude Code statusLine bridge for usage-aware session handoff. It is a status line for Claude Code, from yuliang615/claude-cache-guard on GitHub.

How do I install Claude Cache Guard?

Run npm install -g claude-cache-guard, then follow the setup in the README.

Is Claude Cache Guard popular?

yuliang615/claude-cache-guard has 36 GitHub stars and 0 forks. It was last updated on 5 July 2026.

More status lines

Browse the most popular Claude Code mods, all status lines, or the skills and MCP server directories.