Performance Targets
From README.md:246-253, cc-statusline is designed for minimal performance impact:| 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
Performance Categories
Fromsrc/cli/preview.ts:88-92, statuslines are categorized by execution time:
🚀 Excellent
<100msIdeal performance. No noticeable delay.
✅ Good
100-500msAcceptable. Slight delay but usable.
⚠️ Slow
500-1000msNoticeable delay. Optimization recommended.
🐌 Timeout
>1000msPoor performance. Action required.
Measuring Performance
Use the preview command to benchmark your statusline:Performance Impact by Feature
Zero-Cost Features
These features have negligible performance impact (<5ms):📁 Working Directory
📁 Working Directory
Impact: ~1msWhy fast: Simple environment variable lookup and string replacement
🤖 Model Name
🤖 Model Name
Impact: ~2msWhy fast: Direct JSON field extractionWith jq:
🎨 Colors & Emojis
🎨 Colors & Emojis
Impact: <1msWhy fast: Simple string concatenationColors are ANSI escape codes - no computation needed.
Low-Cost Features
These features add minimal overhead (5-20ms):🌿 Git Branch
🌿 Git Branch
Impact: ~10msWhy reasonably fast: Single git command with caching
🧠 Context Remaining
🧠 Context Remaining
Impact: ~5ms with jq, ~15ms withoutWhy fast: Simple arithmetic on JSON fieldsFrom bash-generator.ts:164-198:
Medium-Cost Features
These features can add noticeable overhead (20-100ms):💵 Usage & Cost
💵 Usage & Cost
Impact: ~50-200msWhy slower: Requires spawning ccusage processOptimization: ccusage includes file-based locking to prevent concurrent execution:From README.md:278-305 (locking mechanism tests):
📊 Token Statistics
📊 Token Statistics
Impact: ~10-30msWhy slower: Requires parsing large usage data from ccusageDepends on ccusage call + additional jq parsing.
⚡ Burn Rate
⚡ Burn Rate
Impact: ~5-15msWhy slower: Additional calculations on usage dataRequires ccusage data + burn rate calculation.
⌛ Session Reset Time
⌛ Session Reset Time
Impact: ~20-40msWhy slower: Time zone calculations and formattingRequires ccusage + date/time arithmetic + progress bar rendering.
Optimization Strategies
Strategy 1: Minimal Configuration
For maximum speed, use only essential features:Strategy 2: Disable ccusage
ccusage is the slowest component. If you don’t need cost tracking:Strategy 3: Install jq
The bash fallback parser is slower than jq:⚠️ Basic fallback parser is used (less reliable)
Strategy 4: Disable Logging
Debug logging adds I/O overhead:- File I/O to .claude/statusline.log
- JSON formatting
- Multiple echo statements
Strategy 5: Use Compact Theme
Progress bars and formatting add rendering time:Technical Optimizations
Bash Script Optimization
The generated bash script is already optimized:Single Pass JSON Parsing
Single Pass JSON Parsing
All JSON fields are extracted in one pass to avoid multiple jq invocations.From bash-generator.ts:127-133:
Conditional Feature Execution
Conditional Feature Execution
Features are only executed if enabled during generation.From bash-generator.ts:9-14:
Graceful Fallbacks
Graceful Fallbacks
Missing dependencies don’t cause errors or retries.
Minimal Subshells
Minimal Subshells
Command substitution is minimized to reduce process spawning.
ccusage Locking Mechanism
From README.md:278-305, cc-statusline prevents performance issues from concurrent ccusage calls:- Prevents process pile-up
- No hanging processes
- Automatic lock cleanup
Benchmarking Different Configurations
Minimal Config
Standard Config
Full Config (No ccusage)
Maximum Config
Real-World Performance
From README.md:247-253, typical real-world measurements:| Configuration | Cold Start | Warm Cache |
|---|---|---|
| Minimal | 35ms | 25ms |
| Standard | 60ms | 45ms |
| Full + ccusage | 250ms | 80ms |
”Cold start” means first run after system boot. “Warm cache” means subsequent runs with OS caching.
Monitoring Performance
Enable Performance Logging
Add timing to your statusline:Analyze Performance Logs
Troubleshooting Slow Performance
Best Practices
Start Minimal, Add Gradually
Start Minimal, Add Gradually
Begin with basic features and add more as needed.This helps identify which features impact performance most for your setup.
Disable Features You Don't Use
Disable Features You Don't Use
If you don’t look at cost tracking, disable it.Every disabled feature improves performance.
Use jq for Best Performance
Use jq for Best Performance
Always install jq on your system.The bash fallback is 2-3x slower for JSON parsing.
Keep Logging Off in Production
Keep Logging Off in Production
Enable logging only for debugging.Disable it once your statusline is working correctly.
Monitor Performance Over Time
Monitor Performance Over Time
Run preview periodically to ensure performance hasn’t degraded.
Performance FAQ
Why is first run slow?
Why is first run slow?
Answer: OS disk caching, ccusage cache warming, and npm package loading.Subsequent runs are much faster due to caching.
Does statusline slow down Claude Code?
Does statusline slow down Claude Code?
Answer: No, statusline runs asynchronously and doesn’t block user input.Even a 500ms statusline won’t impact your ability to type or interact with Claude Code.
Can I make it update less frequently?
Can I make it update less frequently?
Answer: Statusline update frequency is controlled by Claude Code, not cc-statusline.Typically updates on each command completion.
Does colors/emojis slow it down?
Does colors/emojis slow it down?
Answer: No, ANSI escape codes have negligible performance impact (<1ms).Disabling colors won’t improve performance noticeably.
Next Steps
Configuration Guide
Learn about all available features
Troubleshooting
Fix common issues