@prafulsrivastava/claude-statusline
v2.3.3
Published
A Claude Code StatusLine hook showing model, cost, context window usage, and git branch
Maintainers
Readme
ClaudeExtensions
A collection of hooks and extensions for Claude Code.
Hooks
hooks/statusline.sh
A StatusLine hook that displays real-time session info in your terminal status bar:
- Model shortname (
op= Opus,so= Sonnet,ha= Haiku) - Cost accumulated in the current session (
$0.03) - Context window usage with a color-coded progress bar (green/yellow/red) and token count
- Git branch with a
*suffix if the working tree is dirty
Example output:
[so] $0.04 | ████░░░░░░ 42.3% (85K/200K) | main*Installation
Requirements
- Claude Code installed
- Node.js (the hook runs via
node)
via npm (recommended)
npm install -g @prafulsrivastava/claude-statuslineThe postinstall script automatically copies the hook to ~/.claude/hooks/statusline.js and updates ~/.claude/settings.json with the required config. Just restart Claude Code after installing.
Manual install
Copy the hook to your Claude hooks directory:
macOS / Linux
mkdir -p ~/.claude/hooks curl -o ~/.claude/hooks/statusline.js \ https://raw.githubusercontent.com/PrafulSrivastava/ClaudeExtensions/main/hooks/statusline.sh chmod +x ~/.claude/hooks/statusline.jsWindows (PowerShell)
New-Item -ItemType Directory -Force "$env:USERPROFILE\.claude\hooks" Invoke-WebRequest ` -Uri "https://raw.githubusercontent.com/PrafulSrivastava/ClaudeExtensions/main/hooks/statusline.sh" ` -OutFile "$env:USERPROFILE\.claude\hooks\statusline.js"Register the hook in your Claude Code settings (
~/.claude/settings.json):{ "statusLine": { "type": "command", "command": "node ~/.claude/hooks/statusline.js" } }On Windows use
node %USERPROFILE%\.claude\hooks\statusline.jsfor the command.Start or restart Claude Code — the status line will appear automatically.
Contributing
Pull requests are welcome. Please open an issue first to discuss any significant changes.
License
MIT
