Real-time session tracking and analytics for Claude Code, displaying usage metrics in a compact statusline format.
- π Real-time Monitoring - Track active sessions with live updates
- π° Cost Tracking - Accurate cost calculation based on official pricing
- π Analytics - Detailed reports on usage patterns and trends
- π€ Multi-Model Support - Track Opus, Sonnet, and Haiku models
- π¨ 20+ Display Templates - Choose from various statusline formats
- β‘ Lightweight - Minimal dependencies (only psutil)
- π¦ Easy Installation - Available as a Python package
- π― Unified CLI - Single command interface for all features
# Install the package
pip install claude-statusline
# View current status
claude-status
# Use the CLI
claude-statusline --help
# Clone repository
git clone https://github.com/ersinkoc/claude-statusline.git
cd claude-statusline
# Install in development mode
pip install -e .
# Or build and install the package
python -m build
pip install dist/claude_statusline-*.whl
Example Outputs:
[Opus 4.1] LIVE ~17:00 | 727msg 65.9M $139 # Compact (default)
O4.1 456m $90 # Minimal
claude@O4.1:~$ 456 msgs | $89.99 # Terminal
--INSERT-- O4.1 456L $90.0 [utf-8] # Vim style
π See all 20+ templates - Choose your favorite style!
- Python 3.8+
- Claude Code installed
- Access to
~/.claude
directory
# Install from PyPI (when published)
pip install claude-statusline
# Install from local wheel
pip install dist/claude_statusline-1.3.0-py3-none-any.whl
# Development installation
git clone https://github.com/ersinkoc/claude-statusline.git
cd claude-statusline
pip install -e .
Add to your Claude Code settings.json
:
{
"statusline": {
"command": "claude-status"
}
}
Or if using from source:
{
"statusline": {
"command": "python",
"args": ["path/to/claude-statusline/statusline.py"]
}
}
# Main CLI
claude-statusline <command> [options]
# Direct statusline display
claude-status
# Core functionality
claude-statusline status # Current session status
claude-statusline daemon # Manage background daemon
claude-statusline rebuild # Rebuild database
# Analytics
claude-statusline costs # Cost analysis
claude-statusline daily # Daily report
claude-statusline sessions # Session details
claude-statusline heatmap # Activity heatmap
claude-statusline summary # Summary statistics
# Configuration
claude-statusline template # Select display template
claude-statusline update-prices # Update model prices
claude-statusline rotate # Toggle statusline rotation
π Full CLI Documentation - Complete command reference with all options and examples
- Data Collection: Reads Claude Code's JSONL conversation logs
- Processing: Background daemon processes and aggregates data
- Storage: Maintains a local database of sessions and metrics
- Display: Formats data into a compact, readable statusline
Claude Code β JSONL Files β Daemon β Database β Statusline
{
"display": {
"template": "compact", // Choose from 20+ templates
"enable_rotation": false,
"status_format": "compact"
},
"monitoring": {
"session_duration_hours": 5
}
}
# Interactive template selector with preview
claude-statusline template
# Quick template change
claude-statusline template minimal
claude-statusline template vim
π Template Gallery - Preview all available statusline formats
Model prices are automatically updated from the official repository:
claude-statusline update-prices
claude-statusline/
βββ claude_statusline/ # Package directory
β βββ __init__.py # Package initialization
β βββ cli.py # Main CLI interface
β βββ statusline.py # Core statusline display
β βββ daemon.py # Background processor
β βββ templates.py # Template definitions
β βββ config.json # Configuration
β βββ prices.json # Model pricing
βββ tests/ # Test suite
βββ docs/ # Documentation
βββ setup.py # Package setup
βββ pyproject.toml # Modern package config
βββ README.md # This file
- Source:
~/.claude/projects/*/
- Claude Code JSONL files - Database:
~/.claude/data-statusline/
- Processed datasmart_sessions_db.json
- Session databaselive_session.json
- Current sessiondaemon_status.json
- Daemon status
# Clone repository
git clone https://github.com/ersinkoc/claude-statusline.git
cd claude-statusline
# Install in development mode
pip install -e .
# Install development dependencies
pip install -e ".[dev]"
# Run test suite
pytest
# Run with coverage
pytest --cov=claude_statusline
# Run specific test
pytest tests/test_statusline.py
# Install build tools
pip install build twine
# Build package
python -m build
# Check package
twine check dist/*
# Upload to PyPI (when ready)
twine upload dist/*
# Check Claude Code data exists
ls ~/.claude/projects/
# Rebuild database
claude-statusline rebuild
# Ensure daemon is running
claude-statusline daemon --status
# Update prices
claude-statusline update-prices
# Verify calculations
claude-statusline verify
# Reinstall package
pip uninstall claude-statusline
pip install dist/claude_statusline-*.whl
# Check installation
pip show claude-statusline
- Run
claude-statusline --help
for command help - See CLI.md for detailed documentation
- Check CLAUDE_CODE_SETUP.md for Claude Code integration
- Report issues on GitHub
- CLI Reference - Complete command documentation
- Template Gallery - All 20+ statusline formats
- Architecture - System design and data flow
- Claude Code Setup - Integration guide
- Contributing - Contribution guidelines
- Changelog - Version history
- Security - Security policy
Contributions are welcome! Please read CONTRIBUTING.md for guidelines.
MIT License - see LICENSE file for details.
- Claude Code team for the excellent development environment
- Contributors and testers from the community
- Built with β€οΈ for the Claude Code community
- Issues: GitHub Issues
- Discussions: GitHub Discussions
- Documentation: Full CLI Reference
Current Version: 1.3.3 | Last Updated: 2025-08-14 | Package: claude-statusline