JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 106
  • Score
    100M100P100Q106683F
  • License MIT

Interactive CLI tool for generating custom Claude Code statuslines

Package Exports

  • @chongdashu/cc-statusline
  • @chongdashu/cc-statusline/dist/index.js

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@chongdashu/cc-statusline) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

cc-statusline

๐Ÿš€ Transform your Claude Code experience with a beautiful, informative statusline

cc-statusline in action

Real-time directory, git branch, model info, costs, and session time tracking

npm version License: MIT Node.js

โšก Quick Start

One command. Two questions. Beautiful statusline. โœจ

npx @chongdashu/cc-statusline init

That's it! Answer 2 simple questions, restart Claude Code, and enjoy your new statusline.

๐ŸŽฏ Setup with just 1 command

Demo of cc-statusline setup

โœจ What You Get

Transform your bland Claude Code terminal into an information-rich powerhouse:

  • ๐Ÿ“ Smart Directory Display - Current folder with ~ abbreviation
  • ๐ŸŒฟ Git Integration - Current branch name with clean styling
  • ๐Ÿค– Model Intelligence - Shows which Claude model you're using
  • ๐Ÿ’ต Real-Time Cost Tracking - Live cost monitoring via ccusage integration
  • โŒ› Session Management - Time remaining until usage limit resets with progress bars
  • ๐Ÿ“Š Advanced Analytics - Optional token consumption and burn rate metrics
  • ๐ŸŽจ Beautiful Colors - TTY-aware colors that respect your terminal theme
  • โšก Lightning Fast - Optimized bash script with <100ms execution time

๐ŸŽ›๏ธ Features Overview

๐Ÿ”ฅ Default Features (Pre-selected)

Feature Description Example
๐Ÿ“ Directory Current working directory ~/my-project
๐ŸŒฟ Git Branch Active git branch main
๐Ÿค– Model Claude model name & version Opus 4.1
๐Ÿ’ต Usage & Cost Real-time costs with hourly rate $2.48 ($12.50/h)
โŒ› Session Time Time until reset with progress 2h 15m until reset (68%)

๐Ÿš€ Optional Power Features

Feature Description Example
๐Ÿ“Š Token Stats Total tokens consumed 45,230 tok
โšก Burn Rate Tokens per minute 847 tpm

๐ŸŽจ Example Outputs

Minimal Setup:

๐Ÿ“ ~/my-app  ๐ŸŒฟ main  ๐Ÿค– Claude Sonnet

Full Power Mode:

๐Ÿ“ ~/projects/ai-tools  ๐ŸŒฟ feature/statusline  ๐Ÿค– Opus 4.1  โŒ› 2h 15m until reset (68%) [======----]  ๐Ÿ’ต $16.40 ($7.41/h)  ๐Ÿ“Š 64,080 tok (850 tpm)

๐Ÿ› ๏ธ Advanced Usage

Preview Your Statusline

Test your statusline before restarting Claude Code:

cc-statusline preview .claude/statusline.sh

What preview does:

  1. ๐Ÿ“„ Loads your actual statusline script
  2. ๐Ÿงช Runs it with realistic mock data
  3. ๐Ÿ“Š Shows exactly what the output will look like
  4. โšก Reports performance metrics and functionality

Custom Installation

# Generate to custom location
cc-statusline init --output ./my-statusline.sh

# Skip auto-installation (manual setup)
cc-statusline init --no-install

# Global installation for convenience
npm install -g @chongdashu/cc-statusline

๐Ÿ”ง How It Works

The Magic Behind The Scenes

  1. ๐ŸŽฏ Smart Configuration - Two intuitive questions configure everything
  2. ๐Ÿ—๏ธ Intelligent Generation - Creates optimized bash script tailored to your needs
  3. โš™๏ธ Auto-Installation - Seamlessly integrates with Claude Code settings
  4. ๐Ÿ”„ Real-Time Updates - Connects to ccusage for live usage statistics

Technical Architecture

  • โšก Bash-First - Native shell execution for maximum speed
  • ๐ŸŽจ TTY-Aware - Automatically detects terminal capabilities
  • ๐ŸŒ Environment Respect - Honors NO_COLOR and other conventions
  • ๐Ÿ“ฆ Zero Dependencies - Self-contained script with graceful fallbacks
  • ๐Ÿ”’ Secure - No network requests except ccusage integration

๐Ÿ“‹ Requirements

โœ… Required (You Already Have These!)

  • Claude Code - The tool you're already using
  • jq - JSON processing (pre-installed on most systems)

๐ŸŽ Optional Enhancements

  • git - For branch display (you probably have this)
  • ccusage - For usage stats (works via npx - no install needed)

Quick Compatibility Check

command -v jq && echo "โœ… Ready to go!"

๐Ÿ“‚ File Structure

After installation, you'll have a clean setup:

.claude/
โ”œโ”€โ”€ statusline.sh    # ๐ŸŽฏ Your generated statusline script
โ””โ”€โ”€ settings.json    # โš™๏ธ Auto-updated Claude Code configuration

Manual Configuration (Backup Plan)

If auto-configuration fails, simply add this to .claude/settings.json:

{
  "statusLine": {
    "type": "command",
    "command": ".claude/statusline.sh",
    "padding": 0
  }
}

๐Ÿ”ง Troubleshooting

๐Ÿšซ Statusline Not Showing

  1. Restart Claude Code after installation
  2. Verify settings - Check .claude/settings.json contains the configuration above
  3. Check permissions - Ensure script is executable: chmod +x .claude/statusline.sh

๐ŸŒ Performance Issues

  • Test performance: cc-statusline preview .claude/statusline.sh
  • Optimize features: Disable heavy features if execution > 500ms
  • Disable ccusage: Remove usage tracking if not needed

๐Ÿงฉ Missing Features

  • Install jq: brew install jq (macOS) or apt install jq (Ubuntu)
  • ccusage setup: Works automatically via npx ccusage@latest
  • Git not found: Install git for branch display

๐Ÿš€ Performance

Metric Target Typical
Execution Time <100ms 45-80ms
Memory Usage <5MB ~2MB
CPU Impact Negligible <1%
Dependencies Minimal jq only

Benchmarked on macOS with all features enabled

๐Ÿค Contributing

We love contributions! ๐ŸŽ‰

Quick Start:

git clone https://github.com/chongdashu/cc-statusline
cd cc-statusline
npm install && npm run build

Contribution Areas:

  • ๐Ÿ› Bug Fixes - Help make it more robust
  • โœจ New Features - Add support for more runtimes/features
  • ๐Ÿ“š Documentation - Improve guides and examples
  • ๐Ÿงช Testing - Add test coverage and edge cases

See our Contributing Guide for detailed information.

๐Ÿ“Š Stats

GitHub stars GitHub forks npm downloads

  • ccusage - Claude Code usage analytics (would not be possible with it!)
  • Claude Code - Official documentation

๐Ÿ“ Changelog

See CHANGELOG.md for detailed release history.

๐Ÿ“„ License

MIT License - see LICENSE file for details.


Made by Chong-U @ AIOriented