A beautiful, informative statusline for Claude Code

Real-time directory, git branch, model info, costs, and session time tracking
One command. Three questions. Custom statusline.
npx @chongdashu/cc-statusline@latest init
That's it! Answer a few simple questions, restart Claude Code, and enjoy your new statusline.
Without jq, your statusline will have LIMITED functionality: - ❌ No context remaining percentage - ❌ No token statistics from ccusage
- ❌ No session timer - ⚠️ Basic fallback parser is used (less reliable)
brew install jq
# Ubuntu/Debian
sudo apt-get install jq
# CentOS/RHEL/Fedora
sudo yum install jq
# Arch Linux
sudo pacman -S jq
Option 1: Package Manager (Recommended)
# Chocolatey
choco install jq
# Scoop
scoop install jq
# Winget
winget install jqlang.jq
Option 2: Manual Download
1. Go to https://github.com/jqlang/jq/releases/latest
2. Download:
- 64-bit: jq-windows-amd64.exe
- 32-bit: jq-windows-i386.exe
3. Rename to jq.exe
4. Place in C:\Windows\System32\ (requires admin) or add to PATH
5. Test: jq --version
jq --version
# Should output: jq-1.6 or higher
npx - no install needed)
Enhance your Claude Code terminal with useful information:
~ abbreviation~/.claude/) - Use across all your projects./.claude/) - Keep settings project-specific| Feature | Description | Example |
|---|---|---|
| 📁 Directory | Current working directory | ~/my-project |
| 🌿 Git Branch | Active git branch | feature/statusline |
| 🤖 Model | Claude model name & version | Sonnet 4 |
| 📟 Claude Code | Claude Code version | v1.0.85 |
| 🎨 Output Style | Current output style setting | default |
| 🧠 Context | Remaining context with progress bar | 83% [========--] |
| 💰 Cost | Live costs with highlighted burn rate | $49.00 ($16.55/h) |
| ⌛ Session | Time until reset with progress | 3h 7m until reset at 01:00 (37%) [===-------] |
| Feature | Description | Example |
|---|---|---|
| 📊 Tokens | Token consumption with burn rate | 14638846 tok (279900 tpm) |
New 3-Line Modern Layout (v1.2.2+):
📁 ~/Projects/cc-statusline 🌿 feature/context-usage-output-styles 🤖 Sonnet 4 📟 v1.0.85 🎨 default
🧠 Context Remaining: 83% [========--] ⌛ 3h 7m until reset at 01:00 (37%) [===-------]
💰 $49.00 ($16.55/h) 📊 14638846 tok (279900 tpm)
Compact Mode:
📁 ~/my-app 🌿 main 🤖 Claude Sonnet 📟 v1.0.85
🧠 Context Remaining: 95% [=========-]
💰 $2.48 ($12.50/h)
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
# 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
NO_COLOR and other terminal conventionsAfter installation, you'll have a clean setup:
.claude/
├── statusline.sh # 🎯 Your generated statusline script
└── settings.json # ⚙️ Auto-updated Claude Code configuration
If auto-configuration fails, simply add this to .claude/settings.json:
{
"statusLine": {
"type": "command",
"command": ".claude/statusline.sh",
"padding": 0
}
}
.claude/settings.json contains the configuration abovechmod +x .claude/statusline.shcc-statusline preview .claude/statusline.shnpx ccusage@latest| 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
Contributions are welcome!
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.
The ccusage integration includes a robust file-based locking mechanism to prevent concurrent process spawning. Test this functionality:
Single Test:
echo '{}' | ./test/test-statusline-with-lock.sh
Concurrent Test:
./test/test-concurrent-locking.sh
Manual Concurrent Test:
# Spawn 10 concurrent processes
for i in {1..10}; do
echo '{}' | ./test/test-statusline-with-lock.sh &
done
Expected Behavior: - ✅ Only 1 process runs ccusage at a time - ✅ Other processes skip gracefully (no pile-up) - ✅ Lock files are properly cleaned up - ✅ No hanging processes remain
Verification Commands:
# Check for stale locks
ls /tmp/ccusage_statusline.* 2>/dev/null || echo "✅ No locks remain"
# Monitor running processes
ps aux | grep ccusage | grep -v grep
We're grateful for all contributions that make cc-statusline better!
Want to see your name here? Check out our Contributing Guide and help make cc-statusline even better!
We welcome:
- 🐛 Bug fixes and performance improvements
- ✨ New features and enhancements
- 📚 Documentation improvements
- 🧪 Test coverage and quality assurance
See CHANGELOG.md for detailed release history.
MIT License - see LICENSE file for details.
Made by Chong-U @ AIOriented
$ claude mcp add cc-statusline \
-- python -m otcore.mcp_server <graph>