costclaw 0.9.1 → 0.10.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.
- package/README.md +48 -19
- package/dist/index.js +1079 -299
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -182,17 +182,21 @@ costclaw badge [--path <dir>] [--claude-md <file>] [--out <file>]
|
|
|
182
182
|
npx costclaw optimize
|
|
183
183
|
```
|
|
184
184
|
|
|
185
|
-
|
|
186
|
-
scaffold, a prioritized fix playbook, a conservative,
|
|
187
|
-
`settings.suggested.json` permission allowlist,
|
|
188
|
-
order for your own Claude Code
|
|
189
|
-
(
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
185
|
+
Generates, for every project your audit saw, five artifacts: an optimized
|
|
186
|
+
`CLAUDE.md` scaffold, a prioritized fix playbook, a conservative,
|
|
187
|
+
project-derived `settings.suggested.json` permission allowlist, a
|
|
188
|
+
`HARNESS-UPGRADE.md` work order for your own Claude Code, and `costclaw.md`
|
|
189
|
+
(the generated sections as a standalone include). It never writes inside a
|
|
190
|
+
project; only `costclaw apply` does that, and only on an explicit command.
|
|
191
|
+
|
|
192
|
+
By default it runs globally: it ranks your audited projects by spend,
|
|
193
|
+
generates for the top ones (cap 10; override with `--limit N`) into
|
|
194
|
+
`~/.costclaw/optimize/<project>/`, and writes one `DASHBOARD.html` index
|
|
195
|
+
listing every project with its receipt and apply line, plus a local
|
|
196
|
+
click-to-apply page you can use instead of the command line (Ctrl+C, the
|
|
197
|
+
page's Done button, or `--no-serve` to skip it). `--project <dir>` keeps the
|
|
198
|
+
single-project behavior, writing into `./costclaw-out` (or `--out <dir>`)
|
|
199
|
+
instead. `--no-dashboard` skips the HTML.
|
|
196
200
|
|
|
197
201
|
And it tells you what it actually did to the file that rides on every turn:
|
|
198
202
|
|
|
@@ -248,24 +252,49 @@ The rows plus that remainder line always add up to the headline figure above
|
|
|
248
252
|
them, so the breakdown reconciles rather than approximating.
|
|
249
253
|
|
|
250
254
|
```
|
|
251
|
-
costclaw optimize [--path <dir>] [--claude-md <file>] [--project <dir>] [--out <dir>] [--
|
|
255
|
+
costclaw optimize [--path <dir>] [--claude-md <file>] [--project <dir>] [--out <dir>] [--limit <n>] [--no-dashboard] [--no-serve] [--force]
|
|
252
256
|
```
|
|
253
257
|
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
+
## Apply
|
|
259
|
+
|
|
260
|
+
```bash
|
|
261
|
+
npx costclaw apply
|
|
262
|
+
```
|
|
263
|
+
|
|
264
|
+
The only command that writes inside a project, and only additively. Run it
|
|
265
|
+
from inside the project, or pass a directory:
|
|
266
|
+
|
|
267
|
+
```
|
|
268
|
+
costclaw apply [<dir>] [--remove] [--replace] [--apply-settings [file]] [--from <dir>] [--force]
|
|
269
|
+
```
|
|
270
|
+
|
|
271
|
+
- Default mode writes the generated sections to `.claude/costclaw.md` and adds
|
|
272
|
+
one `@.claude/costclaw.md` import line (Claude Code's memory import syntax)
|
|
273
|
+
to your `CLAUDE.md`. Every line you wrote stays exactly as it was. Idempotent:
|
|
274
|
+
running it again rewrites the include and leaves the import line alone.
|
|
275
|
+
- `--remove` undoes it: deletes `.claude/costclaw.md` and `.claude/costclaw/`,
|
|
276
|
+
and strips the import line (only that exact generated line).
|
|
277
|
+
- `--replace` is the old wholesale rewrite. It requires a git repository (a
|
|
278
|
+
`.git` directory in the project), so the undo is `git checkout -- CLAUDE.md`;
|
|
279
|
+
outside git it refuses. It still keeps a `.bak` as a second net, refusing to
|
|
280
|
+
overwrite an existing one without `--force`.
|
|
281
|
+
- `--apply-settings [file]` additively merges the derived permission allowlist
|
|
282
|
+
into your Claude Code settings. Opt-in: it only touches
|
|
258
283
|
`permissions.allow` and `permissions.deny` (a deduped union that keeps your
|
|
259
284
|
existing entries and orders them first) and never removes or changes any other
|
|
260
|
-
key. The default target is the
|
|
285
|
+
key. The default target is the project's `.claude/settings.json`; pass
|
|
261
286
|
`[file]` to target another. It backs up the previous file to `<target>.bak`,
|
|
262
287
|
prints a diff, then writes pretty JSON. A missing target is created; a file it
|
|
263
288
|
cannot `JSON.parse` (for example JSONC with comments) is refused and left
|
|
264
289
|
untouched.
|
|
265
|
-
- `--
|
|
290
|
+
- `--from <dir>` points at a specific artifacts folder instead of looking one
|
|
291
|
+
up by project. Without it, `apply` finds artifacts from the last `optimize`
|
|
292
|
+
run, or generates them cold (into `./costclaw-out`) if none exist yet.
|
|
293
|
+
- `--force` allows overwriting an existing `.bak` backup for `--replace` and
|
|
266
294
|
`--apply-settings`.
|
|
267
295
|
|
|
268
|
-
`optimize`
|
|
296
|
+
`optimize` and `apply` need a one-time license (`costclaw activate <key>`);
|
|
297
|
+
`audit` is free.
|
|
269
298
|
|
|
270
299
|
## Privacy
|
|
271
300
|
|