Skip to content

Commit 736896e

Browse files
committed
chore(readme): completed readme overhaul
1 parent c3c21f6 commit 736896e

File tree

3 files changed

+109
-49
lines changed

3 files changed

+109
-49
lines changed

README.md

Lines changed: 65 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,46 @@
55

66
# mini-ccstatus
77

8-
A fast/minimal C implementation of the statusline for Claude Code CLI for Linux (tested on Debian/Ubuntu and Fedora).
8+
A fast/minimal C implementation of the statusline for Claude Code CLI for Linux (tested on Debian/Ubuntu and Fedora).
99

10-
## Quick Start
1110

12-
### Installation
11+
<img src="images/mini-ccstatus_main.png" width="100%" alt="mini-ccstatus">
12+
13+
## Features
14+
15+
See [`images/`](images/) for an animated demo.
16+
17+
### Lightning Fast ⚡
18+
- **< 5ms response time** - Instant status updates with zero lag
19+
- **~ 700x faster on average than other statuslines** - See [`benchmark/`](benchmark/) for more details
20+
- **Single-pass parsing** - Processes transcripts without loading entire files into memory
21+
- **Smart caching** - Session-aware cache with file-size change detection
22+
23+
### Rock Solid 🛡️
24+
- **Zero crashes** - Rust-inspired error rail pattern prevents silent failures
25+
- **Memory safe** - Overflow-checked arithmetic and bounds validation on all operations
26+
- **Concurrent safe** - Advisory file locking prevents corruption in multi-process scenarios
27+
- **No memory leaks** - RAII-like patterns ensure all resources are cleaned up
28+
29+
### Minimal Footprint 📦
30+
- **Single binary** - No runtime dependencies, just copy and run
31+
- **< 100KB executable** - Smaller than most shell scripts
32+
- **Fixed memory usage** - No unbounded allocations or memory bloat
33+
- **C11 standard** - Portable across all Linux distributions
34+
35+
### Smart Features 🧠
36+
- **Context awareness** - Tracks both session and context window token usage
37+
- **Visual progress bars** - Dual-color bars for input/output token/lines/API ratios
38+
- **Cache efficiency metrics** - Monitor internal and API cache hit rates and performance
39+
- **Compact visualization** - Progress bars appear only when real data is available
40+
41+
## Rationale
42+
43+
mini-ccstatus started while working on a project that runs multiple Claude Code instances in parallel for implementing unit, integration, and E2E tests across a complex, heavily algorithmic Go/TypeScript/Python codebase with ML/statistical components. These sessions stay alive for long stretches, so we want to monitor the internals with all the detail Anthropic currently exposes.
44+
45+
Other statusline implementations hammer the CPU, RAM, and batteries on our laptops, so - half as a joke - I wrote mini-ccstatus in C after benchmarking the alternatives; see [`benchmark/`](benchmark/) for the data.
46+
47+
## Installation
1348

1449
*Prerequisites*:
1550

@@ -29,12 +64,17 @@ cd mini-ccstatus
2964
make
3065
```
3166

32-
### Demo
67+
## Demo
3368

3469
```bash
3570
make demo-all
3671
```
3772

73+
## Dependencies
74+
75+
- [**cJSON**](https://github.com/DaveGamble/cJSON) - Lightweight JSON parser (MIT License, vendored in `lib/cjson/`)
76+
- **Standard C Library** - No other external dependencies
77+
3878
## Command Line Options
3979

4080
```bash
@@ -70,19 +110,37 @@ Examples:
70110

71111
## Display Modes
72112

113+
### Statusline and labels
114+
73115
mini-ccstatus supports several display modes:
74116

75117
- **Default**: Compact view
76118
- **Simple** (`--simple` / `-s`): Model, version, and directory only
77119
- **Verbose** (`--verbose` / `-v`): Compact with field labels
78120
- **All Features** (`--all` / `-a`): All metrics including token breakdown
79121

80-
## Token Tracking
122+
### Token Tracking
81123

82124
- **Total tokens** = inputTokens + outputTokens + cacheCreationTokens + cacheReadTokens
83125
- **Context tokens** = tokens from last assistant message (input + cache creation + cache read)
84126
- **Session tokens** = sum of all tokens across entire session
85127

128+
### Display Options
129+
130+
Individual display options can be combined to customize your statusline:
131+
132+
- **`-d, --token-breakdown`**: Shows detailed token breakdown by category (input, output, cache write, cache read) on a separate line
133+
- **`-c, --context-tokens`**: Displays current context window usage as a percentage of the 200K token limit with a progress bar
134+
- **`-t, --session-tokens`**: Shows cumulative token usage across the entire session as a percentage of the 200K limit
135+
- **`-e, --cache-efficiency`**: Displays the ratio of the `mini-ccstatus` cache read tokens to total cache tokens (higher = better cache reuse)
136+
- **`-p, --api-time-ratio`**: Shows percentage of session time spent waiting for API responses
137+
- **`-l, --lines-ratio`**: Displays proportion of lines added vs removed with a dual-color progress bar
138+
- **`-i, --input-output-ratio`**: Shows the proportion of input tokens vs output tokens with a dual-color progress bar
139+
- **`-w, --cache-write-read-ratio`**: Displays proportion of cache write tokens vs cache read tokens
140+
- **`-C, --clamping`**: Clamps percentage displays to 100% maximum (useful when usage exceeds context limits)
141+
- **`-v, --verbose`**: Adds descriptive field labels to all metrics for better readability
142+
- **`-H, --hide-breakdown`**: Suppresses the token breakdown line even when other token options are enabled
143+
86144
## Building & Testing
87145

88146
### Build Commands
@@ -115,32 +173,11 @@ See [`benchmark/`](benchmark/) for performance comparison against other Claude C
115173
- Anthropic's reference examples (Bash, Python, Node.js)
116174
- Community implementations
117175

118-
### Dependencies
119-
120-
- [**cJSON**](https://github.com/DaveGamble/cJSON) - Lightweight JSON parser (MIT License, vendored in `lib/cjson/`)
121-
- **Standard C Library** - No other external dependencies
122176

123177
### Configure Claude Code
124178

125179
Add to your `~/.claude/settings.json`:
126180

127-
```json
128-
{
129-
"statusLine": {
130-
"type": "command",
131-
"command": "/path/to/mini-ccstatus/bin/mini-ccstatus",
132-
"padding": 0
133-
}
134-
}
135-
```
136-
137-
## Screenshots
138-
139-
140-
### All
141-
142-
![mini-ccstatus all](images/mini-ccstatus_all.png)
143-
144181
```json
145182
{
146183
"statusLine": {
@@ -151,38 +188,18 @@ Add to your `~/.claude/settings.json`:
151188
}
152189
```
153190

154-
### Custom
155-
156-
![mini-ccstatus custom](images/mini-ccstatus_custom.png)
191+
While the above `command` will display everything, the one below is a more sensible one I am currently using:
157192

158193
```json
159194
{
160195
"statusLine": {
161196
"type": "command",
162-
"command": "/path/to/mini-ccstatus/bin/mini-ccstatus --simple --context-tokens --session-tokens --api-time-ratio --input-output-ratio",
197+
"command": "/path/to/mini-ccstatus/bin/mini-ccstatus --simple --context-tokens --session-tokens --api-time-ratio --lines-ratio --input-output-ratio",
163198
"padding": 0
164199
}
165200
}
166201
```
167202

168-
### Default
169-
170-
![mini-ccstatus default](images/mini-ccstatus_default.png)
171-
172-
```json
173-
{
174-
"statusLine": {
175-
"type": "command",
176-
"command": "/path/to/mini-ccstatus/bin/mini-ccstatus",
177-
"padding": 0
178-
}
179-
}
180-
```
181-
182-
### Demo
183-
184-
See [`images/`](images/) for an animated demo.
185-
186203
## Contributing
187204

188205
Contributions are welcome! Please follow the semantic versioning branch naming convention:

images/README.md

Lines changed: 44 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,48 @@
11

22
# mini-ccstatus Demo
33

4+
## Demo
45

5-
<img src="mini-ccstatus_demo.gif" width="80%" alt="mini-ccstatus demo">
6+
<img src="mini-ccstatus_demo.gif" width="80%" alt="mini-ccstatus demo">
7+
8+
## `--all`
9+
10+
![mini-ccstatus all](images/mini-ccstatus_all.png)
11+
12+
```json
13+
{
14+
"statusLine": {
15+
"type": "command",
16+
"command": "/path/to/mini-ccstatus/bin/mini-ccstatus --all",
17+
"padding": 0
18+
}
19+
}
20+
```
21+
22+
## Custom
23+
24+
![mini-ccstatus custom](images/mini-ccstatus_custom.png)
25+
26+
```json
27+
{
28+
"statusLine": {
29+
"type": "command",
30+
"command": "/path/to/mini-ccstatus/bin/mini-ccstatus --simple --context-tokens --session-tokens --api-time-ratio --input-output-ratio",
31+
"padding": 0
32+
}
33+
}
34+
```
35+
36+
## Minimal
37+
38+
![mini-ccstatus default](images/mini-ccstatus_default.png)
39+
40+
```json
41+
{
42+
"statusLine": {
43+
"type": "command",
44+
"command": "/path/to/mini-ccstatus/bin/mini-ccstatus",
45+
"padding": 0
46+
}
47+
}
48+
```

images/mini-ccstatus_main.png

45.2 KB
Loading

0 commit comments

Comments
 (0)