Opus 4.8 [high] ~/app main
16:20:55 | ⛁ ██░░░░░░░░ 22% | 5h ●◔○○○ 26% ↻2h7m | 7d ◔○○○○○○ 7% ↻2d1h │ $0.41 ⏱ 10m
Cost Thresholds
Directory, Node version when a package.json is around, added and removed lines with a net-direction arrow, a token bar, and a session cost that changes color as it grows.
Before you install
- This version was reviewed before it was listed on Jul 6, 2026
- Doesn't ask to connect to the internet
- Calls jq and bc, plus node -v when the folder has a package.json
- The bar counts session totals (total_input_tokens plus output), not used_percentage, and hides at 0
- Its segment separator is empty, so segments are split by spaces only
Preview
app ⏱ 10m ▲ +128 -34 ▓░░░░░░░ 22% $0.41 ◆ Opusapp ⏱ 10m $0.00 ◆ Opusapp ⏱ 10m ▲ +128 -34 ▓▓▓░░░░░ 48% $0.41 ◇ Sonnetapp ⏱ 10m ▲ +128 -34 ▓▓▓▓▓▓▓░ 91% $4.12 ◆ Opusapp ⏱ 10m ▲ +128 -34 ▓▓▓▓▓░░░ 64% $0.41 ● Fable 5app ⏱ 10m ▲ +128 -34 $0.41 ○ Haikufeature ⏱ 10m ▲ +128 -34 ▓▓░░░░░░ 37% $0.41 ◆ Opusscratch ⏱ 10m ▲ +128 -34 ▓░░░░░░░ 22% $0.41 ◆ OpusWhat it does
One line with the folder, session time, lines added and removed, an 8-cell token bar, session cost and model. The cost turns yellow at $2 and red at $10.
- Written in
- Bash
- Network access
- None requested
- Works in
- Terminal
How it works
- Reads folder, model, token totals, cost, duration and line counts from stdin with jq
- Divides input plus output tokens by the window size; yellow from 50%, red from 75%
- A green ▲ means more lines added than removed, a red ▼ the reverse
- Opus, Sonnet and Haiku get their own symbol and color, while Fable 5 shows in gray
Source
#!/bin/bash
export TERM=xterm-256color
input=$(cat)
cwd=$(echo "$input" | jq -r '.workspace.current_dir')
model=$(echo "$input" | jq -r '.model.display_name // empty')
# Token usage
input_tokens=$(echo "$input" | jq -r '.context_window.total_input_tokens // 0')
output_tokens=$(echo "$input" | jq -r '.context_window.total_output_tokens // 0')
context_limit=$(echo "$input" | jq -r '.context_window.context_window_size // 0')
total_tokens=$((input_tokens + output_tokens))
# Cost & stats
cost=$(echo "$input" | jq -r '.cost.total_cost_usd // empty')
duration_ms=$(echo "$input" | jq -r '.cost.total_duration_ms // 0')
lines_added=$(echo "$input" | jq -r '.cost.total_lines_added // 0')
lines_removed=$(echo "$input" | jq -r '.cost.total_lines_removed // 0')
# Colors - basic ANSI codes compatible with most terminals
RED=$'\033[31m'
GREEN=$'\033[32m'
YELLOW=$'\033[33m'
BLUE=$'\033[34m'
MAGENTA=$'\033[35m'
CYAN=$'\033[36m'
GRAY=$'\033[90m'
RESET=$'\033[0m'
SEP="${GRAY}${RESET}"
short_dir=$(basename "$cwd")
# Node version (only if package.json exists)
node_info=""
if [ -f "$cwd/package.json" ] 2>/dev/null; then
node_ver=$(node -v 2>/dev/null | sed 's/v//')
[ -n "$node_ver" ] && node_info=" ${SEP} ${GREEN}⬢ ${node_ver}${RESET}"
fi
# Session duration
duration_info=""
if [ "$duration_ms" -gt 0 ] 2>/dev/null; then
duration_sec=$((duration_ms / 1000))
if [ "$duration_sec" -ge 3600 ]; then
hours=$((duration_sec / 3600))
mins=$(((duration_sec % 3600) / 60))
duration_fmt="${hours}h${mins}m"
elif [ "$duration_sec" -ge 60 ]; then
mins=$((duration_sec / 60))
duration_fmt="${mins}m"
else
duration_fmt="${duration_sec}s"
fi
duration_info=" ${SEP} ${CYAN}⏱ ${duration_fmt}${RESET}"
fi
# Lines changed
lines_info=""
if [ "$lines_added" -gt 0 ] || [ "$lines_removed" -gt 0 ] 2>/dev/null; then
net=$((lines_added - lines_removed))
if [ "$net" -gt 0 ]; then
net_symbol="${GREEN}▲${RESET}"
elif [ "$net" -lt 0 ]; then
net_symbol="${RED}▼${RESET}"
else
net_symbol="${GRAY}=${RESET}"
fi
lines_info=" ${SEP} ${net_symbol} ${GREEN}+${lines_added}${RESET} ${RED}-${lines_removed}${RESET}"
fi
# Token usage with progress bar
token_info=""
if [ "$total_tokens" -gt 0 ] 2>/dev/null; then
if [ "$total_tokens" -ge 1000 ]; then
tokens_fmt="$((total_tokens / 1000))k"
else
tokens_fmt="$total_tokens"
fi
if [ "$context_limit" -gt 0 ] 2>/dev/null; then
pct=$((total_tokens * 100 / context_limit))
# Color based on usage
if [ "$pct" -ge 75 ]; then
bar_color="$RED"
elif [ "$pct" -ge 50 ]; then
bar_color="$YELLOW"
else
bar_color="$GREEN"
fi
# Build progress bar using simple chars: ▓ filled, ░ empty
bar_width=8
filled=$((pct * bar_width / 100))
[ "$filled" -gt "$bar_width" ] && filled=$bar_width
[ "$filled" -lt 1 ] && [ "$pct" -gt 0 ] && filled=1
empty=$((bar_width - filled))
bar="${bar_color}"
for ((i=0; i<filled; i++)); do bar+="▓"; done
bar+="${GRAY}"
for ((i=0; i<empty; i++)); do bar+="░"; done
bar+="${RESET}"
token_info=" ${SEP} ${bar} ${GRAY}${pct}%${RESET}"
fi
fi
# Cost with meaningful colors
cost_info=""
if [ -n "$cost" ] && [ "$cost" != "null" ]; then
cost_fmt=$(printf "%.2f" "$cost")
cost_cents=$(printf "%.0f" "$(echo "$cost * 100" | bc)")
if [ "$cost_cents" -ge 1000 ] 2>/dev/null; then
cost_color="$RED"
elif [ "$cost_cents" -ge 200 ] 2>/dev/null; then
cost_color="$YELLOW"
else
cost_color="$GREEN"
fi
cost_info=" ${SEP} ${cost_color}\$${cost_fmt}${RESET}"
fi
# Model with tier colors
model_info=""
if [ -n "$model" ]; then
case "$model" in
*Opus*) model_color="$MAGENTA"; model_symbol="◆"; short_model="Opus" ;;
*Sonnet*) model_color="$BLUE"; model_symbol="◇"; short_model="Sonnet" ;;
*Haiku*) model_color="$GREEN"; model_symbol="○"; short_model="Haiku" ;;
*) model_color="$GRAY"; model_symbol="●"; short_model="$model" ;;
esac
model_info=" ${SEP} ${model_color}${model_symbol} ${short_model}${RESET}"
fi
printf "${BLUE}${short_dir}${RESET}%s%s%s%s%s%s" "$node_info" "$duration_info" "$lines_info" "$token_info" "$cost_info" "$model_info"
Badge for your README
Own this listing? Add it to your README. The badge shows the install count as it grows.
[](https://statuslin.es/c/cost-thresholds-c8eb535b?utm_source=readme-badge)
Or show the preview card:

[](https://statuslin.es/c/cost-thresholds-c8eb535b?utm_source=readme-badge)
More status lines
Opus 4.8 │ main │ app │ ▓▓░░░░░░░░ 44k/200k │ $0.41
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
🌿 main │ Opus 4.8/hi │ 🟢 Ctx ▓▓░░░░ 22% │ ⏳ 🟢 ▓▓░░░░ 26% ↻ 2h7m │ $0.41 ⏱ 10m
app · main · Opus 4.8 · high
ctx 22% 44k · 5h 26% ↻2h6m · 7d 7% ↻2d0h · cost $0.41 · msg $0.757Related mods

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).

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