burnie 0.1.0__tar.gz

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.
@@ -0,0 +1,31 @@
1
+ name: CI
2
+
3
+ on:
4
+ push:
5
+ branches: [main]
6
+ pull_request:
7
+
8
+ permissions:
9
+ contents: read
10
+
11
+ jobs:
12
+ build:
13
+ runs-on: ubuntu-latest
14
+ steps:
15
+ - uses: actions/checkout@v4
16
+
17
+ - uses: actions/setup-python@v5
18
+ with:
19
+ python-version: "3.x"
20
+
21
+ - name: Install uv
22
+ run: pip install uv
23
+
24
+ - name: Build
25
+ run: uv build
26
+
27
+ - name: Test the built wheel
28
+ run: |
29
+ uv venv /tmp/testenv
30
+ uv pip install --python /tmp/testenv/bin/python dist/*.whl
31
+ /tmp/testenv/bin/burnie --help
@@ -0,0 +1,81 @@
1
+ name: Release
2
+
3
+ on:
4
+ push:
5
+ branches: [main]
6
+ release:
7
+ types: [published]
8
+
9
+ permissions:
10
+ contents: read
11
+
12
+ jobs:
13
+ draft:
14
+ if: github.event_name == 'push'
15
+ runs-on: ubuntu-latest
16
+ permissions:
17
+ contents: write
18
+ steps:
19
+ - uses: actions/checkout@v4
20
+
21
+ - name: Extract version from pyproject.toml
22
+ id: version
23
+ run: |
24
+ VERSION="$(python3 -c "import tomllib; print(tomllib.load(open('pyproject.toml','rb'))['project']['version'])")"
25
+ echo "version=$VERSION" >> "$GITHUB_OUTPUT"
26
+
27
+ - name: Remove old release drafts
28
+ env:
29
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
30
+ run: |
31
+ DRAFT_IDS=$(gh api repos/${{ github.repository }}/releases --jq '.[] | select(.draft == true) | .id')
32
+ if [ -n "$DRAFT_IDS" ]; then
33
+ echo "$DRAFT_IDS" | xargs -I '{}' gh api -X DELETE repos/${{ github.repository }}/releases/'{}'
34
+ fi
35
+
36
+ - name: Create release draft
37
+ env:
38
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
39
+ run: |
40
+ gh release create "v${{ steps.version.outputs.version }}" \
41
+ --draft --title "v${{ steps.version.outputs.version }}" --generate-notes
42
+
43
+ publish:
44
+ if: github.event_name == 'release'
45
+ runs-on: ubuntu-latest
46
+ environment:
47
+ name: pypi
48
+ url: https://pypi.org/project/burnie/
49
+ permissions:
50
+ id-token: write # required for PyPI Trusted Publishing
51
+
52
+ steps:
53
+ - uses: actions/checkout@v4
54
+
55
+ - uses: actions/setup-python@v5
56
+ with:
57
+ python-version: "3.x"
58
+
59
+ - name: Install uv
60
+ run: pip install uv
61
+
62
+ - name: Check tag matches pyproject.toml version
63
+ run: |
64
+ TAG_VERSION="${GITHUB_REF_NAME#v}"
65
+ PYPROJECT_VERSION="$(python3 -c "import tomllib; print(tomllib.load(open('pyproject.toml','rb'))['project']['version'])")"
66
+ if [ "$TAG_VERSION" != "$PYPROJECT_VERSION" ]; then
67
+ echo "Tag $GITHUB_REF_NAME does not match pyproject.toml version $PYPROJECT_VERSION"
68
+ exit 1
69
+ fi
70
+
71
+ - name: Build
72
+ run: uv build
73
+
74
+ - name: Test the built wheel
75
+ run: |
76
+ uv venv /tmp/testenv
77
+ uv pip install --python /tmp/testenv/bin/python dist/*.whl
78
+ /tmp/testenv/bin/burnie --help
79
+
80
+ - name: Publish to PyPI
81
+ run: uv publish --trusted-publishing always
@@ -0,0 +1,8 @@
1
+ burnie-report.html
2
+ .DS_Store
3
+ METRICS.md
4
+ __pycache__
5
+ burnie-report.md
6
+ uv.lock
7
+ dist/
8
+ *.egg-info/
burnie-0.1.0/CLAUDE.md ADDED
@@ -0,0 +1,53 @@
1
+ # burnie: project context
2
+
3
+ ## What this is
4
+
5
+ A local cost analytics tool for Claude Code. Reads `~/.claude/projects/**/*.jsonl` session transcripts and surfaces token costs.
6
+
7
+ Python package (src-layout), installed/run via `uv`/`uvx`/`pip`, published as `burnie` on PyPI. Ported from an earlier Node.js implementation because `burnie` was already taken on npm.
8
+
9
+ ## Main component
10
+
11
+ **CLI / report (`src/burnie/cli.py`)**
12
+ - Scans all local session files, generates an HTML report (`burnie-report.html`)
13
+ - Visual breakdown: total spend, daily avg, cache savings, cost by model
14
+ - Per-session detail: context growth, tool usage, agent calls, repeated operations
15
+ - Tooltips on non-obvious metrics, and a link to `claude.ai/new#settings/usage`
16
+ - `src/burnie/report.py` builds the HTML. The CSS and client-side JS (Chart.js-based) inside it are plain static strings, not templated, so edit them as HTML/JS directly
17
+
18
+ ## Data source
19
+
20
+ Claude Code session files: `~/.claude/projects/<encoded-path>/<session-id>.jsonl`
21
+
22
+ Each line is a JSON event. Relevant types:
23
+ - `assistant`: has `message.usage` with `input_tokens`, `output_tokens`, `cache_creation_input_tokens`, `cache_read_input_tokens`
24
+ - `user`: user messages and tool results
25
+ - `ai-title`: session title
26
+
27
+ Encoded path: project's absolute path with `/` replaced by `-`.
28
+
29
+ ## Pricing
30
+
31
+ Stored in `src/burnie/pricing.py`, the single source of truth. Includes `PRICING_UPDATED` date shown in the report. Use the `/burnie-update` skill to refresh from `anthropic.com/pricing`.
32
+
33
+ ## Skill install
34
+
35
+ `burnie --install-skill` (`cli.py::_install_skill`): with a repo checkout on disk (`_repo_skills_dir`, detected via `__file__`, which holds true for editable installs and source runs), symlinks `skills/burnie` and `skills/burnie-update` into `~/.claude/skills/` so edits show up live. `burnie-update` edits `src/burnie/pricing.py` in place, so it's only included here, alongside the source tree. Without a checkout (plain PyPI/`uv` install), copies just `skills/burnie/SKILL.md` from the wheel, bundled there via `[tool.hatch.build.targets.wheel.force-include]` in `pyproject.toml`.
36
+
37
+ `metadata.version` in both `SKILL.md` files is a plain string, bumped by hand alongside `pyproject.toml`'s `version`, the same convention as `PRICING_UPDATED`.
38
+
39
+ ## CI / Releasing
40
+
41
+ `.github/workflows/ci.yml` builds and smoke-tests the wheel on every push/PR. `.github/workflows/release.yml` drafts a GitHub Release from `pyproject.toml`'s version on every push to `main`, and publishes to PyPI via Trusted Publishing when that draft is published. `src/burnie/__init__.py` reads `__version__` from installed metadata at runtime, so it's not a manual bump point.
42
+
43
+ ## Key decisions
44
+
45
+ - No backend, no API calls: everything runs locally on the JSONL files
46
+ - Python, packaged with `hatchling`, distributed via PyPI/`uv`
47
+ - Pricing in one file (`src/burnie/pricing.py`) so updates don't touch report logic
48
+
49
+ ## Non-goals
50
+
51
+ - Not a billing tool (no API key, no Anthropic account access)
52
+ - Not a real-time token counter during generation
53
+ - Not a cloud service
burnie-0.1.0/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 burnie contributors
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
burnie-0.1.0/PKG-INFO ADDED
@@ -0,0 +1,93 @@
1
+ Metadata-Version: 2.4
2
+ Name: burnie
3
+ Version: 0.1.0
4
+ Summary: Claude Code session cost analytics: your tokens are burning
5
+ Project-URL: Homepage, https://github.com/czoido/burnie
6
+ Project-URL: Repository, https://github.com/czoido/burnie
7
+ Author: Carlos Zoido
8
+ License-Expression: MIT
9
+ License-File: LICENSE
10
+ Keywords: analytics,claude,claude-code,cost,tokens
11
+ Classifier: Development Status :: 4 - Beta
12
+ Classifier: Environment :: Console
13
+ Classifier: Intended Audience :: Developers
14
+ Classifier: Operating System :: OS Independent
15
+ Classifier: Programming Language :: Python :: 3
16
+ Classifier: Programming Language :: Python :: 3.9
17
+ Classifier: Programming Language :: Python :: 3.10
18
+ Classifier: Programming Language :: Python :: 3.11
19
+ Classifier: Programming Language :: Python :: 3.12
20
+ Classifier: Programming Language :: Python :: 3.13
21
+ Classifier: Topic :: Utilities
22
+ Requires-Python: >=3.9
23
+ Description-Content-Type: text/markdown
24
+
25
+ <p align="center">
26
+ <img src="burnie.png" alt="Burnie" width="200" />
27
+ </p>
28
+
29
+ <p align="center"><em>Some agents just want to watch your tokens burn.</em></p>
30
+
31
+ ---
32
+
33
+ **burnie** is a local cost analytics tool for Claude Code. It reads the session transcripts Claude Code stores on disk and gives you a clear picture of where your money is going: no API key, no cloud, just your files.
34
+
35
+ ## Features
36
+
37
+ - **Report:** visual HTML breakdown of token costs across all your Claude Code sessions: total spend, daily average, cache savings, cost by model
38
+ - **Inspect:** drill into any session to see what drove the cost: context growth over time, tool call patterns, agent spawns, repeated operations
39
+ - **Analyze:** the `/burnie` skill runs a condensed report through Claude for a written, reasoned take on where your cost is coming from and what (if anything) to do about it
40
+
41
+ ## Install
42
+
43
+ ```bash
44
+ # run without installing
45
+ uvx burnie
46
+
47
+ # or install as a persistent command
48
+ uv tool install burnie
49
+ ```
50
+
51
+ No `uv`? `pip install burnie` works too.
52
+
53
+ Then get the `/burnie` skill into Claude Code:
54
+
55
+ ```bash
56
+ burnie --install-skill
57
+ ```
58
+
59
+ ## Usage
60
+
61
+ ```bash
62
+ # Generate HTML report
63
+ burnie
64
+
65
+ # Highlight a specific session in the report
66
+ burnie --session <session-id>
67
+
68
+ # Markdown report instead of HTML
69
+ burnie --markdown
70
+
71
+ # Condensed, LLM-readable report printed to stdout (what the `/burnie` skill uses)
72
+ burnie --raw --session <session-id>
73
+ ```
74
+
75
+ The report is written to `burnie-report.html` in the current directory and opened in your browser. `--markdown` writes `burnie-report.md` instead. `--raw` prints straight to stdout with no file.
76
+
77
+ ## How it works
78
+
79
+ Claude Code writes every session to a JSONL file at:
80
+
81
+ ```
82
+ ~/.claude/projects/<encoded-project-path>/<session-id>.jsonl
83
+ ```
84
+
85
+ Each assistant turn includes token usage. burnie reads those files, applies current model pricing from `src/burnie/pricing.py`, and surfaces the data.
86
+
87
+ ## Pricing
88
+
89
+ Stored in `src/burnie/pricing.py`, the single source of truth. Run `/burnie-update` to refresh from Anthropic's pricing page.
90
+
91
+ ---
92
+
93
+ <p align="center">Burnie doesn't judge. It just burnies. 🔥</p>
burnie-0.1.0/README.md ADDED
@@ -0,0 +1,69 @@
1
+ <p align="center">
2
+ <img src="burnie.png" alt="Burnie" width="200" />
3
+ </p>
4
+
5
+ <p align="center"><em>Some agents just want to watch your tokens burn.</em></p>
6
+
7
+ ---
8
+
9
+ **burnie** is a local cost analytics tool for Claude Code. It reads the session transcripts Claude Code stores on disk and gives you a clear picture of where your money is going: no API key, no cloud, just your files.
10
+
11
+ ## Features
12
+
13
+ - **Report:** visual HTML breakdown of token costs across all your Claude Code sessions: total spend, daily average, cache savings, cost by model
14
+ - **Inspect:** drill into any session to see what drove the cost: context growth over time, tool call patterns, agent spawns, repeated operations
15
+ - **Analyze:** the `/burnie` skill runs a condensed report through Claude for a written, reasoned take on where your cost is coming from and what (if anything) to do about it
16
+
17
+ ## Install
18
+
19
+ ```bash
20
+ # run without installing
21
+ uvx burnie
22
+
23
+ # or install as a persistent command
24
+ uv tool install burnie
25
+ ```
26
+
27
+ No `uv`? `pip install burnie` works too.
28
+
29
+ Then get the `/burnie` skill into Claude Code:
30
+
31
+ ```bash
32
+ burnie --install-skill
33
+ ```
34
+
35
+ ## Usage
36
+
37
+ ```bash
38
+ # Generate HTML report
39
+ burnie
40
+
41
+ # Highlight a specific session in the report
42
+ burnie --session <session-id>
43
+
44
+ # Markdown report instead of HTML
45
+ burnie --markdown
46
+
47
+ # Condensed, LLM-readable report printed to stdout (what the `/burnie` skill uses)
48
+ burnie --raw --session <session-id>
49
+ ```
50
+
51
+ The report is written to `burnie-report.html` in the current directory and opened in your browser. `--markdown` writes `burnie-report.md` instead. `--raw` prints straight to stdout with no file.
52
+
53
+ ## How it works
54
+
55
+ Claude Code writes every session to a JSONL file at:
56
+
57
+ ```
58
+ ~/.claude/projects/<encoded-project-path>/<session-id>.jsonl
59
+ ```
60
+
61
+ Each assistant turn includes token usage. burnie reads those files, applies current model pricing from `src/burnie/pricing.py`, and surfaces the data.
62
+
63
+ ## Pricing
64
+
65
+ Stored in `src/burnie/pricing.py`, the single source of truth. Run `/burnie-update` to refresh from Anthropic's pricing page.
66
+
67
+ ---
68
+
69
+ <p align="center">Burnie doesn't judge. It just burnies. 🔥</p>
Binary file
Binary file
@@ -0,0 +1,42 @@
1
+ [project]
2
+ name = "burnie"
3
+ version = "0.1.0"
4
+ description = "Claude Code session cost analytics: your tokens are burning"
5
+ readme = "README.md"
6
+ requires-python = ">=3.9"
7
+ license = "MIT"
8
+ license-files = ["LICENSE"]
9
+ authors = [
10
+ { name = "Carlos Zoido" },
11
+ ]
12
+ keywords = ["claude-code", "claude", "cost", "tokens", "analytics"]
13
+ classifiers = [
14
+ "Development Status :: 4 - Beta",
15
+ "Environment :: Console",
16
+ "Intended Audience :: Developers",
17
+ "Operating System :: OS Independent",
18
+ "Programming Language :: Python :: 3",
19
+ "Programming Language :: Python :: 3.9",
20
+ "Programming Language :: Python :: 3.10",
21
+ "Programming Language :: Python :: 3.11",
22
+ "Programming Language :: Python :: 3.12",
23
+ "Programming Language :: Python :: 3.13",
24
+ "Topic :: Utilities",
25
+ ]
26
+
27
+ [project.urls]
28
+ Homepage = "https://github.com/czoido/burnie"
29
+ Repository = "https://github.com/czoido/burnie"
30
+
31
+ [project.scripts]
32
+ burnie = "burnie.cli:main"
33
+
34
+ [build-system]
35
+ requires = ["hatchling"]
36
+ build-backend = "hatchling.build"
37
+
38
+ [tool.hatch.build.targets.wheel]
39
+ packages = ["src/burnie"]
40
+
41
+ [tool.hatch.build.targets.wheel.force-include]
42
+ "skills/burnie/SKILL.md" = "burnie/skills/burnie/SKILL.md"
@@ -0,0 +1,72 @@
1
+ ---
2
+ name: burnie
3
+ description: Generate and analyze a Claude Code session cost report. Use when the user asks about session costs, token spend, expensive sessions, or wants a cost breakdown of their Claude Code usage.
4
+ compatibility: Designed for Claude Code. Requires Python 3.9+ (run via `uvx burnie` or an installed `burnie`).
5
+ allowed-tools: Bash
6
+ metadata:
7
+ version: "0.1.0"
8
+ ---
9
+
10
+ Generate a Claude Code cost analytics report and provide a reasoned analysis of where the money is going and how to reduce it.
11
+
12
+ ## Steps
13
+
14
+ ### 1. Generate the raw report
15
+
16
+ Run burnie in `--raw` mode, passing the current session ID so it's marked in the output:
17
+
18
+ ```bash
19
+ burnie --raw --session $CLAUDE_CODE_SESSION_ID
20
+ ```
21
+
22
+ This reads all session files from `~/.claude/projects/**/*.jsonl`, computes costs, and prints a condensed, annotated report straight to stdout: no file, no browser. Each metric carries an inline one-line explanation of what it means, so read the numbers directly. You don't need extra context to interpret them.
23
+
24
+ The report has these sections: SUMMARY, TECHNICAL CONTEXT (cache stats: background, rarely worth leading with), GLOBAL PERCENTILES (p50/p75/p90/p95/max for cost, turns, peak context, and each cost component: the real baseline, since the average is skewed by the same expensive sessions you're trying to explain), COST BY COMPONENT, COST BY MODEL, COST BY PROJECT, CURRENT SESSION (this session's own numbers, its percentile rank, its COMPARABLE SESSIONS/peers with cohort size and quality, and its COST CURVE): **only present when `--session` matched a real session. If you ran this without `--session`, or the id didn't match anything on disk, there is no current session, no peers, and no cost curve to analyze, so say so and stick to the global patterns below instead of inventing a per-session read**, TOP 20 MOST EXPENSIVE SESSIONS (global cost patterns, not a baseline for "normal": includes `turns`/`peak_ctx` per session now, useful for comparing shape across the list), RECURRING FAILURES, and FREQUENTLY ACCESSED TARGETS (background, not a finding: targets hit repeatedly by path/command/pattern).
25
+
26
+ ### 2. Provide a reasoned analysis
27
+
28
+ Write for someone who wants to know what to do, not someone who wants to see the metrics. The raw report's section order is for you to reason with. The response you write follows a different order, built around the conclusion, not the data.
29
+
30
+ **Output structure (always these three parts, in this order):**
31
+
32
+ 1. **Current session.** If the report has no CURRENT SESSION block (no `--session` was passed, or the id didn't match a session on disk), say plainly that there's no data for the current session and skip straight to part 2. Don't invent a per-session read from the global/top-20 data. Otherwise, open with a plain-language verdict, before any number: does this session show a specific problem, or not? If not, say so directly in the first sentence ("no specific problem here, no action needed based on this session"). Don't make the reader infer that from a pile of percentiles. Then 1-3 sentences of supporting context (peer comparison, cost curve shape, compactions), written as comparisons a non-technical reader can picture, not as statistics. **Never write "P84," "percentile 45," or any raw percentile/rank number in the response**. Translate every one into a plain comparison instead: "more expensive than most sessions overall, but ordinary for this project," "close to the middle of what similar sessions cost," "well above what its peers typically cost." The percentile numbers are for you to reason with while writing the analysis. They should never appear as numbers in what the user reads. Close with one line on what to do (often, correctly, "nothing for now").
33
+ 2. **Recommended actions.** Patterns across the whole history, not this session specifically. Cap at 3, ordered by impact, but don't pad to reach 3. Zero, one, or two items is a valid, often correct result. Only include an item if the data supports it. Each one has exactly four parts:
34
+ - **Conclusion:** what's happening, plain language, no jargon.
35
+ - **Evidence:** the specific numbers behind it.
36
+ - **Action:** either a specific behavior change the user can go make (a command, a workflow change) when the report actually links the pattern to that change, or, when it doesn't, an explicit **"Worth inspecting"** framing that names what to go look at before deciding whether to change anything. Never invent a fix for a pattern that's only been observed, not diagnosed, and never pad with vague advice like "reduce token usage."
37
+ - **Impact:** high/medium/low, and a confidence label when the causal link isn't proven (e.g. "157 rereads of file X" is high-confidence evidence of a *pattern*, only medium-confidence that it's *avoidable*, because the file may have changed between reads).
38
+ 3. **Session data.** A short block of plain facts at the very end (cost, turns, model, context range, compactions, files touched) for reference, not part of the narrative above it. If there's no CURRENT SESSION block, just write "not available" here instead of omitting the part.
39
+
40
+ Keep these separate throughout. Never blend them: what's true about *this session* vs. what's true about *the whole history*, and an *observation* (a pattern exists) vs. a *recommendation* (do this about it).
41
+
42
+ **Rules (follow all of them):**
43
+ - State the verdict in plain language first. Percentiles/ranks/cohort numbers back it up, they don't replace it.
44
+ - Compare the current session to its **peers** (same project + same model, similar turn count) first. That's the real "is this normal" comparison. Use GLOBAL PERCENTILES for broader context. Use the TOP 20 list only to say whether a global pattern is widespread ("this shows up in N of the 20 priciest sessions"), never as a stand-in for "normal," and never as a reason to flag the *current* session.
45
+ - If `comparison_quality=low` (thin cohort, so check `cohort_candidates`), say so explicitly and treat any cohort comparison as low-confidence rather than drawing firm conclusions from it.
46
+ - Never call `spend_after_first_compaction` "savings" or "recoverable". It explains *where* the cost came from, not money you can get back.
47
+ - Never infer or state whether the session "succeeded," was "efficient," or was "worth it." `files_touched` is a plain fact about size of the work, never a quality verdict.
48
+ - Never use tool-call count, cache-reuse rate, or session duration by themselves as an efficiency score.
49
+ - Context jumps in the COST CURVE list tools active in the *previous* turn as circumstantial context, not a cause: say "context grew after a turn that included these tools," never "X tool added Y tokens." The same caution applies to any jump you tie to a specific turn's own response (e.g. a long summary): say it "coincides with" or "lands on" that turn, never that the response "caused" or "added" a specific token amount.
50
+ - CURRENT SESSION is a snapshot: if the session is still running, say the numbers may not reflect later turns.
51
+ - It's a valid, often correct verdict that "this session is normal for its cohort, no action needed." Don't manufacture a recommendation when the data doesn't support one, and don't let a global recommendation (part 2) read as if it applies to the current session (part 1) unless it actually does.
52
+ - FREQUENTLY ACCESSED TARGETS is not confirmed waste. The report says so, and you must not upgrade it. Repeated calls only prove *repetition*, not that the file/command was unchanged, that different calls targeted the same section, or that the cost was avoidable. If you use it in a Recommended Action, the Action must be phrased as "Worth inspecting: ..." (e.g. whether the repeated calls hit the same section unchanged, or different offsets/versions), never a prescribed workflow change like "keep a summary instead," and never "wasted cost," "avoidable cost," or "confirmed waste."
53
+ - If you group sessions by a pattern in their *titles* (e.g. several "port project to X" sessions) rather than by a field the report actually computes, present it as a hypothesis, not a confirmed finding: "several of the priciest sessions appear to be porting tasks," not "this workflow has been reliably identified." Titles are text you're pattern-matching, not a mechanical signal like `project` or `model`.
54
+ - In RECURRING FAILURES, distinguish by the `sessions` count on each entry: `sessions > 1` is a **cross-session recurring issue** (the same failure across different sessions, worth a permanent fix, e.g. a config change). `sessions == 1` (many occurrences, one session) is an **in-session loop** (worth reviewing the approach taken *in that session*, not a systemic fix). Don't treat them as the same kind of finding.
55
+ - If a RECURRING FAILURES `message` lists more than one possible cause (e.g. "unescaped backslashes... unescaped control characters... or truncated output"), don't pick one and present it as the diagnosis. You have no evidence for which cause applies without inspecting the original failed tool call. Say the failure recurs and name the *set* of possible causes, or say it needs inspecting the actual calls, not guess.
56
+ - A cost recorded after a compaction describes *when* it landed, not that compacting *caused* it. If you want to state a dollar figure for "how much accumulated after the first compaction," only use `spend_after_first_compaction` when the report prints it explicitly for the current session. Never estimate it by eyeballing the COST CURVE.
57
+ - Never invent a counterfactual dollar figure the report doesn't compute (e.g. "starting a new session would have cost about $X less"). Without an explicit field for it, phrase the idea as an untested suggestion for next time, not a quantified saving.
58
+
59
+ **Before writing the response, verify (do this as a final pass, not while drafting):**
60
+ - Every count you state for distinct items (files, sessions, occurrences, rows) matches an actual recount of the report's rows, not an estimate or a round number that feels right. If you say "N files," N must equal the number of distinct rows you can point to, not one row counted twice under different labels.
61
+ - Every superlative ("most expensive," "highest," "only one") against the *broadest set you actually checked*. "Highest among peers/cohort" must never be written as "highest in the project" or "highest ever." If you haven't checked TOP 20 / COST BY PROJECT for cheaper-but-still-larger sessions, don't claim a project- or history-wide superlative.
62
+ - Every quoted number (cost, turns, peak context, rank) traces back to a single row in the report, not assembled from two different rows (e.g. one peer's cost with another peer's turn count).
63
+ - No sentence evaluates whether the session's work was complex, successful, efficient, or "worth it." Banned phrasing (and equivalents): "genuinely complex work," "the length reflects the problem, not a methodology problem," "it's done what it set out to do," "the cost was justified," "no methodology problem here," "runaway session(s)" (a long, expensive session is a fact, but whether it spiraled versus simply contained a lot of work is not something the report can tell you).
64
+ - Part 1's verdict isn't contradicted by Part 2. If Part 2 recommends a change (e.g. "split long investigations at milestones") using this session as its example, Part 1 should say "no single mistake within this session" rather than an unqualified "no action needed" that Part 2 then undercuts.
65
+
66
+ This is meant to be a fuller analysis than a quick summary, so don't artificially cap the explanation, but stay focused on what's actionable rather than restating every number in the report.
67
+
68
+ If the user wants to browse the numbers visually instead, mention they can run `burnie` with no flags to get the interactive HTML report in their browser, but don't generate it as part of this flow.
69
+
70
+ ## Arguments
71
+
72
+ If `$ARGUMENTS` is provided, treat it as a scope hint for the analysis (e.g. "focus on project X" or "just the last week") rather than a file path. `--raw` has no output file.
@@ -0,0 +1,27 @@
1
+ ---
2
+ name: burnie-update
3
+ description: Fetch current Claude model prices from anthropic.com/pricing and update src/burnie/pricing.py. Use when the user says prices have changed, wants to refresh pricing, or update model costs.
4
+ compatibility: Designed for Claude Code. Requires internet access to anthropic.com/pricing.
5
+ allowed-tools: WebFetch
6
+ metadata:
7
+ version: "0.1.0"
8
+ ---
9
+
10
+ Fetch current Claude model prices from anthropic.com/pricing and update `src/burnie/pricing.py`.
11
+
12
+ ## Steps
13
+
14
+ 1. Fetch https://www.anthropic.com/pricing with WebFetch
15
+ 2. Extract the $/MTok prices for each model family (input, output, cache write, cache read)
16
+ 3. Update `src/burnie/pricing.py`:
17
+ - Replace the `PRICING` list entries with the new values
18
+ - Update `PRICING_UPDATED` to today's date (YYYY-MM-DD format)
19
+ 4. Report what changed (which models, old vs new values)
20
+
21
+ ## Notes
22
+
23
+ - Cache write is typically 1.25× input price
24
+ - Cache read is typically 0.1× input price
25
+ - If a model from the current list is no longer on the pricing page, keep it but add a comment `# discontinued?`
26
+ - If a new model appears, add it following the same format
27
+ - Only edit `src/burnie/pricing.py`. The other files import from it
@@ -0,0 +1,7 @@
1
+ from importlib.metadata import PackageNotFoundError, version
2
+
3
+ try:
4
+ # Canonical version lives in pyproject.toml [project].version
5
+ __version__ = version("burnie")
6
+ except PackageNotFoundError:
7
+ __version__ = "0.0.0"