DEV Community

Cover image for /statusline: Build Your Dream Status Bar for Claude Code
Rajesh Royal
Rajesh Royal

Posted on

/statusline: Build Your Dream Status Bar for Claude Code

Git info? Token count? Bitcoin price? Prayer times? Wordle streak? Whatever you need, the statusline delivers.

From: x.com/adocomplete


Every developer has their own definition of "essential information." Some need to know their current git branch at all times. Others obsess over token usage. And some — let's be honest — want to keep an eye on Bitcoin while they code.

The beauty of Claude Code's statusline feature is that it doesn't judge. Whatever information makes you more productive (or just happier), you can put it right there at the bottom of your terminal.

Today, we're exploring the customizable status bar that lets you turn Claude Code into your Claude Code.

The Problem

Standard terminals and AI interfaces give you what they think you need. The problem is, they're often wrong. Or at least, incomplete.

Maybe you're working across multiple git branches and need constant visibility into which one you're on. Maybe you're budget-conscious and want to track token usage in real-time. Maybe you're a freelancer tracking billable time. Maybe you work across time zones and need to know what time it is in Tokyo before you send that message.

The default answer to all of this is: "Open another terminal tab" or "Check a different app" or "Just remember it."

None of these are good. They all require context switching. They all add friction. They all make you do work that your tools should be doing for you.

The Solution

Claude Code's /statusline command puts a customizable information bar at the bottom of your interface. You decide what goes there. The possibilities are genuinely endless.

How to Use It

Basic usage:

/statusline
Enter fullscreen mode Exit fullscreen mode

This opens the statusline configuration. From here, you can define what information appears and how it's formatted.

Quick configuration example:

/statusline git:branch model tokens
Enter fullscreen mode Exit fullscreen mode

Now your statusline shows:

  • Current git branch
  • Active Claude model
  • Token usage for the session

Built-in Information Types

Claude Code comes with several built-in statusline components:

Component What it shows
git:branch Current git branch
git:status Clean/dirty working directory
model Current Claude model
tokens Tokens used in session
tokens:remaining Estimated tokens remaining
time Current time
session Current session name
cwd Current working directory

Example configuration:

/statusline git:branch git:status | model | tokens | time
Enter fullscreen mode Exit fullscreen mode

Result:

main ● | claude-3-opus | 12,847 tokens | 14:32
Enter fullscreen mode Exit fullscreen mode

Custom Commands and Scripts

Here's where it gets fun. You can add any command output to your statusline:

Weather:

/statusline "$(curl -s wttr.in/?format=%t)"
Enter fullscreen mode Exit fullscreen mode

Bitcoin price:

/statusline "BTC: $(curl -s api.coindesk.com/v1/bpi/currentprice.json | jq -r '.bpi.USD.rate')"
Enter fullscreen mode Exit fullscreen mode

System load:

/statusline "Load: $(uptime | awk -F'load average:' '{print $2}' | cut -d, -f1)"
Enter fullscreen mode Exit fullscreen mode

Pomodoro timer:

/statusline "$(cat ~/.pomodoro_status 2>/dev/null || echo 'No timer')"
Enter fullscreen mode Exit fullscreen mode

Prayer times (for those who observe):

/statusline "Next prayer: $(~/.scripts/next_prayer.sh)"
Enter fullscreen mode Exit fullscreen mode

Wordle streak:

/statusline "🟩 Wordle: $(cat ~/.wordle_streak)"
Enter fullscreen mode Exit fullscreen mode

Yes, really. If you can get it from a command line, you can put it in your statusline.

Pro Tips

🎯 Tip 1: Keep it scannable. The statusline is most useful when you can glance at it and get info in under a second. Don't cram too much.

🎯 Tip 2: Use separators wisely. Pipe characters (|) and spaces make sections visually distinct. Example: git:branch | tokens | time

🎯 Tip 3: Create context-specific statuslines. Different projects need different info. Save configurations and switch between them:

# In your shell config
alias statusline-work="/path/to/claude statusline git:branch jira-ticket model tokens"
alias statusline-personal="/path/to/claude statusline git:branch weather time"
Enter fullscreen mode Exit fullscreen mode

🎯 Tip 4: Refresh intervals matter. For dynamic data (like API prices), consider the refresh rate. You probably don't need second-by-second Bitcoin updates while debugging code.

🎯 Tip 5: Combine with tmux/screen. If you're already using terminal multiplexers, coordinate your statuslines to avoid redundant information.

Real-World Use Case

Let's look at three different developers and their statusline setups:

Alex — The DevOps Engineer:

/statusline git:branch | "k8s: $(kubectl config current-context)" | "pods: $(kubectl get pods --no-headers | wc -l)" | time
Enter fullscreen mode Exit fullscreen mode

Alex's statusline shows:

main | k8s: prod-cluster | pods: 47 | 16:22
Enter fullscreen mode Exit fullscreen mode

Always knows the current branch, which Kubernetes cluster is active, and how many pods are running. Essential for someone who could accidentally deploy to production.

Jordan — The Freelance Developer:

/statusline session | tokens | "$( ~/.scripts/billable_time.sh)" | "Rate: $$(~/.scripts/hourly_rate.sh)"
Enter fullscreen mode Exit fullscreen mode

Jordan's statusline shows:

client-acme-api | 8,234 tokens | 2h 34m billable | Rate: $127.50
Enter fullscreen mode Exit fullscreen mode

Tracks the session, token usage for cost estimates, billable time, and current calculated rate. Invoicing just got easier.

Morgan — The Focused Developer:

/statusline git:branch | model | "Focus: $(($(date +%s) - $(cat ~/.focus_start))) seconds"
Enter fullscreen mode Exit fullscreen mode

Morgan's statusline shows:

feature/auth | claude-3.5-sonnet | Focus: 2847 seconds
Enter fullscreen mode Exit fullscreen mode

Minimal distractions. Just the branch, the model, and a focus timer to encourage deep work.

Building Your Perfect Setup

Here's a process for building your ideal statusline:

  1. Start minimal. Begin with just git branch and tokens. Use it for a day.

  2. Notice what you're checking manually. Every time you switch to another window for information, ask: "Could this be in my statusline?"

  3. Add incrementally. One new component at a time. See if it adds value or just noise.

  4. Iterate ruthlessly. If you haven't looked at a statusline component in a week, remove it.

  5. Context switch your statusline. Different projects might need different setups. That's fine.

Conclusion

The /statusline feature embodies a philosophy: your tools should adapt to you, not the other way around.

Whether you need practical git information, token tracking for budget management, or yes, your Wordle streak — Claude Code's statusline puts it where you need it. No extra windows. No context switching. Just a glance and you know.

The best statusline is the one you build for yourself. So build it.

Tomorrow in Day 15: We're going full no-limits. What if Claude Code never asked for permission again? Enter YOLO mode: --dangerously-skip-permissions. It's powerful. It's risky. It has "danger" right in the name. Let's talk about when to use it. ⚠️


What's on your statusline? Share your setup and follow along for the rest of the 31 Days of Claude Code Features!

Top comments (0)