cc-cream 0.1.13 → 0.1.15

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/CHANGELOG.md CHANGED
@@ -4,6 +4,16 @@ All notable changes to cc-cream are documented here. Format follows
4
4
  [Keep a Changelog](https://keepachangelog.com/en/1.1.0/); versions follow
5
5
  [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
6
6
 
7
+ ## [0.1.15] — 2026-05-29
8
+
9
+ ### Fixed
10
+ - **An orphaned status line no longer crashes on every render after `/plugin uninstall`.** If you ran `/plugin uninstall cc-cream` without first running `/cc-cream:uninstall`, the `statusLine` entry stayed in `settings.json` while the plugin cache was deleted. The cache-glob then matched nothing, the baked command collapsed to a bare relative `src/cc-cream.js`, and Claude Code hit `MODULE_NOT_FOUND` (exit 1) on every render — and `/cc-cream:uninstall` was gone, so the only fix was hand-editing `settings.json`. The auto-update command now captures the resolved version dir in `$d` and short-circuits with `[ -z "$d" ] && exit 0`, so an orphaned status line is inert (silent, exit 0) instead of a recurring error. "Degrade, never crash." New installs/auto-wires get the guarded command; existing users pick it up on their next `/cc-cream:setup`.
11
+
12
+ ## [0.1.14] — 2026-05-29
13
+
14
+ ### Changed
15
+ - **The status bar now turns itself on — no manual `/cc-cream:setup` for fresh installs** (CREAM-nywsljfq). Claude Code can't let a plugin contribute the main status line natively (only `agent`/`subagentStatusLine` are plugin-settable — verified by probe), so the bar still needs a write to `settings.json`. Instead of making you run `/cc-cream:setup`, the `SessionStart` hook (`hooks/auto-setup.js`, renamed from `setup-reminder.js`) now **auto-wires** cc-cream's `statusLine` on the first session after install — but **only when no status line is configured**. It never clobbers a status line you set for something else (that still routes through the interactive `/cc-cream:setup`), and a one-shot marker means it never re-adds the bar after you remove it with `/cc-cream:uninstall`. The nudge to run `/cc-cream:setup` now appears only in the foreign-status-line case. Output stays a single `systemMessage` (zero model tokens). You may need to restart/trust the workspace for the bar to appear.
16
+
7
17
  ## [0.1.13] — 2026-05-29
8
18
 
9
19
  ### Fixed
@@ -119,6 +129,7 @@ line and prints a colored ≤3-row bar — zero tokens, the model never sees it.
119
129
  - Supports **macOS and Linux**; Windows is a planned fast-follow.
120
130
  - Requires Claude Code **2.1.132+** (`effort` / `thinking` need 2.1.145+).
121
131
 
132
+ [0.1.15]: https://github.com/bart-turczynski/cc-cream/compare/v0.1.14...v0.1.15
122
133
  [0.1.6]: https://github.com/bart-turczynski/cc-cream/compare/v0.1.5...v0.1.6
123
134
  [0.1.5]: https://github.com/bart-turczynski/cc-cream/compare/v0.1.4...v0.1.5
124
135
  [0.1.4]: https://github.com/bart-turczynski/cc-cream/compare/v0.1.3...v0.1.4
package/README.md CHANGED
@@ -66,16 +66,21 @@ To use the self-hosted marketplace directly:
66
66
  /plugin install cc-cream
67
67
  ```
68
68
 
69
- Then wire it into your settings in one step:
69
+ That's usually all you need: on the first session after install, cc-cream
70
+ **auto-wires** its `statusLine` into `~/.claude/settings.json` (you may need to
71
+ restart or trust the workspace for the bar to appear). It only does this when no
72
+ status line is configured — it never overwrites one you set for something else,
73
+ and it never re-adds the bar after you remove it.
74
+
75
+ If you already have a status line and want to replace it with cc-cream's, run:
70
76
  ```
71
77
  /cc-cream:setup
72
78
  ```
73
79
 
74
80
  The `/cc-cream:setup` command runs the consent installer, which writes the
75
- `statusLine` block to `~/.claude/settings.json`. Until you run it, cc-cream
76
- prints a one-line reminder at the start of each session (it stops once the bar
77
- is wired). Updates are automatic: when `/plugin update` drops a new version into
78
- the cache, the next render picks it up without any further action.
81
+ `statusLine` block to `~/.claude/settings.json`. Updates are automatic: when
82
+ `/plugin update` drops a new version into the cache, the next render picks it up
83
+ without any further action.
79
84
 
80
85
  ### Option 2 — npm
81
86
 
@@ -113,13 +118,24 @@ and you may need to **restart** it for the bar to appear.
113
118
 
114
119
  ### Uninstall
115
120
 
116
- Plugin users — two steps (Claude Code can't clean `settings.json` when a plugin
117
- is removed, so the wiring is cleared separately from the cache):
121
+ Plugin users — two steps, **in this order** (Claude Code can't clean
122
+ `settings.json` when a plugin is removed, so the wiring is cleared separately
123
+ from the cache):
118
124
  ```
119
- /cc-cream:uninstall # removes the statusLine wiring
120
- /plugin uninstall cc-cream # drops the plugin from the cache
125
+ /cc-cream:uninstall # 1. removes the statusLine wiring (run this FIRST)
126
+ /plugin uninstall cc-cream # 2. drops the plugin from the cache
121
127
  ```
122
128
 
129
+ > **Order matters.** `/cc-cream:uninstall` lives inside the plugin, so once you
130
+ > run `/plugin uninstall` it's gone. The status line itself degrades to nothing
131
+ > if the cache is missing (it won't error), but the now-inert `statusLine` block
132
+ > lingers in `settings.json`. To clear it after the plugin is already gone, run
133
+ > the npm bin (no global install needed):
134
+ > ```bash
135
+ > npx -y -p cc-cream cc-cream-setup --uninstall
136
+ > ```
137
+ > or remove the `statusLine` key from `~/.claude/settings.json` by hand.
138
+
123
139
  npm / manual users:
124
140
  ```bash
125
141
  cc-cream-setup --uninstall # npm (add --purge to also remove runtime + config)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cc-cream",
3
- "version": "0.1.13",
3
+ "version": "0.1.15",
4
4
  "description": "Claude Code cache/context/cost status-line tool",
5
5
  "directories": {
6
6
  "doc": "docs"
package/src/install.js CHANGED
@@ -28,8 +28,16 @@ const TRUST_NOTE =
28
28
  // it, a non-numeric cache dir (a git-sha install like `c83650b6360f/`) sorts
29
29
  // last and pins the bar to whatever version that happens to be, defeating
30
30
  // auto-update. With it, `/plugin update` is applied live with no re-run of setup.
31
+ //
32
+ // The resolved dir is captured in `$d` and GUARDED with `[ -z "$d" ] && exit 0`:
33
+ // when the glob matches nothing — the state left behind if a user runs
34
+ // `/plugin uninstall cc-cream` WITHOUT first running `/cc-cream:uninstall`, so a
35
+ // stale statusLine outlives the deleted cache — the command degrades to a silent
36
+ // exit 0 instead of running a bare relative `src/cc-cream.js` that crashes with
37
+ // MODULE_NOT_FOUND on every render. "Degrade, never crash" (CLAUDE.md). `exec`
38
+ // replaces the shell so stdin/stdout pass straight through to the renderer.
31
39
  export function autoUpdateCommand(nodePath) {
32
- return `${nodePath} "$(ls -1d "\${CLAUDE_CONFIG_DIR:-$HOME/.claude}"/plugins/cache/*/cc-cream/*/ 2>/dev/null | grep -E '/[0-9]+(\\.[0-9]+)+/$' | sort -V | tail -1)src/cc-cream.js"`;
40
+ return `d="$(ls -1d "\${CLAUDE_CONFIG_DIR:-$HOME/.claude}"/plugins/cache/*/cc-cream/*/ 2>/dev/null | grep -E '/[0-9]+(\\.[0-9]+)+/$' | sort -V | tail -1)"; [ -z "$d" ] && exit 0; exec ${nodePath} "\${d}src/cc-cream.js"`;
33
41
  }
34
42
 
35
43
  // `desired` is considered already installed if it matches the planned command
@@ -49,7 +57,7 @@ function isInstalled(existing, command) {
49
57
  // (dev repo, copied home runtime, or the plugin cache-glob) — every command
50
58
  // references the cc-cream entrypoint. Used by uninstall so we never touch a
51
59
  // statusLine the user wired for something else.
52
- function isCcCreamStatusLine(existing) {
60
+ export function isCcCreamStatusLine(existing) {
53
61
  return (
54
62
  !!existing &&
55
63
  typeof existing === 'object' &&
@@ -187,7 +195,7 @@ function copyRuntimeFiles(sourceFile, destDir) {
187
195
  // PATH, so a bare `node` is unsafe. We prefer the shell's `command -v node`
188
196
  // (the path the user's interactive shell would pick), falling back to
189
197
  // process.execPath (the node currently running setup) if that fails.
190
- function resolveNodePath() {
198
+ export function resolveNodePath() {
191
199
  try {
192
200
  const found = execSync('command -v node', { encoding: 'utf8' }).trim();
193
201
  if (found) return found;