Cost & Branch

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

Before you install

  • This version was reviewed before it was listed on Jun 11, 2026
  • Doesn't ask to connect to the internet
  • Needs jq and git installed.
  • Cost prints exactly as Claude Code sends it, with no fixed decimals, so you see $0 or $4.12.
Not showing after you paste? Fix it

Preview

Clean repo
Opus 4.8 main 22% $0.41
New session
Opus 4.8 main 0% $0
Dirty branch
Sonnet 4.6 feat/auth 48% $0.41
Near-full
Opus 4.8 main 91% $4.12
1M context
Fable 5 main 64% $0.41
Post-compact
Haiku 4.5 main 0% $0.41
Worktree
Opus 4.8 worktree-feature 37% $0.41
Non-git
Opus 4.8 - 22% $0.41

In Claude Desktop

Cost & Branch in Claude Desktop

Recorded with statusline-anywhere.

What it does

A single colored line with the model, git branch, how full the context window is, and what the session has cost so far in dollars.

Written in
Bash
Network access
None requested
Works in
Terminal

How it works

  1. Pulls the model, context_window.used_percentage and cost.total_cost_usd with jq.
  2. Gets the branch from git branch --show-current, or prints - outside a git repo.
  3. Drops the decimals from the percentage and shows 0% until Claude Code reports one.
  4. Colors each field: cyan model, green branch, yellow percent, magenta cost.

Source

#!/usr/bin/env bash
json=$(cat)
model=$(echo "$json" | jq -r ".model.display_name")
branch=$(git branch --show-current 2>/dev/null || echo "-")
pct=$(echo "$json" | jq -r ".context_window.used_percentage // 0" | cut -d. -f1)
cost=$(echo "$json" | jq -r ".cost.total_cost_usd")
printf "\033[36m%s\033[0m  \033[32m%s\033[0m  \033[33m%s%%\033[0m  \033[35m\$%s\033[0m" "$model" "$branch" "$pct" "$cost"

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/cost-branch-edd70d34.svg)](https://staging.statuslin.es/c/cost-branch-edd70d34?utm_source=readme-badge)

Or show the preview card:

Preview on statuslin.es
[![Preview on statuslin.es](https://staging.statuslin.es/og/c/cost-branch-edd70d34.png)](https://staging.statuslin.es/c/cost-branch-edd70d34?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
Opus 4.8 │ ✍️ 78% │ app (main) │ +128/-34 Cost $0.4100 Tokens in 44.0k │ cache write 5000 │ cache read 2000 │ out 1.4k
Opus 4.8 │ ✍️ 22% │ app (main) │ ● high current ●●○○○○○○○○ 26% ⟳ 3:35pm weekly ○○○○○○○○○○ 7% ⟳ oct 20, 2:28pm

Related mods

⎿ 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