claude-blip 1.0.0 → 1.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +51 -50
- package/package.json +1 -1
- package/statusline.js +6 -3
package/README.md
CHANGED
|
@@ -1,26 +1,22 @@
|
|
|
1
|
+
<div align="center">
|
|
2
|
+
|
|
1
3
|
# claude-blip
|
|
2
4
|
|
|
3
|
-
A single-file statusline for Claude Code
|
|
5
|
+
**A single-file statusline for Claude Code.**
|
|
6
|
+
*Zero dependencies. One command. Just a blip.*
|
|
4
7
|
|
|
5
|
-
|
|
8
|
+
[](https://www.npmjs.com/package/claude-blip)
|
|
9
|
+
[](https://packagephobia.com/result?p=claude-blip)
|
|
10
|
+
[](LICENSE)
|
|
6
11
|
|
|
7
|
-
|
|
8
|
-
Fixing auth bug │ myapp │ main │ opus │ ━━━━━━──── 120K
|
|
9
|
-
```
|
|
12
|
+

|
|
10
13
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
```
|
|
14
|
-
task │ project │ branch │ model │ context
|
|
15
|
-
```
|
|
14
|
+
*dim when chill, yellow when warm, red when you should probably wrap up*
|
|
16
15
|
|
|
17
|
-
|
|
18
|
-
- **Project** — directory name
|
|
19
|
-
- **Branch** — current git branch
|
|
20
|
-
- **Model** — opus, sonnet, haiku
|
|
21
|
-
- **Context** — usage bar that goes from dim → yellow → red as you fill up
|
|
16
|
+
</div>
|
|
22
17
|
|
|
23
|
-
|
|
18
|
+
Five segments. No config files. No themes. No plugins.
|
|
19
|
+
It just shows you what matters and gets out of the way.
|
|
24
20
|
|
|
25
21
|
## Install
|
|
26
22
|
|
|
@@ -28,60 +24,65 @@ Segments drop off the left when your terminal is narrow. Context bar always stay
|
|
|
28
24
|
npx claude-blip
|
|
29
25
|
```
|
|
30
26
|
|
|
31
|
-
That's it. Restart Claude Code.
|
|
27
|
+
That's it. Restart Claude Code. Done.
|
|
32
28
|
|
|
33
|
-
|
|
29
|
+
## What you get
|
|
34
30
|
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
31
|
+
| Segment | What it shows | Style |
|
|
32
|
+
|---------|--------------|-------|
|
|
33
|
+
| **Task** | What Claude is working on right now | **bold** |
|
|
34
|
+
| **Project** | Directory name | dim |
|
|
35
|
+
| **Branch** | Current git branch | dim |
|
|
36
|
+
| **Model** | opus, sonnet, haiku | dim |
|
|
37
|
+
| **Context** | Usage bar + token count | green → yellow → red |
|
|
38
|
+
|
|
39
|
+
Everything is dim except the task — your eyes go to the thing that matters.
|
|
40
|
+
|
|
41
|
+
Terminal too narrow? Segments drop off the left. Context bar always stays.
|
|
40
42
|
|
|
41
|
-
|
|
43
|
+
## Scopes
|
|
42
44
|
|
|
43
45
|
```sh
|
|
44
|
-
npx claude-blip
|
|
46
|
+
npx claude-blip # global (recommended)
|
|
47
|
+
npx claude-blip --project # .claude/settings.json (shareable with team)
|
|
48
|
+
npx claude-blip --local # .claude/settings.local.json (just you)
|
|
49
|
+
npx claude-blip --uninstall # clean removal from all scopes
|
|
45
50
|
```
|
|
46
51
|
|
|
47
|
-
##
|
|
52
|
+
## How it works
|
|
48
53
|
|
|
49
|
-
|
|
54
|
+
One file. ~150 lines. Node.js only (ships with Claude Code — nothing to install).
|
|
50
55
|
|
|
51
|
-
|
|
52
|
-
Fixing auth bug │ myapp │ main │ opus │ ━━──────── 40K
|
|
53
|
-
```
|
|
56
|
+
Claude Code pipes session JSON to your statusline script via stdin. This script reads it, picks out the useful bits, formats them, writes one line to stdout. That's the whole thing.
|
|
54
57
|
|
|
55
|
-
|
|
58
|
+
The context bar scales to 80% capacity — that's roughly where Claude starts compressing context, so 100% on the bar means "you're about to lose history."
|
|
56
59
|
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
```
|
|
60
|
+
<details>
|
|
61
|
+
<summary><strong>Debug mode</strong></summary>
|
|
60
62
|
|
|
61
|
-
|
|
63
|
+
Set `debug: true` in the CONFIG object at top of `statusline.js` to dump the full JSON payload to stderr:
|
|
62
64
|
|
|
63
|
-
```
|
|
64
|
-
|
|
65
|
+
```js
|
|
66
|
+
const CONFIG = {
|
|
67
|
+
debug: true, // logs to stderr
|
|
68
|
+
// ...
|
|
69
|
+
};
|
|
65
70
|
```
|
|
66
71
|
|
|
67
|
-
|
|
72
|
+
</details>
|
|
68
73
|
|
|
69
|
-
|
|
70
|
-
scripts │ sonnet │ ━━━━────── 80K
|
|
71
|
-
```
|
|
72
|
-
|
|
73
|
-
## How it works
|
|
74
|
+
## Contributing
|
|
74
75
|
|
|
75
|
-
|
|
76
|
+
Found a bug? Want a feature? PRs welcome. Keep it simple — the whole point is one file with zero dependencies.
|
|
76
77
|
|
|
77
|
-
|
|
78
|
+
## License
|
|
78
79
|
|
|
79
|
-
|
|
80
|
+
MIT — do whatever you want with it.
|
|
80
81
|
|
|
81
|
-
|
|
82
|
+
---
|
|
82
83
|
|
|
83
|
-
|
|
84
|
+
<div align="center">
|
|
84
85
|
|
|
85
|
-
|
|
86
|
+
*Built for developers with mass context window anxiety.*
|
|
86
87
|
|
|
87
|
-
|
|
88
|
+
</div>
|
package/package.json
CHANGED
package/statusline.js
CHANGED
|
@@ -25,6 +25,7 @@ const ANSI = {
|
|
|
25
25
|
dim: "\x1b[2m",
|
|
26
26
|
bold: "\x1b[1m",
|
|
27
27
|
reset: "\x1b[0m",
|
|
28
|
+
green: "\x1b[38;5;108m",
|
|
28
29
|
yellow: "\x1b[38;5;222m",
|
|
29
30
|
red: "\x1b[38;5;167m",
|
|
30
31
|
};
|
|
@@ -100,7 +101,7 @@ function getContextDisplay(ctxWindow) {
|
|
|
100
101
|
const tokenStr = formatTokens(Math.round(maxTokens * (rawUsed / 100)));
|
|
101
102
|
|
|
102
103
|
if (ratio < CONFIG.warnThreshold) {
|
|
103
|
-
return
|
|
104
|
+
return color(`${bar} ${tokenStr}`, ANSI.green);
|
|
104
105
|
} else if (ratio < CONFIG.criticalThreshold) {
|
|
105
106
|
return color(`${bar} ${tokenStr}`, ANSI.yellow);
|
|
106
107
|
} else {
|
|
@@ -149,7 +150,9 @@ function buildStatusline(input) {
|
|
|
149
150
|
// 4. Model
|
|
150
151
|
const model = data.model?.display_name;
|
|
151
152
|
if (model) {
|
|
152
|
-
|
|
153
|
+
// Extract tier name: "Opus 4.6" → "opus", "Sonnet 4.5" → "sonnet"
|
|
154
|
+
const tier = model.split(/\s/)[0].toLowerCase();
|
|
155
|
+
parts.push(dim(tier));
|
|
153
156
|
}
|
|
154
157
|
|
|
155
158
|
// 5. Context window (bar + token count)
|
|
@@ -159,7 +162,7 @@ function buildStatusline(input) {
|
|
|
159
162
|
}
|
|
160
163
|
|
|
161
164
|
// Truncate if wider than terminal — drops segments from the left (task first)
|
|
162
|
-
const sep = dim(" \
|
|
165
|
+
const sep = dim(" \u00B7 ");
|
|
163
166
|
const cols = process.stdout.columns || 80;
|
|
164
167
|
while (parts.length > 1 && stripAnsi(parts.join(sep)).length > cols) {
|
|
165
168
|
parts.shift();
|