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.
Files changed (3) hide show
  1. package/README.md +51 -50
  2. package/package.json +1 -1
  3. 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
- Zero dependencies. Just a blip.
8
+ [![npm](https://img.shields.io/npm/v/claude-blip)](https://www.npmjs.com/package/claude-blip)
9
+ [![install size](https://packagephobia.com/badge?p=claude-blip)](https://packagephobia.com/result?p=claude-blip)
10
+ [![license](https://img.shields.io/npm/l/claude-blip)](LICENSE)
6
11
 
7
- ```
8
- Fixing auth bug │ myapp │ main │ opus │ ━━━━━━──── 120K
9
- ```
12
+ ![variants](variants.gif)
10
13
 
11
- ## What you get
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
- - **Task** — what Claude is doing right now (bold, from todo list)
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
- Segments drop off the left when your terminal is narrow. Context bar always stays.
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
- ### Scopes
29
+ ## What you get
34
30
 
35
- ```sh
36
- npx claude-blip # global (recommended)
37
- npx claude-blip --project # .claude/settings.json (shareable)
38
- npx claude-blip --local # .claude/settings.local.json (gitignored)
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
- ### Uninstall
43
+ ## Scopes
42
44
 
43
45
  ```sh
44
- npx claude-blip --uninstall
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
- ## Examples
52
+ ## How it works
48
53
 
49
- Normal usage everything is dim except the task:
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
- Getting warm (yellow at 70%):
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
- myapp │ main │ opus │ ━━━━━━━─── 140K
59
- ```
60
+ <details>
61
+ <summary><strong>Debug mode</strong></summary>
60
62
 
61
- Running hot (red at 90%):
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
- myapp main │ opus │ ━━━━━━━━━─ 180K
65
+ ```js
66
+ const CONFIG = {
67
+ debug: true, // logs to stderr
68
+ // ...
69
+ };
65
70
  ```
66
71
 
67
- No task, no git — it adapts:
72
+ </details>
68
73
 
69
- ```
70
- scripts │ sonnet │ ━━━━────── 80K
71
- ```
72
-
73
- ## How it works
74
+ ## Contributing
74
75
 
75
- One file. 150 lines. Node.js only (ships with Claude Code).
76
+ Found a bug? Want a feature? PRs welcome. Keep it simple — the whole point is one file with zero dependencies.
76
77
 
77
- Claude Code pipes session JSON to your statusline script via stdin. This script reads it, picks out the useful bits, formats them, and writes one line to stdout.
78
+ ## License
78
79
 
79
- The context bar scales to 80% that's roughly where Claude starts compressing context, so 100% on the bar means "you're about to lose history."
80
+ MITdo whatever you want with it.
80
81
 
81
- ## Debug
82
+ ---
82
83
 
83
- Set `debug: true` in the CONFIG object at the top of `statusline.js` to dump the full JSON payload to stderr.
84
+ <div align="center">
84
85
 
85
- ## License
86
+ *Built for developers with mass context window anxiety.*
86
87
 
87
- MIT
88
+ </div>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "claude-blip",
3
- "version": "1.0.0",
3
+ "version": "1.0.2",
4
4
  "description": "A single-file statusline for Claude Code. Zero dependencies. Just a blip.",
5
5
  "license": "MIT",
6
6
  "author": "davebream",
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 dim(`${bar} ${tokenStr}`);
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
- parts.push(dim(model.toLowerCase()));
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(" \u2502 ");
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();