costclaw 0.16.2 → 0.17.0

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/README.md +29 -8
  2. package/dist/index.js +805 -598
  3. package/package.json +1 -1
package/README.md CHANGED
@@ -185,6 +185,10 @@ costclaw badge [--path <dir>] [--claude-md <file>] [--out <file>]
185
185
 
186
186
  ## Optimize
187
187
 
188
+ `optimize` is the paid command: a one-time $39 license, bought at
189
+ https://costclaw.io/#pricing (the key is emailed in about a minute), then
190
+ `npx costclaw activate <key>`. The audit stays free.
191
+
188
192
  The numeric examples in this section are illustrative placeholders, not output from
189
193
  an account or a promise of savings.
190
194
 
@@ -301,11 +305,15 @@ costclaw apply [<dir>] [--remove] [--replace] [--apply-settings [file]] [--from
301
305
  to your `CLAUDE.md`. Every line you wrote stays exactly as it was. Idempotent:
302
306
  running it again rewrites the include and leaves the import line alone.
303
307
  - `--remove` undoes it: deletes `.claude/costclaw.md` and `.claude/costclaw/`,
304
- and strips the import line (only that exact generated line).
308
+ and strips the import line (only that exact generated line). It never touches
309
+ `.claude/settings.json`, so permissions merged by `--apply-settings` stay. On a
310
+ project the optimize manifest (`~/.costclaw/optimize/index.json`) records as
311
+ not applied it refuses: the first stderr line is
312
+ `illegal_transition: not_applied -> not_applied is not allowed (...)` and the
313
+ exit code is 2.
305
314
  - `--replace` is the old wholesale rewrite. It requires a git repository (a
306
315
  `.git` directory in the project), so the undo is `git checkout -- CLAUDE.md`;
307
- outside git it refuses. It still keeps a `.bak` as a second net, refusing to
308
- overwrite an existing one without `--force`.
316
+ outside git it refuses. It still keeps a timestamped `.bak` as a second net.
309
317
  - `--apply-settings [file]` additively merges the derived permission allowlist
310
318
  into your Claude Code settings. Opt-in: it only touches
311
319
  `permissions.allow` and `permissions.deny` (a deduped union that keeps your
@@ -318,11 +326,24 @@ costclaw apply [<dir>] [--remove] [--replace] [--apply-settings [file]] [--from
318
326
  - `--from <dir>` points at a specific artifacts folder instead of looking one
319
327
  up by project. Without it, `apply` finds artifacts from the last `optimize`
320
328
  run, or generates them cold (into `./costclaw-out`) if none exist yet.
321
- - `--force` allows overwriting an existing `.bak` backup for `--replace` and
322
- `--apply-settings`.
323
-
324
- `optimize` and `apply` need a one-time license (`costclaw activate <key>`);
325
- `audit` is free.
329
+ - `--force` makes `--remove` run on a project the manifest records as not
330
+ applied, for when costclaw files are on disk anyway. Backups are timestamped
331
+ (`<file>.bak-YYYYMMDD-HHMMSS`), so no run overwrites an earlier one.
332
+
333
+ Each project in the manifest is in one apply state. A successful `apply` prints
334
+ it, plus the actions that are legal next (`include`, `settings`, `remove`); the
335
+ click-to-apply page disables the buttons that are not. Apply, Apply +
336
+ permissions and Undo are `apply`, `apply --apply-settings` and `apply --remove`.
337
+
338
+ | State | Status shown | Allowed next |
339
+ | --- | --- | --- |
340
+ | `not_applied` | not applied | Apply, Apply + permissions |
341
+ | `include` | applied, no permissions | Apply, Apply + permissions, Undo |
342
+ | `settings` | applied + permissions | Apply (stays `settings`), Apply + permissions, Undo |
343
+ | `applied_unknown` | applied (no mode recorded: before 0.13.1, or an older CLI) | Apply (stays `applied_unknown`), Apply + permissions, Undo |
344
+
345
+ `optimize` and `apply` need a one-time $39 license from
346
+ https://costclaw.io/#pricing (`costclaw activate <key>`); `audit` is free.
326
347
 
327
348
  ## Privacy
328
349