Black Friday sale: 85 Claude Code agents for $29 one-time · lifetime updatesGet access →
Free Tool

Claude Code Statusline Generator

Pick what you want to see at the bottom of Claude Code (model, context used, cost, git branch, plan limits), check the live preview, then copy a ready-to-run script and the statusLine block for settings.json. It uses the official status line JSON fields.

Live preview
> _
[Opus] | my-app | git:main | ▓▓▓▓░░░░░░ 42% | +156 -23
Presets:
Show
Status line script
~/.claude/statusline.sh
#!/bin/bash
# Claude Code status line. Made with claudeagents.co/tools/claude-code-statusline-generator
# Claude Code sends session data as JSON on stdin. Needs jq.
input=$(cat)

DIR=$(echo "$input" | jq -r '.workspace.current_dir // .cwd')
MODEL=$(echo "$input" | jq -r '.model.display_name // "Claude"')
BRANCH=$(git -C "$DIR" branch --show-current 2>/dev/null)
PCT=$(echo "$input" | jq -r '.context_window.used_percentage // 0' | cut -d. -f1)
ADDED=$(echo "$input" | jq -r '.cost.total_lines_added // 0')
REMOVED=$(echo "$input" | jq -r '.cost.total_lines_removed // 0')

parts=()
parts+=("\033[36m[$MODEL]\033[0m")
parts+=("\033[34m${DIR##*/}\033[0m")
[ -n "$BRANCH" ] && parts+=("\033[32mgit:$BRANCH\033[0m")
FILLED=$((PCT * 10 / 100)); EMPTY=$((10 - FILLED)); BAR=""
[ "$FILLED" -gt 0 ] && printf -v F "%${FILLED}s" && BAR="${F// /▓}"
[ "$EMPTY" -gt 0 ] && printf -v E "%${EMPTY}s" && BAR="${BAR}${E// /░}"
parts+=("\033[33m$BAR $PCT%\033[0m")
parts+=("\033[32m+$ADDED\033[0m \033[31m-$REMOVED\033[0m")

SEP=" | "
out=""
for p in "${parts[@]}"; do [ -n "$out" ] && out+="$SEP"; out+="$p"; done
printf "%b\n" "$out"
settings.json
~/.claude/settings.json
{
  "statusLine": {
    "type": "command",
    "command": "~/.claude/statusline.sh",
    "padding": 0
  }
}
Make it executable and test it
chmod +x ~/.claude/statusline.sh

# Test it with sample data
echo '{"model":{"display_name":"Opus"},"workspace":{"current_dir":"'"$PWD"'"},"context_window":{"used_percentage":42},"cost":{"total_cost_usd":0.37,"total_lines_added":156,"total_lines_removed":23,"total_duration_ms":720000}}' | ~/.claude/statusline.sh

How to install your status line

  1. Save the script as ~/.claude/statusline.sh (or download it and move it there).
  2. Make it executable and test it with the sample command shown above. You need jq installed.
  3. Add the statusLine block to ~/.claude/settings.json. If the file has other settings, add the block next to them.
  4. Start Claude Code. The line appears at the bottom and updates after each reply.

Fields like the 5-hour and weekly limits only appear for Claude Pro, Max and Ultra subscribers, and the script simply skips them when they are missing. Cost is an estimate at list price.

Skip the setup: 85 ready-made agents for Claude Code

Coding, SEO and marketing agents, 52 skills and 53 slash commands. Installs with one line.

All free tools →

Frequently asked questions

Save a script (for example ~/.claude/statusline.sh), make it executable with chmod +x, and add a statusLine block to ~/.claude/settings.json with type "command" and the script path as command. Claude Code runs the script and shows what it prints at the bottom of the screen.

Related guides and tools