burner-cc 0.3.0 → 0.3.1

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 (2) hide show
  1. package/README.md +59 -49
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -2,84 +2,94 @@
2
2
 
3
3
  # burner
4
4
 
5
- What your Claude Code sessions cost, and what they were for. Itemized receipts, projects that span several directories, and intent tagging that doesn't guess from tool counts.
5
+ What your Claude Code sessions cost, and what they were for — itemized receipts, projects, intent tagging, and a local analytics app.
6
6
 
7
- Zero dependencies. Reads `~/.claude/projects/` — nothing leaves your machine except the public price list fetch.
7
+ Zero runtime dependencies. Reads `~/.claude/projects/` on your machine. Only network use by default is refreshing public model prices (optional).
8
+
9
+ ## Install
8
10
 
9
11
  ```bash
10
- npx burner-cc # or: node bin/burner.js
12
+ npm install -g burner-cc
13
+ # commands: burner (alias entry: burner-cc)
11
14
  ```
12
15
 
13
- Opens a local app at `http://127.0.0.1:4777` — the report, per-session receipts, and **Settings** (projects, categories, pricing, tagging).
14
-
15
- ## Commands
16
+ Or without installing:
16
17
 
17
18
  ```bash
18
- burner # web app: report + settings
19
- burner report # static ~/.burner/report.html (+ receipts)
20
- burner list # terminal table
21
- burner receipt [id|title] # one receipt (default: latest)
19
+ npx burner-cc
20
+ ```
21
+
22
+ **Node 18+** required.
22
23
 
23
- burner install # install /burner-tag globally, apply tagging level
24
- burner tag <category> [--task] [--reason TEXT] [--session ID]
25
- burner pricing refresh # fetch fresh prices now
26
- burner model train [--swe-chat] [--data FILE.jsonl]
24
+ ## Quick start
27
25
 
28
- --project NAME --from YYYY-MM-DD --to YYYY-MM-DD --json --offline
26
+ ```bash
27
+ burner # opens http://127.0.0.1:4777 (report + Settings)
28
+ burner serve # same; --port N, --no-open
29
+ burner install # global /burner-tag skill + tagging level from ~/.burner/config.yaml
29
30
  ```
30
31
 
31
- ## Categories
32
+ Settings covers **projects**, **categories**, **pricing** (pin/refresh per model), and **tagging** (slider, session-end model, train your intent model).
32
33
 
33
- Intent, not mechanics — reading code to fix a bug is a bug fix:
34
+ ## Commands
34
35
 
35
- `coding` · `debugging` · `planning` · `research` · `writing` · `analysis` · `review` · `learning` · `other`
36
+ ```bash
37
+ burner list [--json] [--project NAME] [--from YYYY-MM-DD] [--to YYYY-MM-DD]
38
+ burner receipt [session-id|title] # one receipt HTML under ~/.burner/
39
+ burner report [--no-open] # static report.html + receipt-*.html
36
40
 
37
- Edit them on Settings → Categories. A session's category comes from, in order:
41
+ burner tag <category> [--session ID] [--reason TEXT] [--task]
42
+ burner tag --clear [--session ID]
43
+ burner install | uninstall | status
38
44
 
39
- 1. **A tag** — from `/burner-tag`, or the receipt's category picker
40
- 2. **Its project's default category** (or the project's only allowed category)
41
- 3. **The learned model**, once trained on your tags and only when confident
42
- 4. Otherwise **untagged**. There are no folder-name or tool-ratio rules.
45
+ burner pricing refresh
46
+ burner model train [--data FILE.jsonl] [--swe-chat] [--prior]
47
+ ```
43
48
 
44
- ## Projects
49
+ `burner tag` is what `/burner-tag` runs. After `npm i -g burner-cc`, hooks and the skill use the `burner` command on your PATH.
45
50
 
46
- A project groups one or more directories; any session started under one of them belongs to it (longest match wins). Each project can restrict which categories apply and set a default. Configure on Settings → Projects — it's stored in `~/.burner/config.yaml`, which you never have to open.
51
+ ## Categories
47
52
 
48
- ## Tagging levels
53
+ Intent, not tool counts — e.g. reading files to fix a bug is **debugging**, not research.
49
54
 
50
- Like Claude Code's effort slider (Settings → Tagging):
55
+ Default ids: `coding` · `debugging` · `planning` · `research` · `writing` · `analysis` · `review` · `learning` · `other` (editable in Settings).
51
56
 
52
- | Level | What happens |
53
- |---|---|
54
- | Off | No skill, nothing injected |
55
- | Manual | `/burner-tag` is available in every project |
56
- | Session end | A block in `~/.claude/CLAUDE.md` asks Claude to tag once when the work is done (~100 output tokens) |
57
- | Every task | Claude tags each finished task, so one session can split across categories by cost |
57
+ Resolution order:
58
58
 
59
- ### Learned model
59
+ 1. Tag (`/burner-tag`, receipt picker, session-end model, or CLI)
60
+ 2. Project default category
61
+ 3. **Your trained model** (optional; only if enabled and confidence ≥ 60%)
62
+ 4. Otherwise **untagged** — no folder-name or tool-ratio guessing
60
63
 
61
- `burner model train` fits a small naive-Bayes classifier on prompt words + tool steps from sessions *you* tagged. `--swe-chat` adds intent-labeled prompts from real Claude Code sessions from [SALT-NLP/SWE-chat](https://huggingface.co/datasets/SALT-NLP/SWE-chat) (gated: accept its terms and set `HF_TOKEN`). `--data` takes any `{"text", "category"}` JSONL.
64
+ ## Tagging levels (Settings)
62
65
 
63
- ## Tokens
66
+ | Level | Behavior |
67
+ |--------|----------|
68
+ | Off | Removes global skill / hooks |
69
+ | Manual | `/burner-tag` only; skill stays installed |
70
+ | Session end | SessionEnd hook + optional Anthropic model id, or CLAUDE.md asks Claude to tag via `/burner-tag` |
71
+ | Every task | CLAUDE.md asks Claude to tag each task (`--task`) |
64
72
 
65
- Claude Code writes one API response as several lines (one per streamed block) with growing `output_tokens`. Burner keeps the final line per request ID, drops requests a continued session re-logs from its parent, and bills subagent transcripts to their parent session. Totals include all four billed buckets: fresh input, cache write (5m/1h), cache read, output. On real sessions this lands within a few percent of Claude Code's own `/cost`; the gap is background calls (titles, compaction) Claude Code doesn't write to the transcript.
73
+ Moving the slider (or saving session-end model) updates `~/.claude` automatically. Use **Train from my tags** in Settings for a local naive-Bayes model (`~/.burner/model/intent-nb.json`). Training is pure Node — no GPU or Python. CLI `burner model train` does the same; `--prior` / `--swe-chat` are optional extras.
66
74
 
67
- ## Pricing
75
+ ## Tokens & pricing
68
76
 
69
- - **Claude models** — public list prices from [LiteLLM's price table](https://github.com/BerriAI/litellm), refreshed daily (bundled snapshot when offline). Bedrock/Vertex/dated ids are normalized.
70
- - **Everything else** (gateway, on-prem, local models behind the Claude Code harness) — **$0 until you set a price**. Settings → Pricing shows each model, offers the public price when one exists, and saves overrides to `~/.burner/pricing.yaml`.
77
+ - One API request → several transcript lines; burner bills the **last** chunk per `requestId`, dedupes continued sessions, rolls subagents into the parent.
78
+ - Totals: fresh input, cache write (5m/1h), cache read, output.
79
+ - **Claude** models: public LiteLLM price list (daily refresh, offline snapshot fallback).
80
+ - **Other** models (gateway, on-prem, local): **$0** until you set a price in Settings.
71
81
 
72
82
  ## Files
73
83
 
74
- | Path | |
75
- |---|---|
76
- | `~/.burner/config.yaml` | projects, categories, tagging level, theme |
77
- | `~/.burner/pricing.yaml` | your price overrides (USD / 1M tokens) |
84
+ | Path | Purpose |
85
+ |------|---------|
86
+ | `~/.burner/config.yaml` | projects, categories, tagging, UI theme/range |
87
+ | `~/.burner/pricing.yaml` | your USD/1M overrides |
78
88
  | `~/.burner/tags.json` | session tags |
79
- | `~/.burner/model/intent-nb.json` | learned model |
80
- | `~/.burner/cache/litellm-pricing.json` | price cache |
81
- | `~/.claude/skills/burner-tag/` | the global skill (`burner install`) |
89
+ | `~/.burner/assignments.json` | per-session project overrides |
90
+ | `~/.burner/model/intent-nb.json` | your trained intent model |
91
+ | `~/.claude/skills/burner-tag/` | global skill (`burner install`) |
82
92
 
83
- Old `~/.ti-burner` overrides and custom prices are imported on first run. `BURNER_HOME` and `CLAUDE_CONFIG_DIR` relocate both sides.
93
+ `BURNER_HOME` and `CLAUDE_CONFIG_DIR` override `~/.burner` and `~/.claude`. Legacy `~/.ti-burner` data is migrated on first run.
84
94
 
85
- *not official billing*
95
+ *Not official Anthropic billing.*
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "burner-cc",
3
- "version": "0.3.0",
3
+ "version": "0.3.1",
4
4
  "description": "What your Claude Code sessions cost, and what they were for — itemized receipts, projects, intent tagging.",
5
5
  "type": "module",
6
6
  "bin": {