Claude Code status line

claude-usage-line

A status line with rate limits, git branch, cost and diff stats.

40 stars 3 forksStatus lines Source

Install

Install
npx claude-usage-line setup
From source
git clone https://github.com/canack/claude-usage-line.git

From the README

claude-usage-line

Cross-platform Claude Code statusline — session context, 5-hour & 7-day rate limits (Pro/Max) or organization monthly cap (Enterprise), git branch, diff stats, cost, and duration. Zero runtime dependencies, no jq required.

Pro/Max output (Claude Code sends rate_limits on stdin):

Enterprise output (no rate_limits on stdin → OAuth fallback fetches extra_usage):

Minimal output (only context_window provided, no fallback data yet):

Prerequisites

- Node.js ≥ 18
- Claude Code ≥ 2.1

For Pro/Max subscribers, rate_limits is provided directly by Claude Code on stdin — no OAuth, no API keys, no network calls.

For Enterprise users, stdin doesn't include rate_limits, so the statusline falls back to a background OAuth call against the same endpoint Claude Code's own /usage view reads (api.anthropic.com/api/oauth/usage). The OAuth token is read from your existing Claude Code login (macOS keychain / secret-tool / Windows Credential Manager / ~/.claude/.credentials.json). No API key needed; nothing new to configure. To opt out, set CLAUDE_USAGE_LINE_NO_FETCH=1.

Quick Start

Or manually add to ~/.claude/settings.json:

Custom bar style:

Restart Claude Code and the statusline appears.

How It Works

The OAuth fallback path activates only when stdin doesn't carry rate_limits — i.e. Pro/Max users on Claude Code 2.1+ never hit the API, while Enterprise users get the org-cap bar through a cached background fetch (60s TTL minimum, 5min default to avoid 429s).

Supported stdin fields

When cwd or model is present → 2-line output. Otherwise → single-line (backward compatible).

rate_limits is populated by Claude Code for Claude.ai Pro/Max subscribers after the first API response of a session. When absent, the OAuth fallback path (Enterprise) takes over and renders the…
Read the full README on GitHub

How status lines work

  • A status line is a command Claude Code runs to draw the bar under the prompt. It gets the session as JSON on stdin (model, folder, cost, context) and prints one or more lines.
  • Point the statusLine setting in ~/.claude/settings.json at it: { "statusLine": { "type": "command", "command": "<the command from the README>" } }.
  • Or run /statusline inside Claude Code and describe what you want.
Claude Code docs

Details

Language
TypeScript
License
MIT
Last updated
8 May 2026
Topics
aianthropicclaudecode

FAQ

What is claude-usage-line?

A status line with rate limits, git branch, cost and diff stats. It is a status line for Claude Code, from canack/claude-usage-line on GitHub.

How do I install claude-usage-line?

Run npx claude-usage-line setup, then follow the setup in the README.

Is claude-usage-line popular?

canack/claude-usage-line has 40 GitHub stars and 3 forks. It was last updated on 8 May 2026.

More status lines

Browse the most popular Claude Code mods, all status lines, or the skills and MCP server directories.