Context Burn Countdown

Single-line status: model, git branch, a block context burn bar (green→orange→red) with token count, and 5-hour and weekly rate-limit percentages with reset times.

12 installs

Before you install

  • This version was reviewed before it was listed on Jun 29, 2026
  • Doesn't ask to connect to the internet
  • Needs jq and git. Outside a repo the branch slot reads "no-git".
  • The 5-hour slot is an HH:MM countdown to reset, but the 7-day slot shows only the reset weekday, like "Fri".
  • Names that weekday with date -d, falling back to date -r, so GNU and BSD date both work.
Not showing after you paste? Fix it

Preview

Clean repo
Opus 4.8 | main | ██░░░░░░░░ 22.0% | 44k / 200k | 02:06 26% | Sat 7%
New session
Opus 4.8 | main | no messages yet
Dirty branch
Sonnet 4.6 | feat/auth | ████░░░░░░ 48.0% | 96k / 200k | 01:11 40% | Sun 18%
Near-full
Opus 4.8 | main | █████████░ 91.0% | 182k / 200k | 00:17 88% | Fri 61%
1M context
Fable 5 | main | ██████░░░░ 64.0% | 640k / 1M | 03:29 33% | Tue 80%
Post-compact
Haiku 4.5 | main | no messages yet | 04:01 52%
Worktree
Opus 4.8 | worktree-feature | ███░░░░░░░ 37.0% | 74k / 200k | 02:49 44% | Fri 20%
Non-git
Opus 4.8 | no-git | ██░░░░░░░░ 22.0% | 44k / 200k

In Claude Desktop

Context Burn Countdown in Claude Desktop

Recorded with statusline-anywhere.

What it does

One line with the model, git branch, a 10-block context bar with tokens used out of the window, and your 5-hour and 7-day limit percentages with when each resets.

Written in
Bash
Network access
None requested
Works in
Terminal

How it works

  1. Reads model, context and rate_limits from stdin with jq, and the branch from git.
  2. Multiplies used_percentage by context_window_size to show tokens, like "44k / 200k".
  3. The bar turns orange at 40% and red at 60%; limit numbers go orange at 50%, red at 80%.
  4. Prints "no messages yet" until context data arrives, and skips any limit that is not sent.

Source

#!/usr/bin/env bash
# Claude Code status line script

input=$(cat)

# Model
model=$(echo "$input" | jq -r '.model.display_name // "Unknown"')

# Git branch (skip locks)
branch=$(GIT_OPTIONAL_LOCKS=0 git -C "$(echo "$input" | jq -r '.workspace.current_dir // "."')" rev-parse --abbrev-ref HEAD 2>/dev/null || echo "no-git")

# Token data
used_pct=$(echo "$input" | jq -r '.context_window.used_percentage // empty')
window_size=$(echo "$input" | jq -r '.context_window.context_window_size // 0')
# Derive the absolute token count from used_percentage * window_size so that
# the bar, percentage, and token count are always consistent with each other.
# (current_usage.input_tokens is only the last-turn input, not total context fill.)
current_input=""
if [ -n "$used_pct" ] && [ "$window_size" -gt 0 ] 2>/dev/null; then
  current_input=$(echo "$used_pct $window_size" | awk '{printf "%d", ($1/100)*$2}')
fi

# Rate limit data
five_hour_pct=$(echo "$input" | jq -r '.rate_limits.five_hour.used_percentage // empty')
five_hour_resets=$(echo "$input" | jq -r '.rate_limits.five_hour.resets_at // empty')
seven_day_pct=$(echo "$input" | jq -r '.rate_limits.seven_day.used_percentage // empty')
seven_day_resets=$(echo "$input" | jq -r '.rate_limits.seven_day.resets_at // empty')

# ANSI colors (dimmed-friendly)
RESET='\033[0m'
BOLD='\033[1m'
DIM='\033[2m'
CYAN='\033[36m'
YELLOW='\033[33m'
GREEN='\033[32m'
RED='\033[31m'
ORANGE='\033[38;5;214m'
MAGENTA='\033[35m'
BLUE='\033[34m'
WHITE='\033[37m'

# Build progress bar (10 chars wide)
build_bar() {
  local pct="${1:-0}"
  local width=10
  local filled=$(echo "$pct $width" | awk '{printf "%d", ($1/100)*$2}')
  local empty=$((width - filled))

  # 0-40%: green (smart zone — full quality)
  # 40-60%: orange (time to /compact)
  # 60%+: red (quality degrading, auto-compact approaching)
  local bar_color="$GREEN"
  if [ "$(echo "$pct" | awk '{print ($1 >= 60)}')" = "1" ]; then
    bar_color="$RED"
  elif [ "$(echo "$pct" | awk '{print ($1 >= 40)}')" = "1" ]; then
    bar_color="$ORANGE"
  fi

  local bar=""
  local i=0
  while [ $i -lt $filled ]; do
    bar="${bar}█"
    i=$((i+1))
  done
  i=0
  while [ $i -lt $empty ]; do
    bar="${bar}░"
    i=$((i+1))
  done

  printf "${bar_color}${bar}${RESET}"
}

# Color for context window percentage (matches build_bar thresholds)
ctx_color() {
  local pct="${1:-0}"
  if [ "$(echo "$pct" | awk '{print ($1 >= 60)}')" = "1" ]; then
    echo "$RED"
  elif [ "$(echo "$pct" | awk '{print ($1 >= 40)}')" = "1" ]; then
    echo "$ORANGE"
  else
    echo "$GREEN"
  fi
}

# Color for rate-limit percentages: green <50%, orange <80%, red >=80%
rate_color() {
  local pct="${1:-0}"
  if [ "$(echo "$pct" | awk '{print ($1 >= 80)}')" = "1" ]; then
    echo "$RED"
  elif [ "$(echo "$pct" | awk '{print ($1 >= 50)}')" = "1" ]; then
    echo "$ORANGE"
  else
    echo "$GREEN"
  fi
}

# Format seconds-until-reset as HH:MM
fmt_countdown() {
  local resets_at="$1"
  local now
  now=$(date +%s)
  local diff=$((resets_at - now))
  if [ "$diff" -le 0 ]; then
    echo "00:00"
    return
  fi
  local hh=$((diff / 3600))
  local mm=$(( (diff % 3600) / 60 ))
  printf "%02d:%02d" "$hh" "$mm"
}

# Format large numbers with k/M suffix
fmt_num() {
  local n="$1"
  echo "$n" | awk '{
    if ($1 >= 1000000) printf "%gM", $1/1000000
    else if ($1 >= 1000) printf "%gk", $1/1000
    else printf "%d", $1
  }'
}

# Format the current context window token count and total window size
window_fmt=$(fmt_num "$window_size")

# Build output
printf "${CYAN}${BOLD}%s${RESET}" "$model"
printf " ${DIM}|${RESET} "
printf "${MAGENTA}%s${RESET}" "$branch"
printf " ${DIM}|${RESET} "

if [ -n "$used_pct" ]; then
  bar=$(build_bar "$used_pct")
  pct_fmt=$(printf "%.1f" "$used_pct")
  current_fmt=$(fmt_num "$current_input")
  pct_color=$(ctx_color "$used_pct")
  printf "%s ${pct_color}%s%%${RESET}" "$bar" "$pct_fmt"
  printf " ${DIM}|${RESET} "
  printf "${BLUE}%s / %s${RESET}" "$current_fmt" "$window_fmt"
else
  printf "${DIM}no messages yet${RESET}"
fi

# 5-hour window: HH:MM countdown + percentage consumed
if [ -n "$five_hour_pct" ] && [ -n "$five_hour_resets" ]; then
  countdown=$(fmt_countdown "$five_hour_resets")
  color=$(rate_color "$five_hour_pct")
  pct_fmt=$(printf "%.0f" "$five_hour_pct")
  printf " ${DIM}|${RESET} "
  printf "${DIM}%s${RESET} ${color}%s%%${RESET}" "$countdown" "$pct_fmt"
fi

# 7-day window: day abbreviation + percentage consumed
if [ -n "$seven_day_pct" ] && [ -n "$seven_day_resets" ]; then
  day_abbr=$(date -d "@${seven_day_resets}" +%a 2>/dev/null || date -r "$seven_day_resets" +%a 2>/dev/null)
  color=$(rate_color "$seven_day_pct")
  pct_fmt=$(printf "%.0f" "$seven_day_pct")
  printf " ${DIM}|${RESET} "
  printf "${DIM}%s${RESET} ${color}%s%%${RESET}" "$day_abbr" "$pct_fmt"
fi

printf "\n"

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://statuslin.es/badge/c/context-burn-countdown-462254d7.svg)](https://statuslin.es/c/context-burn-countdown-462254d7?utm_source=readme-badge)

Or show the preview card:

Preview on statuslin.es
[![Preview on statuslin.es](https://statuslin.es/og/c/context-burn-countdown-462254d7.png)](https://statuslin.es/c/context-burn-countdown-462254d7?utm_source=readme-badge)

More status lines

  • 182 installs
app · main · Opus-4.8 · effort high · ctx 22% · 5h 26% ↻2h6m · 7d 7% ↻2d0h
  • 115 installs
Opus 4.8 [high] ~/app main 16:20:55 | ⛁ ██░░░░░░░░ 22% | 5h ●◔○○○ 26% ↻2h7m | 7d ◔○○○○○○ 7% ↻2d1h │ $0.41 ⏱ 10m
  • 57 installs
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 Fable ● ● ● ● ● ● ● ● ● ○ ○ 85% left Resets in 2d 0h ◐ Read:index.ts ✓ Read×1 ✓ Bash×1 ✓ Edit×1 ✓ Grep×1 ◐ code-reviewer Review the change for regressions
Model: Opus 4.8 | Thinking: high | Context: [▰▰▱▱▱▱▱▱▱▱] 45k/200k (22%) | cwd: ~/app | ⎇ main | (+0,-0) Cost: $0.41 | Block: 2hr 6m | Weekly: 7.0% | Session: 10m | In: 916.7 t/s | Out: 29.2 t/s | Cached: 2k | Session: [▰▱▱▱▱] 26.0% Mem: 0.8G/1.0G | (*゚∀゚*) | Session ID: b8e1c0d2-4a6f-4e2a-9c1b-3f5d7a9e2c10
  • 21 installs
Opus 4.8 │ ✍️ 22% │ app (main) │ ● high current ●●○○○○○○○○ 26% ⟳ 6:59pm weekly ○○○○○○○○○○ 7% ⟳ aug 1, 5:52pm
  • 20 installs
Opus 4.8 | app@main | 44k/200k (22%) | effort: high | 5h 26% @18:59 | 7d 7% @Sat Aug 1, 17:52

Related mods

Token Weather Usage in Claude Desktop

One line above the prompt: context tokens with their weather, a bar per recent prompt, your 5-hour and 7-day limits against the time elapsed, the prompt cache with its time left, the session cost with the last prompt's share in dollars and in points of the 5-hour limit, the subagents running, and a one-click pill for the GOs Claude proposes. Labels in English, French or Russian. After Token Weather (Anthropic, Apache-2.0) and the ideas of usage-meter (HolyGrail) and prompt-cache-control (Daniel San).

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