Context Bar v2

Model plus a 10-block context-usage bar. Example statusline inspired by the Claude Code docs (code.claude.com/docs/en/statusline).

26 installs

Before you install

  • This version was reviewed before it was listed on Oct 9, 2026
  • Doesn't ask to connect to the internet
  • Needs jq.
  • The bar is drawn with ▓ and ░ characters and has no color, so it never warns you as context fills.
Not showing after you paste? Fix it

Preview

Clean repo
Opus 4.8 ▓▓░░░░░░░░ 22%
New session
Opus 4.8 ░░░░░░░░░░ 0%
Dirty branch
Sonnet 4.6 ▓▓▓▓░░░░░░ 48%
Near-full
Opus 4.8 ▓▓▓▓▓▓▓▓▓░ 91%
1M context
Fable 5 ▓▓▓▓▓▓░░░░ 64%
Post-compact
Haiku 4.5 ░░░░░░░░░░ 0%
Worktree
Opus 4.8 ▓▓▓░░░░░░░ 37%
Non-git
Opus 4.8 ▓▓░░░░░░░░ 22%

In Claude Desktop

Context Bar v2 in Claude Desktop

Recorded with statusline-anywhere.

What it does

Shows the model name next to a 10-block bar and a percentage for how full the context window is.

Written in
Bash
Network access
None requested
Works in
Terminal

How it works

  1. Reads model.display_name and context_window.used_percentage from stdin with jq.
  2. Shades one block per full 10% used, rounding down, so 22% fills two of the ten.
  3. Before the first reply and right after /compact the bar is empty and reads 0%.
  4. At 91% used, nine blocks are shaded.

Source

#!/usr/bin/env bash
json=$(cat)
model=$(echo "$json" | jq -r ".model.display_name")
pct=$(echo "$json" | jq -r ".context_window.used_percentage // 0" | cut -d. -f1)
filled=$((pct / 10))
bar=""
test=""
for i in $(seq 1 10); do [ "$i" -le "$filled" ] && bar="${bar}\xe2\x96\x93" || bar="${bar}\xe2\x96\x91"; done
printf "%s  %b %s%%" "$model" "$bar" "$pct"

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/c/context-bar-3fa85f14.svg)](https://staging.statuslin.es/c/context-bar-3fa85f14?utm_source=readme-badge)

Or show the preview card:

Preview on statuslin.es
[![Preview on statuslin.es](https://staging.statuslin.es/og/c/context-bar-3fa85f14.png)](https://staging.statuslin.es/c/context-bar-3fa85f14?utm_source=readme-badge)

More status lines

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
Opus 4.8 │ main │ app │ ▓▓░░░░░░░░ 44k/200k │ $0.41

Related mods

Context Meter in Claude Desktop

The session's context window fill, right above the prompt: gray while there is room, yellow when it is time to /compact, red when a new session is better.

· ↑ 37.0k ↓ 1.4k cache 7.0k · session ↑ 111.0k ↓ 4.2k

Each turn's tokens and the session's running total, in color at the end of the hint line under the prompt.

Context Bar in Claude Desktop

Your context window as a stacked bar above the prompt, a color per category, with token counts and the compaction point. /context-bar shows or hides it.

⎿ 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+.