Session Band

Know when Claude Code's prompt cache expires

·

source at c871c15

·

MIT license

One band above the prompt with the turn number, output speed, turn and session cost, a prompt cache countdown and context fill. It warns you before the cache expires.

What this mod can do

  • Reviewed at commit c871c15
  • Runs programs
  • Runs Claude Code's tools, such as Bash and Edit, which still pass the session's permission check
  • Reads environment variables
3 more things it can do
  • Reads files
  • Adds the /session_data command
  • Runs on a timer
Good to know (3)
  • The macOS notifier is built once with notifier/build.sh and needs Xcode's command line tools
  • Without that helper, or off macOS, it uses Claude Code's own notification, with no title or click-through
  • Warnings come at 10 and 5 minutes left, and none fire while a turn is running
Are mods safe?

Preview

Terminal

⎿ session-band: Cache demo: 15 min left until the next answer resets it. ╭─────────────────────────────────────────────────────────────────────────────────────────────╮ [-] │ Turn 1 — $0.00 | $0.41 14:15 22% × │ ╰─────────────────────────────────────────────────────────────────────────────────────────────╯

Claude Desktop

Session Band in Claude Desktop

What it does

In the author's words

Band above the prompt: turn number, output speed, turn and session cost, prompt cache countdown and context fill; notifies before the cache expires.

What you see
A one-row band above the prompt, framed amber then red
Works in
Terminal and Claude Desktop
Slash commands
/session_data
Uses your tokens
No
Changes files
Yes
Network access
Only through programs it runs
Reviewed commit
c871c15
Preview recorded with
Claude Code 2.1.309

How it works

  1. Restarts a 1-hour prompt cache countdown each time Claude answers
  2. Reads the last response's speed in tok/s, the turn and session cost, and context fill
  3. Draws one band above the prompt, dropping details as the window narrows
  4. Frames the band amber 20 minutes before the cache expires and red at 10

Common questions

How long does Claude Code's prompt cache last?

This mod counts down a 1-hour prompt cache from Claude's last answer, and the next answer resets it. The band turns amber with 20 minutes left and red with 10.

Can I get a notification before the prompt cache expires?

Yes. At 10 and 5 minutes left it posts a system notification saying how many minutes remain. On macOS a helper app built with notifier/build.sh gives it a title and click-through; otherwise it falls back to Claude Code's own notification, which also reaches your phone over Remote Control.

How do I preview the cache warning?

Run /session_data demo <minutes> to pretend the cache has that many minutes left. It shows the colors and the warning, and the next answer resets it.

How do I hide the band?

Click × to hide it for the rest of the session, or run /session_data to show or hide it.

Badge for your README

Own this listing? Add it to your README. The badge shows the install count as it grows.

Reviewed on statuslin.es
[![Reviewed on statuslin.es](https://staging.statuslin.es/badge/mods/session-band.svg)](https://staging.statuslin.es/mods/session-band?utm_source=readme-badge)

Or show the preview card:

Preview on statuslin.es
[![Preview on statuslin.es](https://staging.statuslin.es/og/mods/session-band.png)](https://staging.statuslin.es/mods/session-band?utm_source=readme-badge)

More like this

⎿ cache-tax: keepwarm on for 6h00m, a ping 50m after each idle stretch keeps the cache read, not re-written ⎿ cache-tax: claude-opus-5-5 state warm, 1h00m left context 44,000 tokens cold cost $0.35 to re-write it (warm turn $0.01) keepwarm on, 6h00m left · ping in 50m break-even up to 40 pings at the read rate cost one cold write, about 33h20m of idle at one ping per 50m guard ask first (/cache-tax guard warn to only show the price) session 0 cold writes paid, $0.00 [>] cache-tax · warm · keepwarm 6h00m left · ping in 50m [-]

A Claude Code mod that keeps the one-hour prompt cache warm during breaks and asks before a cold send, showing its estimated rewrite cost. Warming uses model requests and costs tokens. Requires Claude Code 2.1.287+.

Deck in Claude Desktop

A cockpit for Claude Code: plan bars and subagent strips, context, usage limits with reset countdowns and burn rates, spend, the model route and a pet. Six bar styles, three collapsed looks. CLI and Desktop.

Flightdeck in Claude Desktop

Flightdeck: a live agent dashboard for Claude Code. Main model vitals, an on-call architect, every permission check, subagent cards and swimlanes, a turn receipt and a session log, all from real session events

Opus 4.8 high ✦ │ ctx 22% │ app (main) │ PR #1287 ● │ $0.41 · 10m +128 -34 Session ● ● ● ● ● ● ● ● ○ ○ ○ 74% left Resets in 2h 6m Weekly ● ● ● ● ● ● ● ● ● ● ○ 93% left Resets in 2d 0h

Feature-rich bash status line with model, context bar, session cost (read live from Claude Code, so it stays correct on any model), rate-limit bars, and live tool/agent activity that adapts to terminal width. Source: github.com/JungHoonGhae/claude-statusline

Opus 4.8 │ main │ app │ ▓▓░░░░░░░░ 44k/200k │ $0.41

Catppuccin Frappé–themed status line with model, git branch and dirty flag, folder, a block context bar, and session cost. Source: github.com/danjdewhurst/cc-status-line

Opus 4.8 │ ✍️ 78% │ app (main) │ +128/-34 Cost $0.4100 Tokens in 44.0k │ cache write 5000 │ cache read 2000 │ out 1.4k

Compact status line showing model, context remaining %, directory/git, session time and lines changed, with rate-limit bars or a cost/token breakdown. Source: github.com/susomejias/claude-statusline

Opus 4.8 main 22% $0.41

Color-coded model, branch, context %, and session cost. Example statusline inspired by the Claude Code docs (code.claude.com/docs/en/statusline).