Showing Context In The Status Line.mp4
Claude Code doesn't show your context window usage by default. You need to set this up yourself if you want to monitor it constantly while you're coding.
Having that number right in your status line, visible at a glance, gives you the feedback you need to make good decisions about your session. We'll use ccstatusline, a community tool that formats Claude Code's session data into a clean status line.
mkdir -p ~/.config/ccstatusline
~/.config/ccstatusline/settings.json with this content:{
"version": 3,
"lines": [
[
{
"id": "1",
"type": "context-length",
"color": "yellow",
"bold": true,
"rawValue": true
},
{
"id": "2",
"type": "custom-text",
"customText": "(",
"color": "brightBlack",
"merge": "no-padding"
},
{
"id": "3",
"type": "context-percentage",
"color": "brightBlack",
"rawValue": true,
"merge": "no-padding"
},
{
"id": "4",
"type": "custom-text",
"customText": ")",
"color": "brightBlack",
"merge": "no-padding"
}
],
[],
[]
],
"flexMode": "full-minus-40",
"compactThreshold": 60,
"colorLevel": 2,
"defaultSeparator": " ",
"inheritSeparatorColors": false,
"globalBold": false,
"powerline": {
"enabled": false,
"separators": [" "],
"separatorInvertBackground": [false],
"startCaps": [],
"endCaps": [],
"autoAlign": false
}
}
This configures four widgets on one line: a bold yellow token count (context-length), followed by a dimmed percentage in parentheses. The "merge": "no-padding" on the parentheses and percentage widgets glues them together without extra spacing, while "defaultSeparator": " " adds a space between the token count and the opening parenthesis. "rawValue": true strips the labels so you get clean numbers.
~/.claude/settings.jsonIf this file doesn't exist yet, create it.
{
"statusLine": {
"type": "command",
"command": "npx ccstatusline@latest"
}
}
Preserve any other settings that might already exist in this file. Claude Code pipes session data to this command automatically — ccstatusline reads it and outputs the formatted status line.
Close the application fully and reopen it.