bb-cc-lite 0.1.0 → 0.1.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 (66) hide show
  1. package/README.md +45 -6
  2. package/assets/statusline-demo.gif +0 -0
  3. package/dist/baseline-builder.d.ts +13 -0
  4. package/dist/baseline-builder.js +666 -0
  5. package/dist/baseline-builder.js.map +1 -0
  6. package/dist/baseline.d.ts +113 -0
  7. package/dist/baseline.js +383 -0
  8. package/dist/baseline.js.map +1 -0
  9. package/dist/cli.js +41 -50
  10. package/dist/cli.js.map +1 -1
  11. package/dist/decision-presentation.d.ts +11 -0
  12. package/dist/decision-presentation.js +12 -0
  13. package/dist/decision-presentation.js.map +1 -0
  14. package/dist/doctor.d.ts +17 -0
  15. package/dist/doctor.js +161 -8
  16. package/dist/doctor.js.map +1 -1
  17. package/dist/event-store-persistence.d.ts +5 -0
  18. package/dist/event-store-persistence.js +172 -0
  19. package/dist/event-store-persistence.js.map +1 -0
  20. package/dist/event-store-queries.d.ts +9 -0
  21. package/dist/event-store-queries.js +51 -0
  22. package/dist/event-store-queries.js.map +1 -0
  23. package/dist/hook-payload.d.ts +3 -0
  24. package/dist/hook-payload.js +90 -0
  25. package/dist/hook-payload.js.map +1 -0
  26. package/dist/hook-summary.d.ts +12 -0
  27. package/dist/hook-summary.js +25 -0
  28. package/dist/hook-summary.js.map +1 -0
  29. package/dist/hooks.d.ts +2 -14
  30. package/dist/hooks.js +2 -126
  31. package/dist/hooks.js.map +1 -1
  32. package/dist/paths.d.ts +1 -0
  33. package/dist/paths.js +3 -0
  34. package/dist/paths.js.map +1 -1
  35. package/dist/renderer.d.ts +2 -2
  36. package/dist/renderer.js +15 -7
  37. package/dist/renderer.js.map +1 -1
  38. package/dist/session.d.ts +3 -0
  39. package/dist/session.js +9 -0
  40. package/dist/session.js.map +1 -0
  41. package/dist/settings.d.ts +2 -1
  42. package/dist/settings.js +23 -42
  43. package/dist/settings.js.map +1 -1
  44. package/dist/signals.d.ts +2 -1
  45. package/dist/signals.js +156 -6
  46. package/dist/signals.js.map +1 -1
  47. package/dist/statusline.d.ts +1 -0
  48. package/dist/statusline.js +34 -0
  49. package/dist/statusline.js.map +1 -0
  50. package/dist/store.d.ts +3 -10
  51. package/dist/store.js +3 -84
  52. package/dist/store.js.map +1 -1
  53. package/dist/tool-metadata.d.ts +8 -0
  54. package/dist/tool-metadata.js +52 -0
  55. package/dist/tool-metadata.js.map +1 -0
  56. package/dist/transcript-reader.d.ts +9 -0
  57. package/dist/transcript-reader.js +45 -0
  58. package/dist/transcript-reader.js.map +1 -0
  59. package/dist/transcript.d.ts +2 -3
  60. package/dist/transcript.js +54 -66
  61. package/dist/transcript.js.map +1 -1
  62. package/dist/types.d.ts +56 -0
  63. package/dist/why.d.ts +7 -0
  64. package/dist/why.js +32 -0
  65. package/dist/why.js.map +1 -0
  66. package/package.json +7 -7
package/README.md CHANGED
@@ -16,6 +16,12 @@ npx bb-cc-lite install --scope local
16
16
 
17
17
  Restart Claude Code in the project. The line appears at the bottom.
18
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
+
19
25
  For faster tool-loop detection:
20
26
 
21
27
  ```bash
@@ -28,8 +34,12 @@ Hooks are optional. They run in the background and skip `UserPromptSubmit`.
28
34
 
29
35
  ```text
30
36
  bb: Healthy | ctx 42% | $0.18 | cache warm | continue normally
31
- bb: Careful | ctx 82% | cache writes high | ask Claude for a 6-bullet handoff before more work
32
- bb: Stop | Bash failed 3x running tests | fix the test setup manually, then ask Claude to rerun only that test
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
41
+ bb: Careful | ctx 82% | Context is getting tight | ask Claude for a 6-bullet handoff before more work
42
+ bb: Stop | why: test loop: usually unrecovered after 3x | do: inspect first failure
33
43
  ```
34
44
 
35
45
  `Healthy` means keep going. `Careful` means slow down. `Stop` means take over before Claude burns more turns.
@@ -43,20 +53,49 @@ bb-cc-lite why
43
53
  ```text
44
54
  Last decision: Stop.
45
55
  Reason: Bash failed 3x running tests. Claude is retrying a broken test loop.
46
- Next action: fix the test setup manually, then ask Claude to rerun only that test.
56
+ Next action: inspect first failure.
57
+ ```
58
+
59
+ By default, `why` explains the latest recorded decision. To inspect a specific Claude Code session, pass its session id:
60
+
61
+ ```bash
62
+ bb-cc-lite why --session <session-id>
63
+ ```
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
47
78
  ```
48
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
+
49
82
  ## Privacy
50
83
 
51
- 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.
52
89
 
53
- 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.
54
91
 
55
92
  ## Undo
56
93
 
57
94
  ```bash
58
95
  bb-cc-lite doctor
96
+ bb-cc-lite doctor --clear-baseline
97
+ bb-cc-lite unlearn
59
98
  bb-cc-lite uninstall --scope local
60
99
  ```
61
100
 
62
- 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
+ }>;