A professional, feature-rich status line script for Claude Code that provides real-time information about your development environment with automatic update notifications, intelligent logging, and beautiful visual indicators.
- π€ Model Display - Shows current AI model with color coding
- π¦ Version Tracking - Displays Claude Code version with automatic update checks
- π Update Notifications - Hourly checks for new versions with visual indicators
- π Smart Path Display - Color-coded directory indicators (green for root, red for subdirectories)
- π¨ Beautiful Colors - Full ANSI color support with NO_COLOR environment variable respect
- π Three-Level Logging - Error, Info, and Debug levels with automatic log rotation
- π Debug Mode - Visual debug indicator with comprehensive logging
- π Security First - Safe JSON parsing, atomic file operations, no command injection
- π Cross-Platform - Works on Linux, macOS, and BSD systems
- β‘ High Performance - Optimized with pure bash operations, minimal subprocesses
π€ Opus 4.1 * 1.0.72 π Project root
π€ Sonnet 4 * 1.0.72 π 1.0.75 π src/components
π DEBUG π€ Haiku * 1.0.72 π level1/level2
- Bash 4.0+ - Required for advanced features
- npm (optional) - For automatic version checking
- Claude Code - The script is designed specifically for Claude Code
- β Linux - Fully supported
- β macOS - Fully supported
- β Windows (WSL2) - Works in Windows Subsystem for Linux 2
- β Windows (Native) - NOT supported (requires bash environment)
β οΈ EARLY TEST VERSION - USE AT YOUR OWN RISK
Run this single command to automatically install Claude StatusLine:
curl -sSL https://raw.githubusercontent.com/dkmaker/ClaudeCode-Statusline/main/assets/install.sh | bashThe installer will:
- β Check all prerequisites (Bash 4.0+, Claude Code, npm)
- β Download and install the statusline script
- β Make it executable automatically
- β Update your Claude Code settings
- β Fail safely if statusline already exists
- Copy the script to your Claude directory:
# Create the .claude directory if it doesn't exist
mkdir -p ~/.claude
# Download the statusline script
curl -o ~/.claude/ccstatusline.sh https://raw.githubusercontent.com/dkmaker/ClaudeCode-Statusline/main/ccstatusline.sh
# Make it executable
chmod +x ~/.claude/ccstatusline.sh- Configure Claude Code:
Edit your ~/.claude/settings.json file:
{
"statusLine": {
"type": "command",
"command": "~/.claude/ccstatusline.sh"
}
}Or with debug mode enabled:
{
"statusLine": {
"type": "command",
"command": "~/.claude/ccstatusline.sh --loglevel debug"
}
}- Restart Claude Code to see your new status line!
Simply run /statusline in Claude Code and follow the interactive setup.
The script runs automatically when configured in Claude Code settings. No manual intervention needed!
The script runs automatically via Claude Code. To test manually:
```bash
# Test with mock JSON input
echo '{"model":{"display_name":"Test"},"workspace":{"current_dir":"/test","project_dir":"/test"},"version":"1.0.0"}' | ~/.claude/ccstatusline.sh
# Test with debug logging
echo '{"model":{"display_name":"Test"},"workspace":{"current_dir":"/test","project_dir":"/test"},"version":"1.0.0"}' | ~/.claude/ccstatusline.sh --loglevel debug
### Log Levels
- **error** (default) - Only critical errors
- **info** - Operational information + errors
- **debug** - Everything including raw JSON input (useful for troubleshooting)
## π¨ Visual Indicators
| Indicator | Meaning | Color |
|-----------|---------|-------|
| π€ | AI Model | Cyan |
| * | Version Separator | Orange background, white text |
| π | Project Root | Green |
| π | Subdirectory | Red |
| π | Update Available | Default |
| π DEBUG | Debug Mode Active | Yellow |
### Version Colors
- **Green** - Current version when up-to-date
- **Orange** - Current version when update available
- **Green** (new version) - Available update version number
## βοΈ Configuration
### Environment Variables
- `NO_COLOR` - Set to disable all color output
- `HOME` - Used to locate the .claude directory
### Files Created
The script creates these files in `~/.claude/`:
- `latest_version_check` - Caches the latest version (updated hourly)
- `ccstatusline.log` - Log file (rotates at 1MB)
- `*.lock` - Temporary lockfiles for update checks
## π§ Advanced Features
### Automatic Update Checking
The script checks for Claude Code updates once per hour:
- Non-blocking background checks
- Lockfile mechanism prevents concurrent checks
- Visual indicator when updates are available
- Shows both current and available versions
### Smart Path Display
- **Project Root**: Shows "Project root" in green with π
- **Subdirectories**: Shows relative path in red with π
- Falls back gracefully if path calculation fails
### Robust Error Handling
- Always outputs valid status line text
- Never exits with error codes (Claude Code compatibility)
- Graceful degradation when features unavailable
- Comprehensive logging for troubleshooting
## π Troubleshooting
### Status line shows "Claude Code"
This is the fallback when the script encounters an error. Check:
1. Script is executable: `chmod +x ~/.claude/ccstatusline.sh`
2. Bash version is 4.0+: `bash --version`
3. Enable debug logging to see details: `--loglevel debug`
### No update notifications
- Ensure npm is installed: `which npm`
- Check the version cache: `cat ~/.claude/latest_version_check`
- Look for errors in logs: `tail ~/.claude/ccstatusline.log`
### Colors not showing
- Check NO_COLOR environment variable: `echo $NO_COLOR`
- Verify terminal supports colors: `echo -e "\033[96mTest\033[0m"`
### View logs
```bash
# View recent log entries
tail -f ~/.claude/ccstatusline.log
# Check log file size
ls -lh ~/.claude/ccstatusline.log
This script implements multiple security measures:
- Safe JSON Parsing - Pure bash regex, no eval or command substitution
- Command Injection Prevention - No user input executed as commands
- Atomic File Operations - Prevents race conditions
- Process Isolation - Background tasks properly managed
- Input Validation - All inputs sanitized and validated
Contributions are welcome! Please feel free to submit issues and pull requests.
- Test changes locally:
echo '{"model":{"display_name":"Test"},"workspace":{"current_dir":"/test","project_dir":"/test"},"version":"1.0.0"}' | ./ccstatusline.sh --loglevel debug- Check for bash compatibility:
shellcheck ./ccstatusline.sh- Verify cross-platform compatibility on macOS and Linux
MIT License - See LICENSE file for details
- Claude Code team for the excellent development environment
- Created by DKMaker with great help from Claude Code
- Community contributors and testers
- 1.0.1 - Fixed version comparison to properly handle newer local versions
- 1.0.0 - Initial release
Made with β€οΈ for the Claude Code community