Free Claude Code status line builder
Claude Code can show a custom status line at the bottom of the terminal: which model you're on, how full the context window is, what the session has cost so far, your git branch, and more. Under the hood it's a small shell script. Claude Code pipes session data to it as JSON, and whatever the script prints becomes the status line. It runs locally and doesn't use any tokens.
Pick what you want to see, copy the two pieces below, and you're done. No bash knowledge needed.
Everything runs in your browser. Nothing you pick is sent anywhere.
Preview (sample data)
1. Save this as ~/.claude/statusline.sh
Then make it executable: chmod +x ~/.claude/statusline.sh
2. Add this to ~/.claude/settings.json
If the file already has settings, add the "statusLine" block inside the existing outer braces instead of replacing the file. Claude Code reloads settings on save, so the status line appears right away.
How it works
- Claude Code runs the script when a session starts, after each new assistant message, after
/compact, and when the permission or vim mode changes. Updates are batched, so it won't run on every keystroke. Set the refresh interval only if you show something time-based. - It reads fields from the JSON with
jq:model.display_name,workspace.current_dir,context_window.used_percentage,cost.total_cost_usd,cost.total_duration_ms,cost.total_lines_added/removed,rate_limits.five_hour/seven_day,effort.level,session_name,pr.numberandvim.mode. Fields that aren't there (no git repo, no rate limits on API billing) are simply skipped. - Each
echois one row, which is how the two-line layout works. Colors are standard ANSI codes. - The cost is an estimate at list price, computed by Claude Code itself. It can differ from your actual bill and resets when
/clearstarts a new session. - Rate limits only show for claude.ai Pro and Max subscribers, and only after the first reply in a session.
Troubleshooting
- Nothing shows up: check the script is executable (
chmod +x) and thatjqis installed (brew install jqon macOS,sudo apt install jqon Debian/Ubuntu). - Test it without Claude Code:
echo '{"model":{"display_name":"Opus"},"workspace":{"current_dir":"/tmp/demo"},"context_window":{"used_percentage":42}}' | ~/.claude/statusline.sh - Want something custom? Inside Claude Code you can also type
/statuslinefollowed by what you want in plain English, and Claude writes the script for you. This builder is for when you want a known-good script you can read first. - On Windows, this bash script works through Git Bash or WSL. Native PowerShell needs a different script.
Status line blank or showing empty values? See 9 fixes for a Claude Code status line that won't show.
Field names and behavior come from Anthropic's status line documentation. This page isn't affiliated with Anthropic.
More free setup tools: the hooks & settings.json generator (guardrails in the same settings file), the CLAUDE.md generator, and the MCP config builder.
Made by Solo Stack Kits. If you use Claude Code for client work, start with the free 3-skill sample (follow-ups, meeting notes to tasks, invoice chasing), or get the full Solo Consultant Kit.