bb-cc-lite 0.1.1 → 0.1.3

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 CHANGED
@@ -8,8 +8,6 @@ Claude Code does not always fail loudly. Sometimes it loops, fills context, spen
8
8
 
9
9
  ![bb-cc-lite statusline examples](./assets/statusline-demo.gif)
10
10
 
11
- The demo above is generated from real `bb-cc-lite statusline` output.
12
-
13
11
  ## Install
14
12
 
15
13
  ```bash
@@ -18,6 +16,12 @@ npx bb-cc-lite install --scope local
18
16
 
19
17
  Restart Claude Code in the project. The line appears at the bottom.
20
18
 
19
+ Install replaces any existing Claude Code `statusLine` by default and stores a backup so `uninstall` can restore it. It also builds a local personal baseline by default after it installs the statusline. It reads bounded local Claude Code JSONL once, newest eligible files first, extracts aggregate patterns from past sessions, and stores a small `baseline.json` under the `bb-cc-lite` app home. Use `--no-learn` to install the statusline without scanning old JSONL:
20
+
21
+ ```bash
22
+ npx bb-cc-lite install --scope local --no-learn
23
+ ```
24
+
21
25
  For faster tool-loop detection:
22
26
 
23
27
  ```bash
@@ -30,8 +34,12 @@ Hooks are optional. They run in the background and skip `UserPromptSubmit`.
30
34
 
31
35
  ```text
32
36
  bb: Healthy | ctx 42% | $0.18 | cache warm | continue normally
37
+ bb: Healthy | research phase: usually normal for you | continue
38
+ bb: Careful | edits not checked yet | run focused check
39
+ bb: Careful | tests failed twice; usually recovers after one fix | inspect first failure
40
+ bb: Careful | edit lag unusual for you | run focused check
33
41
  bb: Careful | ctx 82% | Context is getting tight | ask Claude for a 6-bullet handoff before more work
34
- bb: Stop | why: Bash failed 3x running tests | do: fix the test setup manually, then ask Claude to rerun only that test
42
+ bb: Stop | why: test loop: usually unrecovered after 3x | do: inspect first failure
35
43
  ```
36
44
 
37
45
  `Healthy` means keep going. `Careful` means slow down. `Stop` means take over before Claude burns more turns.
@@ -45,7 +53,7 @@ bb-cc-lite why
45
53
  ```text
46
54
  Last decision: Stop.
47
55
  Reason: Bash failed 3x running tests. Claude is retrying a broken test loop.
48
- Next action: fix the test setup manually, then ask Claude to rerun only that test.
56
+ Next action: inspect first failure.
49
57
  ```
50
58
 
51
59
  By default, `why` explains the latest recorded decision. To inspect a specific Claude Code session, pass its session id:
@@ -54,17 +62,40 @@ By default, `why` explains the latest recorded decision. To inspect a specific C
54
62
  bb-cc-lite why --session <session-id>
55
63
  ```
56
64
 
65
+ `why` may mention when the personal baseline influenced wording or priority, including safe recovery and edit-lag explanations recorded by the statusline. It reads only the derived local event store; it does not reopen old transcripts to expose raw content.
66
+
67
+ ## Personal Baseline
68
+
69
+ `bb-cc-lite` learns weak Healthy-like, Careful-like, and Stop-like outcome patterns from your own past Claude Code sessions. It scans newest JSONL candidates first, applies the file and byte caps before summarizing, and reads transcript tails with bounded parallelism. Those weak labels can affect footer wording, priority, and confidence, but hard global `Stop` rules still win.
70
+
71
+ Refresh, inspect, or clear the baseline:
72
+
73
+ ```bash
74
+ bb-cc-lite doctor --build-baseline
75
+ bb-cc-lite doctor --baseline
76
+ bb-cc-lite doctor --clear-baseline
77
+ bb-cc-lite unlearn
78
+ ```
79
+
80
+ `doctor --baseline` prints a safe aggregate summary, including recent window, validation category, and safe tool category names when present. `doctor --clear-baseline` and `unlearn` remove only `baseline.json`.
81
+
57
82
  ## Privacy
58
83
 
59
- By default, `bb-cc-lite` does not upload transcripts, store raw prompts, store raw tool output, store file contents, or print raw prompt/tool text.
84
+ By default, `bb-cc-lite` does not upload transcripts, store raw prompts, store raw tool output, store raw shell commands, store file contents, store raw paths, or print raw prompt/tool text.
85
+
86
+ For learning, it reads bounded local Claude Code JSONL history and stores only derived aggregate data: counts, rates, scenario counts, weak outcome-label counts, confidence buckets, recovery rates, validation categories, edit-to-validation lag buckets, safe tool category names, scan timestamps, and privacy flags. It uses file mtimes and raw shell commands only transiently for sorting and categorization. It never stores prompts, assistant text, commands, command arguments, tool output, file contents, transcript paths, scanned-file lists, per-file mtimes, workspace paths, raw session ids, API keys, or per-session transcript rows.
87
+
88
+ For live rendering, statusline reads Claude Code status JSON from stdin, tails only the current transcript defensively, and may read the small `baseline.json`. It stores derived metadata only: counts, reason codes, token totals, costs, and hashed session ids.
60
89
 
61
- It reads Claude Code status JSON from stdin, tails the local transcript defensively, and stores derived metadata only: counts, reason codes, token totals, costs, and hashed session ids.
90
+ LiteLLM is used only as public pricing data for cost estimates. `bb-cc-lite` does not run a LiteLLM proxy, gateway, or message router.
62
91
 
63
92
  ## Undo
64
93
 
65
94
  ```bash
66
95
  bb-cc-lite doctor
96
+ bb-cc-lite doctor --clear-baseline
97
+ bb-cc-lite unlearn
67
98
  bb-cc-lite uninstall --scope local
68
99
  ```
69
100
 
70
- Install preserves an existing Claude Code `statusLine` unless you pass `--replace`.
101
+ Install backs up the previous Claude Code `statusLine` before replacing it.
Binary file
@@ -0,0 +1,13 @@
1
+ import { type PersonalBaseline } from "./baseline.js";
2
+ export interface BuildBaselineOptions {
3
+ homeDir?: string;
4
+ appHomePath?: string;
5
+ claudeProjectsDir?: string;
6
+ maxFiles?: number;
7
+ maxBytesPerTranscript?: number;
8
+ now?: Date;
9
+ }
10
+ export declare function buildBaseline(options?: BuildBaselineOptions): Promise<{
11
+ baseline: PersonalBaseline;
12
+ written: boolean;
13
+ }>;