ultracost 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 (3) hide show
  1. package/CHANGELOG.md +18 -1
  2. package/README.md +27 -5
  3. package/package.json +1 -1
package/CHANGELOG.md CHANGED
@@ -6,6 +6,22 @@ All notable changes to this project are documented here. The format is based on
6
6
 
7
7
  ## [Unreleased]
8
8
 
9
+ ## [0.3.1] - 2026-06-14
10
+
11
+ ### Added
12
+ - **A slash command for every verb inside Claude Code.** The plugin previously shipped only
13
+ `/ultracost:check`, so the phase-2 features were reachable solely through the npm CLI. It now
14
+ ships `/ultracost:estimate · explain · simulate · diff · audit · usage · reconcile · calibrate ·
15
+ ledger · status` as well — each runs the bundled CLI via `${CLAUDE_PLUGIN_ROOT}/bin/cli.js`, so
16
+ plugin users need nothing on `PATH`. Generated from one table (`scripts/generate-commands.mjs`)
17
+ and drift-tested.
18
+
19
+ ### Changed
20
+ - **README is plugin-first.** The first-use example is `/ultracost:check ./path/to/workflow.js`
21
+ (the slash command), not the npm `ultracost check` — which plugin users don't have on `PATH`.
22
+ Added a full slash-command table and noted the `/ultracost:<verb>` equivalent next to each CLI
23
+ block. The npm CLI is now framed as the CI/scripting path.
24
+
9
25
  ## [0.3.0] - 2026-06-14
10
26
 
11
27
  Phase 2 — closed-loop precision and a zero-dependency visual overhaul. Still zero runtime
@@ -125,7 +141,8 @@ dependencies, Claude-Code-only, and offline on the hot path.
125
141
  and tiers whose model is in `neverUse`).
126
142
  - `ultracost status`, `ultracost doctor`, `ultracost uninstall`.
127
143
 
128
- [Unreleased]: https://github.com/danielkremen818/ultracost/compare/v0.3.0...HEAD
144
+ [Unreleased]: https://github.com/danielkremen818/ultracost/compare/v0.3.1...HEAD
145
+ [0.3.1]: https://github.com/danielkremen818/ultracost/compare/v0.3.0...v0.3.1
129
146
  [0.3.0]: https://github.com/danielkremen818/ultracost/compare/v0.2.1...v0.3.0
130
147
  [0.2.1]: https://github.com/danielkremen818/ultracost/compare/v0.2.0...v0.2.1
131
148
  [0.2.0]: https://github.com/danielkremen818/ultracost/compare/v0.1.0...v0.2.0
package/README.md CHANGED
@@ -44,9 +44,9 @@ No telemetry. No network on the hot path. MIT.
44
44
  npx ultracost init
45
45
  ```
46
46
 
47
- **Command:** `ultracost check [script]` (or `/ultracost:check` in Claude Code) — flag any `agent()` stage missing a model pin.
47
+ **First command (in Claude Code):** `/ultracost:check ./path/to/workflow.js` — flag any `agent()` stage that would silently inherit Opus. The plugin ships a slash command for every verb (`/ultracost:check · estimate · explain · simulate · diff · audit · usage · reconcile · calibrate · ledger · status`) — no global binary needed.
48
48
 
49
- **CLI verbs:** `init · check · audit · estimate · explain · simulate · diff · usage · reconcile · calibrate · ledger · pricing · status · doctor · uninstall`.
49
+ **Same verbs on the npm CLI** (CI / scripting): `ultracost init · check · audit · estimate · explain · simulate · diff · usage · reconcile · calibrate · ledger · pricing · status · doctor · uninstall`.
50
50
 
51
51
  <div align="center">
52
52
 
@@ -104,13 +104,29 @@ Inside Claude Code:
104
104
  /plugin install ultracost@ultracost
105
105
  ```
106
106
 
107
- Then verify a workflow script at any time:
107
+ Then, **without leaving Claude Code**, drive everything through slash commands — verify the workflow Claude just drafted, estimate it, or reconcile a finished run against what it actually cost:
108
108
 
109
109
  ```text
110
110
  /ultracost:check ./path/to/workflow.js
111
111
  ```
112
112
 
113
- The plugin bundles — touching none of your own files — a `SessionStart` policy-injection hook, a `PreToolUse` cost gate on the `Workflow` tool (`ULTRACOST_GATE=off` to disable), the `/ultracost:check` command, and a routing-policy skill. Requires Claude Code with the `/plugin` command and dynamic workflows enabled.
113
+ The plugin bundles — touching none of your own files — a `SessionStart` policy-injection hook, a `PreToolUse` cost gate on the `Workflow` tool (`ULTRACOST_GATE=off` to disable), a routing-policy skill, and a slash command for every verb (each runs the bundled CLI via `${CLAUDE_PLUGIN_ROOT}`, so there's nothing to install on `PATH`):
114
+
115
+ | Command | What it does |
116
+ |---------|--------------|
117
+ | `/ultracost:check [path]` | Flag `agent()` stages that don't pin a model (or pin the wrong tier). Defaults to the most recent workflow script. |
118
+ | `/ultracost:estimate <script>` | Agent count, model mix, tiered cost vs an all-opus baseline. |
119
+ | `/ultracost:explain <script>` | Per-stage rationale: model, effort, the tier the prompt reads like, est cost, check flags. |
120
+ | `/ultracost:simulate <script>` | Cost under all-opus vs your tiered pins vs all-sonnet. |
121
+ | `/ultracost:diff <a> <b>` | Cost delta between two versions of a script. |
122
+ | `/ultracost:audit [dir]` | Pin stats across your real workflow scripts. |
123
+ | `/ultracost:usage [dir]` | Real token cost from local transcripts (main vs subagents vs stages). |
124
+ | `/ultracost:reconcile [--last\|<id>]` | Estimate vs **actual** per stage for a finished run. |
125
+ | `/ultracost:calibrate` | Tune the estimator from your real token usage. |
126
+ | `/ultracost:ledger` | Cumulative savings vs all-opus across recorded runs. |
127
+ | `/ultracost:status` | How ultracost is delivered (plugin/cli), the policy, and the bypass caveat. |
128
+
129
+ Requires Claude Code with the `/plugin` command and dynamic workflows enabled.
114
130
 
115
131
  ### npm CLI
116
132
 
@@ -147,7 +163,9 @@ ultracost uninstall
147
163
 
148
164
  Reverses everything `init` did: removes the routing block from `~/.claude/CLAUDE.md`, deletes `~/.claude/ultracost/`, and unregisters the hook from `~/.claude/settings.json` (an invalid `settings.json` is reported, never overwritten).
149
165
 
150
- ## Quickstart (CLI)
166
+ ## Quickstart (npm CLI)
167
+
168
+ > Inside Claude Code, every verb below is also a slash command — `/ultracost:estimate`, `/ultracost:reconcile`, etc. (see the table above). This section is the npm path for CI, scripting, or the CLAUDE.md-injection workflow.
151
169
 
152
170
  ```bash
153
171
  ultracost init # install policy + rules + hook (refuses if the plugin already delivers it)
@@ -197,6 +215,8 @@ ultracost calibrate # learn a token prior from your real runs (estim
197
215
  ultracost ledger # cumulative $ saved vs an all-opus baseline, persisted
198
216
  ```
199
217
 
218
+ In Claude Code these are `/ultracost:usage`, `/ultracost:reconcile`, `/ultracost:calibrate`, and `/ultracost:ledger` — same output, no CLI install.
219
+
200
220
  - **Self-calibrating.** `calibrate` learns real per-stage token sizes (outlier-filtered) into `~/.claude/ultracost/calibration.json`; `estimate`, `explain`, `simulate`, and the gate use it automatically — the estimate gets closer to your reality every run.
201
221
  - **Savings ledger.** `ledger` keeps a running tally of what the policy saved you versus running everything on Opus, persisted in `~/.claude/ultracost/ledger.jsonl` (idempotent per run).
202
222
  - **Pre-flight budget guard.** Set `budget.perRun` / `budget.perDay` in the policy and the cost gate **denies** a launch whose estimate would blow the cap — before it runs.
@@ -209,6 +229,8 @@ ultracost simulate ./wf.js # cost under all-opus vs your tiered pins vs all
209
229
  ultracost diff old.js new.js # cost delta between two versions (--ci → PR-comment table)
210
230
  ```
211
231
 
232
+ Or `/ultracost:explain`, `/ultracost:simulate`, `/ultracost:diff` inside Claude Code.
233
+
212
234
  ## How routing is decided
213
235
 
214
236
  | Tier | Model | Use for |
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ultracost",
3
- "version": "0.3.0",
3
+ "version": "0.3.1",
4
4
  "description": "Per-stage model routing for Claude Code dynamic workflows (ultracode). Quality-first policy, CLAUDE.md rule injection, and a workflow-script guard that catches subagent stages that would silently inherit Opus.",
5
5
  "type": "module",
6
6
  "bin": {