Equipping Claude Code
11. Status Line
Configure Claude Code's status line to monitor token usage, active model, and cost in real time.
2 min read
The status bar is a customizable line at the bottom of Claude Code that displays real-time information. It runs any shell script, receives session data as JSON via stdin, and displays whatever the script returns.
Quick method — /statusline (recommended)
Inside Claude Code, use the /statusline command and describe what you want to see. Claude generates the script automatically.
Prompt for /statusline
/statusline show: model, abbreviated directory with ~, git branch and context window % used. Example: Opus 4.6 ~/dev/curso-ia (main) 60%Manual method — Custom script
Create ~/.claude/statusline.sh:
~/.claude/statusline.sh
#!/bin/bash
input=$(cat)
MODEL=$(echo "$input" | jq -r '.model.display_name')
DIR=$(echo "$input" | jq -r '.cwd')
# Abbreviate home with ~
if [[ "$DIR" == "$HOME"* ]]; then
DIR="~\\${DIR#$HOME}"
fi
# Git branch (if in a repository)
BRANCH=$(git -C "$(echo "$input" | jq -r '.cwd')" branch --show-current 2>/dev/null)
if [[ -n "$BRANCH" ]]; then
echo "$MODEL $DIR ($BRANCH)"
else
echo "$MODEL $DIR"
fiPremium Content
Unlock all 19 sections of the Claude Code Guide with lifetime access.
$57· Lifetime
What's included:
- 19 detailed sections, from setup to workflow
- Lifetime access with updates
- Practical examples and ready-to-use configs
- Bilingual support (PT-BR and EN)