Tech Update / Adventures with Claude Code #21
The status line – everything important at a glance
Which model is running? How full is the context? Which branch am I on, and what has this session cost so far? I used to answer these questions with commands all the time. Today they're simply at the bottom of the terminal.
Claude Code has a fully customisable status line.
✨ The quick way
/statusline Show model, git branch and how full the context is, as a percentage
Claude writes a small script for it, saves it under ~/.claude/ and registers it. Don't like it? Just refine: "Make the context red above 80 percent."
🔧 What's behind it
settings.json contains an entry pointing to any script you like:
{
"statusLine": {
"type": "command",
"command": "~/.claude/statusline.sh"
}
}
The script receives all the information as JSON and prints one line of text. That includes the model, working directory, session cost, context window usage and, depending on your plan, how much of your usage limits you've already used.
💡 My setup
Model, branch, context in percent and the five-hour limit. That way I see in time when a /clear is due (part 9), instead of being surprised by a sudden limit.
A word of caution:
The script runs very often. Keep it fast, without network calls or expensive git commands in large repositories. And as with hooks (part 11): read other people's status line scripts first, then install them.
My rule of thumb:
- Anything I keep checking with a command belongs in the status line.
- Less is more: four values, not fourteen.
- Try things with
/statusline, polish in the script.
Deutsch
English