ctxline-claude 1.7.2 → 1.7.5

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 +10 -47
  2. package/package.json +1 -1
  3. package/statusline.js +1 -1
package/README.md CHANGED
@@ -1,5 +1,5 @@
1
1
  <p align="center">
2
- <img src="docs/assets/apple-touch-icon.png" width="64" height="64" alt="">
2
+ <img src="https://raw.githubusercontent.com/MithunWijayasiri/ctxline-claude/main/docs/assets/apple-touch-icon.png" width="64" height="64" alt="">
3
3
  </p>
4
4
 
5
5
  <h1 align="center">Claude Code Statusline</h1>
@@ -9,18 +9,7 @@
9
9
  </p>
10
10
 
11
11
  <p align="center">
12
- <a href="https://github.com/MithunWijayasiri/ctxline-claude/stargazers"><picture><source media="(prefers-color-scheme: dark)" srcset="https://www.shieldcn.dev/github/stars/MithunWijayasiri/ctxline-claude.svg?variant=secondary&amp;size=sm&amp;mode=dark"><img alt="GitHub Stars" src="https://www.shieldcn.dev/github/stars/MithunWijayasiri/ctxline-claude.svg?variant=secondary&amp;size=sm&amp;mode=light"></picture></a>
13
- <a href="https://github.com/MithunWijayasiri/ctxline-claude/graphs/contributors"><picture><source media="(prefers-color-scheme: dark)" srcset="https://www.shieldcn.dev/github/contributors/MithunWijayasiri/ctxline-claude.svg?variant=secondary&amp;size=sm&amp;mode=dark"><img alt="Contributors" src="https://www.shieldcn.dev/github/contributors/MithunWijayasiri/ctxline-claude.svg?variant=secondary&amp;size=sm&amp;mode=light"></picture></a>
14
- <a href="https://github.com/MithunWijayasiri/ctxline-claude/commits/main"><picture><source media="(prefers-color-scheme: dark)" srcset="https://www.shieldcn.dev/github/last-commit/MithunWijayasiri/ctxline-claude.svg?variant=secondary&amp;size=sm&amp;mode=dark"><img alt="Last commit" src="https://www.shieldcn.dev/github/last-commit/MithunWijayasiri/ctxline-claude.svg?variant=secondary&amp;size=sm&amp;mode=light"></picture></a>
15
- <a href="https://ko-fi.com/mithunwijayasiri"><picture><source media="(prefers-color-scheme: dark)" srcset="https://www.shieldcn.dev/badge/Ko--fi-support-FF5E5B.svg?logo=kofi&amp;variant=secondary&amp;size=sm&amp;mode=dark"><img alt="Ko-fi" src="https://www.shieldcn.dev/badge/Ko--fi-support-FF5E5B.svg?logo=kofi&amp;variant=secondary&amp;size=sm&amp;mode=light"></picture></a>
16
- <br>
17
- <a href="https://www.npmjs.com/package/ctxline-claude"><picture><source media="(prefers-color-scheme: dark)" srcset="https://www.shieldcn.dev/npm/ctxline-claude.svg?variant=secondary&amp;size=xs&amp;mode=dark"><img alt="npm Version" src="https://www.shieldcn.dev/npm/ctxline-claude.svg?variant=secondary&amp;size=xs&amp;mode=light"></picture></a>
18
- <a href="https://www.npmjs.com/package/ctxline-claude"><picture><source media="(prefers-color-scheme: dark)" srcset="https://www.shieldcn.dev/npm/dm/ctxline-claude.svg?variant=secondary&amp;size=xs&amp;mode=dark"><img alt="npm Monthly Downloads" src="https://www.shieldcn.dev/npm/dm/ctxline-claude.svg?variant=secondary&amp;size=xs&amp;mode=light"></picture></a>
19
- <a href="https://www.npmjs.com/package/ctxline-claude"><picture><source media="(prefers-color-scheme: dark)" srcset="https://www.shieldcn.dev/npm/dt/ctxline-claude.svg?variant=secondary&amp;size=xs&amp;mode=dark"><img alt="npm Total Downloads" src="https://www.shieldcn.dev/npm/dt/ctxline-claude.svg?variant=secondary&amp;size=xs&amp;mode=light"></picture></a>
20
- </p>
21
-
22
- <p align="center">
23
- <img src="docs/assets/preview.svg" alt="Claude Code Statusline">
12
+ <img src="https://raw.githubusercontent.com/MithunWijayasiri/ctxline-claude/main/docs/assets/preview.svg" alt="Claude Code Statusline">
24
13
  </p>
25
14
 
26
15
  <p align="center">
@@ -29,15 +18,6 @@
29
18
 
30
19
  See your **current directory**, **active model**, **context window usage**, and **Claude usage limits** at a glance — including both your **current 5-hour session** and **weekly allowance**.
31
20
 
32
- ## Contents
33
-
34
- - [Install](#install)
35
- - [Uninstall](#uninstall)
36
- - [What it shows](#what-it-shows)
37
- - [Configuration](#configuration)
38
- - [How it works](#how-it-works)
39
- - [FAQ](#faq)
40
-
41
21
  ## Install
42
22
 
43
23
  ```bash
@@ -139,14 +119,11 @@ Remove-Item "$env:USERPROFILE\.claude\cache\usage-cache.json" -ErrorAction Silen
139
119
  | **Task** | The in-progress todo, when there is one |
140
120
  | **Update** | An extra row with the upgrade command when a newer release is on npm — checked once a week, in the background |
141
121
 
142
- > [!NOTE]
143
- > Usage bars change color automatically as you approach your limits.
122
+ > 📝 **Note** — Usage bars change color automatically as you approach your limits.
144
123
 
145
- > [!NOTE]
146
- > **Responsive.** On a narrow terminal the line wraps to two — directory, model, and context on the first line; usage, cost, and task on the second. Wide terminals stay on a single line. (Auto-sizing needs Claude Code v2.1.153+.)
124
+ > 📝 **Note — Responsive.** On a narrow terminal the line wraps to two — directory, model, and context on the first line; usage, cost, and task on the second. Wide terminals stay on a single line. (Auto-sizing needs Claude Code v2.1.153+.)
147
125
 
148
- > [!TIP]
149
- > Don't want every segment? You can hide any of them — see [Configuration](#configuration).
126
+ > 💡 **Tip** — Don't want every segment? You can hide any of them — see [Configuration](#configuration).
150
127
 
151
128
  ## Configuration
152
129
 
@@ -194,15 +171,6 @@ setx CTXLINE_DISABLE "cost,task"
194
171
 
195
172
  To re-enable a segment, remove it from the list (or delete the variable) and restart Claude Code.
196
173
 
197
- ## How it works
198
-
199
- - **Source** — context comes from Claude Code's session data. The 5-hour and weekly bars are read straight from the `rate_limits` field Claude Code pipes in (no network), falling back to `https://api.anthropic.com/api/oauth/usage` when that field isn't present yet. API-key users skip usage entirely.
200
- - **Model-scoped limits** — `rate_limits` carries only `five_hour` and `seven_day`, so a model-scoped weekly limit can only come from `/usage` (its `limits` array). It's served from the same cache as everything else, so this costs at most one call per 30s no matter how often the line renders.
201
- - **No network on the fast path** — when `rate_limits` is in the session data, there's no API call at all. The fetch below only runs as a fallback (e.g. the first render of a session, before the field appears).
202
- - **Adaptive timing** — for the fallback fetch: 1.5s timeout on the first prompt (cold start), 1.2s after (connection reused).
203
- - **Caching** — the fallback fetch is cached at `~/.claude/cache/usage-cache.json`, shared across sessions. Within 30s the cache renders directly (the API call is skipped); if a live call fails, the last value (up to 10 min old) is shown so the bar never vanishes. The reset countdown recomputes every render.
204
- - **Never breaks** — every failure path falls back silently; the statusline always prints.
205
-
206
174
  ## FAQ
207
175
 
208
176
  <details>
@@ -261,17 +229,12 @@ No. Your credentials never leave your machine. On the fast path no token is read
261
229
 
262
230
  </details>
263
231
 
232
+ ## Links
264
233
 
265
- ## Support
266
-
267
- If you find this project useful, consider supporting its development on [Ko-fi](https://ko-fi.com/mithunwijayasiri). Your donations help keep the project maintained, improve existing features, and fund new open-source tools.
268
-
269
- Thank you for your support! ❤️
270
-
271
- ## Credits
272
-
273
- Thanks to [@TahaSabir0](https://github.com/TahaSabir0) for the base config.
234
+ - [GitHub repository](https://github.com/MithunWijayasiri/ctxline-claude)
235
+ - [Claude desktop app plugin](https://github.com/MithunWijayasiri/ctxline-claude#claude-desktop)
236
+ - [Support on Ko-fi](https://ko-fi.com/mithunwijayasiri)
274
237
 
275
238
  ## License
276
239
 
277
- MIT
240
+ MIT
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ctxline-claude",
3
- "version": "1.7.2",
3
+ "version": "1.7.5",
4
4
  "description": "A customizable statusline for Claude Code that tracks context usage and session limits",
5
5
  "bin": {
6
6
  "ctxline-claude": "bin/install.js"
package/statusline.js CHANGED
@@ -9,7 +9,7 @@ const https = require('https');
9
9
  const { execSync, execFileSync, spawn } = require('child_process');
10
10
 
11
11
  // Lives here, not package.json: this file ships standalone to ~/.claude/hooks/. Must match package.json.
12
- const VERSION = '1.7.2';
12
+ const VERSION = '1.7.5';
13
13
 
14
14
  const IS_API_KEY = !!process.env.ANTHROPIC_API_KEY;
15
15