Menu

Build a Custom Claude Code Statusline (with Rate Limits and a Bell on Done)
πŸ–ΌοΈ

Build a Custom Claude Code Statusline (with Rate Limits and a Bell on Done)

DEV CommunityΒ·Francesco Di DonatoΒ·6 months ago
#BOG6f39X
#ai#claude#printf#statusline#code
Reading 0:00
15s threshold

The default Claude Code statusline is honest but thin: model name, working directory, that's about it. After a few long sessions I wanted more from it. How much of the context window have I burned? Am I close to the 5-hour rate limit? Has the agent finished and I missed it because I was in another tab?

Claude Code lets you replace the statusline with any shell command. It pipes a JSON blob to stdin on every render and prints whatever your script writes to stdout. So the upgrade is just bash and jq .

Read full blog post on my website

This is the seven-field bar I ended up with, the script behind it, and the wiring in ~/.claude/settings.json . Setup is about three minutes if you have jq installed.

Key Takeaways

The statusline is a shell command Claude Code re-runs on every UI render. It receives a JSON payload on stdin.

The payload exposes the model, context-window percentage, cwd, transcript path, and the 5h + 7d rate-limit windows.

jq parses every field in one line. ANSI escapes color the output.…

Continue reading β€” create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.