Customize Your Claude Code Status Line to Manage Token Burn
Customize the Claude Code status line with a script that shows context window fill, 5-hour session limits, and 7-day quota after every turn. Works on macOS, Linux, and Windows.
by Andrew Connell
Last updated June 6, 2026
24 minutes read
Why the status line is worth customizing
Claude Code lets you replace its default status line with the output of any script you want. After every turn, it runs your script and hands it a JSON payload describing the current session: the model you’re using, how full your context window is, and how much of your rate limits you’ve consumed.
What the Claude Code status line displays
Here’s what mine looks like:
Line 1: where am I?
Line 2: who am I, and what am I driving?
![A terminal line showing the logged-in Claude account email address, the active model ID (claude-opus-4-8[1m]), and total context window size (1,000k tokens).](/content/blog/claude-code-cli-statusline/claude-statusline-line-2_hu_e626fe137b6770b9.webp)
Line 3: how much runway do I have?
How to use context window data to manage token consumption
The context window segment drives a simple habit: when the context grows large and the history isn’t earning its keep, I compact or clear the session.
Going over the limit
Here’s what makes Claude Code’s pricing model more forgiving than it first appears: when you exhaust your session or weekly limit, it automatically switches to metered pricing and pulls from any pre-purchased credits you have on hand.
How the Claude Code status line script works
I maintain two versions of the script so it covers every platform:
- statusline.sh: a bash script for anyone running Claude Code from a macOS or Linux terminal, or on Windows inside WSL or Git Bash.
- statusline.ps1: a PowerShell port for anyone running Claude Code on Windows from cmd.exe or PowerShell. It also runs fine under PowerShell 7+ on macOS and Linux if that’s your shell of choice.
Install it on macOS, Linux, WSL, or Git Bash
If you’re on macOS or Linux, or on Windows using WSL or Git Bash, you’ll use the bash script:
- Copy statusline.sh to ~/.claude/statusline.sh.
- Make sure it has the correct permissions applied, by running the following:
chmod +x ~/.claude/statusline.sh - Open ~/.claude/settings.json and add:
"statusLine": { "type": "command", "command": "~/.claude/statusline.sh" }
Install it on Windows with cmd.exe or PowerShell
If you’re on Windows running Claude Code from cmd.exe or PowerShell, use the PowerShell script:
- Copy statusline.ps1 to ~/.claude/statusline.ps1.
- Open ~/.claude/settings.json and add:
"statusLine": { "type": "command", "command": "powershell -NoProfile -File $HOME/.claude/statusline.ps1" }
Wrapping it up
Usage-based pricing changed the deal for a lot of developers, and whether you’ve moved to Claude Code or you’re managing credits in another tool, the lesson is the same: token consumption is now something you manage, not something you ignore. A status line that surfaces your context window and quota consumption after every turn turns that management from guesswork into a glance.