The statusline script is invoked by Claude Code roughly every 300ms. The current shell implementation spawns multiple subprocesses per invocation (git, grep, date, etc.), which adds up at that cadence.
cstat demonstrates that a Rust implementation can achieve ~33x faster execution (2ms vs 62ms) by eliminating subprocess spawns entirely and doing all parsing natively. At ~300ms invocation intervals, 62ms per call is significant overhead while 2ms is negligible.
Goals
- Zero subprocess spawns per invocation
- Native parsing of transcript JSON, git status, and token counts
- Maintain feature parity with the current shell implementation
- Single standalone binary with no runtime dependencies
The statusline script is invoked by Claude Code roughly every 300ms. The current shell implementation spawns multiple subprocesses per invocation (git, grep, date, etc.), which adds up at that cadence.
cstat demonstrates that a Rust implementation can achieve ~33x faster execution (2ms vs 62ms) by eliminating subprocess spawns entirely and doing all parsing natively. At ~300ms invocation intervals, 62ms per call is significant overhead while 2ms is negligible.
Goals