What it does
A shell script that adds a persistent status bar to your Claude Code CLI, showing three things at a glance:
- Model name — the current model (e.g. "Opus 4.6") in bold
- Context usage bar — a 20-character progress bar showing how much of your context window you've used
- Session cost — running USD total for the current session

Install
One command:
curl -sL https://gist.githubusercontent.com/thfrench/3c1470f7dcabfcf5b455d2f693d1b812/raw/install.sh | bash
This downloads the script to ~/.claude/statusline.sh and adds the statusLine setting to your Claude Code config.
What each element shows
The status bar renders in your terminal as a single line with three components:
- Model — shown in bold, extracted from the Claude Code session data
- Context bar —
[==========..........]style, 20 characters wide, filling up as you use context - Cost — cumulative session spend in USD
Autocompact-aware scaling
This is the key feature. Claude Code has autocompact enabled by default — when your context reaches ~84% of the window, it automatically compacts the conversation to free up space.
The script detects whether autocompact is enabled by checking:
autoCompactin~/.claude/settings.jsonautoCompactin~/.claude/settings.local.json- Project-level
.claude/settings.jsonand.claude/settings.local.json - The
CLAUDE_AUTOCOMPACT_PCT_OVERRIDEenvironment variable
When autocompact is on (the default), the progress bar scales to the compaction threshold (~84%) rather than the full context window. This means the bar represents your actual usable space before compaction triggers, not the theoretical 200K max.
When autocompact is off, the bar scales to the full 100%.
Colour coding
Colours are based on effective usage after scaling:
- Gray — under 60% of the effective ceiling. Plenty of room.
- Orange — 60-84%. Getting warm.
- Red — 85%+. Compaction is imminent (or you're hitting the context limit if autocompact is off).
Compaction tracking
The script writes the last-seen percentage to a temp file (/tmp/claude-statusline-*). If the percentage drops by more than 20 points between updates, it counts that as a compaction event and displays a counter: (x1), (x2), etc.
This lets you see at a glance how many times your conversation has been compacted in the current session.
Customisation
The script lives at ~/.claude/statusline.sh. Edit it directly to change:
- Bar width or characters
- Colour thresholds
- What information is displayed
- Compaction detection sensitivity
Uninstall
Remove the statusLine entry from your ~/.claude/settings.json:
{
"statusLine": "~/.claude/statusline.sh"
}
Delete that line (or the whole key), then remove the script:
rm ~/.claude/statusline.sh
About Claude Code's statusLine feature
Claude Code supports a statusLine setting that points to a shell script. The script is executed periodically and its stdout is rendered as a persistent status bar in the terminal. This is the same mechanism used here — the script simply reads Claude Code's own session data and formats it for display.