CLAUDE LABJP
FORK — Claude Code 2.1.212 changes what /fork does: it copies your conversation into a new background session with its own row in claude agents, so you can keep working. The old in-session subagent is now /subtaskLIMITS — WebSearch calls are now capped at 200 per session by default, and subagent spawns get the same 200 ceiling, so a runaway search or delegation loop stops on its ownMCPBG — MCP tool calls running past two minutes now move to the background automatically, keeping the session usable. Tune the threshold with CLAUDE_CODE_MCP_AUTO_BACKGROUND_MSPLANFIX — Fixed plan mode auto-running file-modifying Bash commands such as touch and rm without a permission prompt or an SDK canUseTool callbackSONNET5 — Claude Sonnet 5 is running on introductory pricing of $2 per million input tokens and $10 per million output. After August 31 it moves to $3 and $15IPO — Bankers are reportedly lining up investor meetings for Anthropic ahead of a possible public listing as soon as OctoberFORK — Claude Code 2.1.212 changes what /fork does: it copies your conversation into a new background session with its own row in claude agents, so you can keep working. The old in-session subagent is now /subtaskLIMITS — WebSearch calls are now capped at 200 per session by default, and subagent spawns get the same 200 ceiling, so a runaway search or delegation loop stops on its ownMCPBG — MCP tool calls running past two minutes now move to the background automatically, keeping the session usable. Tune the threshold with CLAUDE_CODE_MCP_AUTO_BACKGROUND_MSPLANFIX — Fixed plan mode auto-running file-modifying Bash commands such as touch and rm without a permission prompt or an SDK canUseTool callbackSONNET5 — Claude Sonnet 5 is running on introductory pricing of $2 per million input tokens and $10 per million output. After August 31 it moves to $3 and $15IPO — Bankers are reportedly lining up investor meetings for Anthropic ahead of a possible public listing as soon as October
Articles/Claude Code
Claude Code/2026-03-27Intermediate

Claude Code Statusline — Displaying Rate Limits and Building Custom Scripts

Learn how to customize Claude Code's statusline to display real-time rate_limits usage. Covers settings.json configuration, custom script creation, and community tools for monitoring your usage.

Claude Code197statuslinerate limits5customization4configuration6

Visualize Your Usage with Claude Code's Statusline

When working in Claude Code for extended sessions, one question inevitably comes up: "How much of my rate limit have I used?" For Pro and Max plan subscribers, Claude enforces rolling 5-hour and 7-day usage windows, and hitting those limits mid-task can be frustrating.

Since Claude Code v2.1.80, the statusline feature now exposes a rate_limits field, letting you monitor your usage percentage and reset times in real time. This guide walks you through setting up the statusline, building custom scripts, and leveraging community tools to stay on top of your usage.

For a broader look at all Claude Code settings, check out our Claude Code settings.json Complete Guide.

What Is the Statusline?

The statusline is an information bar displayed at the bottom of your Claude Code terminal interface. By default, it shows the active model and token counts, but you can extend it with custom commands to display virtually anything.

Common information you can show includes:

  • Model name: The currently active model (Sonnet 4.6, Opus 4.6, etc.)
  • Token usage: Input/output token counts for the current session
  • rate_limits: 5-hour and 7-day window usage percentages and reset times
  • Git info: Current branch name and repository status
  • Custom data: Anything your script outputs

Basic Setup: Adding a Statusline to settings.json

Configure the statusline in your user settings at ~/.claude/settings.json:

{
  "statusLine": {
    "type": "command",
    "command": "echo 'Hello from statusline'"
  }
}

Adding this simple configuration causes Claude Code to run your command and display its output in the status bar.

Settings File Locations

ScopePathPurpose
User settings~/.claude/settings.jsonPersonal customization
Project settings.claude/settings.jsonProject-specific config
Enterprise~/.claude/settings.d/*.jsonOrganization policy distribution

The statusline is typically configured at the user level.

Working with the rate_limits Field

Starting with v2.1.80, Claude Code passes a rate_limits object to your statusline script via standard input as JSON. Here's the structure:

{
  "rate_limits": {
    "five_hour": {
      "used_percentage": 42.5,
      "resets_at": 1711540800
    },
    "seven_day": {
      "used_percentage": 15.3,
      "resets_at": 1712059200
    }
  }
}

Field Reference

  • five_hour.used_percentage: Usage within the 5-hour rolling window (0–100)
  • five_hour.resets_at: Reset timestamp (Unix epoch seconds)
  • seven_day.used_percentage: Usage within the 7-day window (0–100)
  • seven_day.resets_at: Reset timestamp (Unix epoch seconds)

This field is only available for Claude.ai subscribers (Pro/Max) and appears after the first API response in a session. It won't show up when using API keys directly.

Building Custom Statusline Scripts

Simple Bash Script

Let's start with a straightforward Bash script that displays rate limit information:

#!/bin/bash
# ~/.claude/statusline.sh
# Custom statusline script for Claude Code
 
# Read JSON data from stdin
INPUT=$(cat)
 
# Extract rate_limits with jq
FIVE_HOUR=$(echo "$INPUT" | jq -r '.rate_limits.five_hour.used_percentage // "N/A"')
SEVEN_DAY=$(echo "$INPUT" | jq -r '.rate_limits.seven_day.used_percentage // "N/A"')
MODEL=$(echo "$INPUT" | jq -r '.model // "unknown"')
 
# Convert reset time to human-readable format
RESETS_AT=$(echo "$INPUT" | jq -r '.rate_limits.five_hour.resets_at // 0')
if [ "$RESETS_AT" != "0" ] && [ "$RESETS_AT" != "null" ]; then
  RESET_TIME=$(date -d "@$RESETS_AT" '+%H:%M' 2>/dev/null || date -r "$RESETS_AT" '+%H:%M' 2>/dev/null)
else
  RESET_TIME="--:--"
fi
 
# Output the formatted statusline
echo "${MODEL} | 5h: ${FIVE_HOUR}% | 7d: ${SEVEN_DAY}% | Reset: ${RESET_TIME}"

Make it executable and register it in your settings:

chmod +x ~/.claude/statusline.sh
{
  "statusLine": {
    "type": "command",
    "command": "~/.claude/statusline.sh"
  }
}

Node.js for a Richer Display

For more sophisticated formatting, a Node.js script gives you greater flexibility:

#!/usr/bin/env node
// ~/.claude/statusline.mjs
// Statusline with progress bars
 
import { createInterface } from 'readline';
 
const rl = createInterface({ input: process.stdin });
let data = '';
 
rl.on('line', (line) => { data += line; });
rl.on('close', () => {
  try {
    const info = JSON.parse(data);
    const parts = [];
 
    // Shortened model name
    const model = info.model || 'unknown';
    const shortModel = model.replace('claude-', '').replace('-4-6', '4.6');
    parts.push(shortModel);
 
    // Rate limits with progress bars
    if (info.rate_limits) {
      const fiveHour = info.rate_limits.five_hour;
      const sevenDay = info.rate_limits.seven_day;
 
      if (fiveHour) {
        const bar = makeBar(fiveHour.used_percentage);
        parts.push(`5h ${bar} ${fiveHour.used_percentage.toFixed(0)}%`);
      }
      if (sevenDay) {
        const bar = makeBar(sevenDay.used_percentage);
        parts.push(`7d ${bar} ${sevenDay.used_percentage.toFixed(0)}%`);
      }
    }
 
    // Token usage
    if (info.tokens) {
      const total = info.tokens.input + info.tokens.output;
      parts.push(`${(total / 1000).toFixed(1)}k tok`);
    }
 
    console.log(parts.join(' | '));
  } catch {
    console.log('statusline error');
  }
});
 
function makeBar(percentage) {
  const filled = Math.round(percentage / 10);
  const empty = 10 - filled;
  return '[' + '='.repeat(filled) + '-'.repeat(empty) + ']';
}

Expected output looks like this:

sonnet4.6 | 5h [====------] 42% | 7d [==--------] 15% | 12.3k tok

Quick Inline Configuration

If you prefer not to create a separate script file, you can use an inline command directly in settings.json:

{
  "statusLine": {
    "type": "command",
    "command": "jq -r '\"\\(.model // \"?\") | 5h: \\(.rate_limits.five_hour.used_percentage // 0 | round)% | 7d: \\(.rate_limits.seven_day.used_percentage // 0 | round)%\"'"
  }
}

This is great for quick experimentation, though external scripts are better suited for complex logic.

Community Tools Worth Exploring

The Claude Code community has built several polished statusline tools:

claude-powerline

Inspired by Vim's Powerline, this tool offers themed, color-coded statusline displays with rich customization options.

# Install
npm install -g claude-powerline
 
# Register in settings.json
# "command": "claude-powerline"

ccusage

A usage analytics and visualization tool that includes statusline integration for tracking your Claude Code consumption over time.

# Install
npm install -g ccusage
 
# See https://ccusage.com/guide/statusline for statusline setup

ClaudeCodeStatusLine (Rust)

A performant Rust-based tool by Daniel Barreto that displays model, tokens, rate_limits, and git information in real time.

# Install via cargo
cargo install --git https://github.com/daniel3303/ClaudeCodeStatusLine

For general strategies on managing rate limits, see our Rate Limits Best Practices guide.

What to Do When Approaching Rate Limits

When your statusline shows usage climbing, here are practical strategies to stay productive:

1. Switch Models

Switching from Opus 4.6 to Sonnet 4.6 reduces rate limit consumption. Most coding tasks work perfectly well with Sonnet.

# Switch model mid-session
/model sonnet

2. Adjust Effort Levels

Use the --effort flag to control response depth. For simple queries, lower effort means fewer tokens consumed.

claude --effort low "What's the return type of this function?"

3. Split Long Sessions

Extended sessions accumulate context, increasing token consumption per request. Starting fresh sessions periodically helps manage your rate limit budget more effectively.

For deeper optimization techniques, see Mastering Claude Code's Effort Settings.

Looking back

Claude Code's statusline is a small configuration change that delivers a significant improvement to your development workflow. Real-time rate_limits visibility helps you plan your work sessions, avoid unexpected interruptions, and make informed decisions about model selection and effort levels.

Start with a simple inline command, graduate to a Bash or Node.js script as your needs grow, and explore community tools when you want a polished, ready-made solution. The key is making your usage data visible so you can code with confidence.

Share

Thank You for Reading

Claude Lab is ad-free, supported entirely by members like you. We publish practical guides daily with implementation code, benchmarks, and production-ready patterns. If you've found it useful, we'd love to have you on board.

  • Copy-paste ready implementation code
  • New advanced guides published daily
  • $5/mo or $10 for lifetime access
View Membership →

If you found this article helpful, a small tip ($1.50) would mean a lot to us. Your support helps keep this site ad-free and covers server and hosting costs.

Related Articles

Claude Code2026-04-12
CLAUDE.md Not Working? A Complete Troubleshooting Guide for Claude Code
Claude Code ignoring your CLAUDE.md settings? This guide covers the most common causes — wrong file location, formatting issues, conflicting configs, and more — with clear fixes for each.
Claude Code2026-03-20
Claude Code Output Styles Guide — Customize Responses to Maximize Development Efficiency
Master Claude Code's output styles feature. Learn how to use built-in styles, create custom styles, and distribute team-wide configurations through plugins to transform your AI pair programming experience.
Claude Code2026-07-03
Keep the Extra Capacity Out of Your Baseline — Burning Backlog During the Time-Boxed +50% Weekly Limit
Claude Code's weekly limits are raised 50% until July 13. A design for spending the temporary headroom only on finite backlog work: an expiry-aware burst queue, a dual-lane ledger, and a single ratio that tells you whether your baseline quietly grew.
📚RECOMMENDED BOOKS
Build a Large Language Model (From Scratch)
Sebastian Raschka
LLM Dev
Prompt Engineering for LLMs
Berryman & Ziegler
Prompting
AI Engineering
Chip Huyen
AI Eng
* Contains affiliate links
See all →