codebase-snapshot 0.20.13 → 0.22.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 (51) hide show
  1. package/CHANGELOG.md +45 -6
  2. package/README.md +46 -19
  3. package/SECURITY.md +2 -2
  4. package/dist/bin.js +14535 -12036
  5. package/dist/{chunk-GNVRD7XS.js → chunk-NPCDJBE4.js} +6097 -4425
  6. package/dist/cli.cjs +11184 -8708
  7. package/dist/cli.d.cts +94 -2
  8. package/dist/cli.d.ts +94 -2
  9. package/dist/cli.js +944 -95
  10. package/dist/{generate-worker-DMzNbsAW.d.cts → generate-worker-BUNhTXkj.d.cts} +2 -2
  11. package/dist/{generate-worker-CRMESc0b.d.ts → generate-worker-TUMvHlgz.d.ts} +2 -2
  12. package/dist/index.cjs +6073 -4423
  13. package/dist/index.d.cts +281 -63
  14. package/dist/index.d.ts +281 -63
  15. package/dist/index.js +1 -1
  16. package/dist/mcp.cjs +10240 -4315
  17. package/dist/mcp.d.cts +13 -7
  18. package/dist/mcp.d.ts +13 -7
  19. package/dist/mcp.js +1 -1
  20. package/dist/{types-C5ytHMYz.d.ts → types-DQXKiaXk.d.cts} +50 -2
  21. package/dist/{types-C5ytHMYz.d.cts → types-DQXKiaXk.d.ts} +50 -2
  22. package/docs/about.md +86 -0
  23. package/docs/agent.md +28 -6
  24. package/docs/answer.md +99 -48
  25. package/docs/benchmarks.md +34 -34
  26. package/docs/brief.md +80 -81
  27. package/docs/cli.md +126 -25
  28. package/docs/codebase-token-budget.md +14 -13
  29. package/docs/contents.md +68 -0
  30. package/docs/deploy.md +2 -2
  31. package/docs/faq.md +112 -0
  32. package/docs/glossary.md +152 -0
  33. package/docs/guard.md +154 -0
  34. package/docs/health.md +1 -1
  35. package/docs/how-to-feed-a-repo-to-claude.md +6 -0
  36. package/docs/impact.md +102 -0
  37. package/docs/install.md +4 -3
  38. package/docs/llm-codebase-context.md +166 -0
  39. package/docs/mcp-server-for-codebase.md +163 -0
  40. package/docs/mcp.md +48 -67
  41. package/docs/migration.md +83 -90
  42. package/docs/output.md +1 -3
  43. package/docs/security-review.md +8 -8
  44. package/docs/slice.md +1 -1
  45. package/docs/tools.md +159 -185
  46. package/docs/troubleshooting.md +11 -11
  47. package/docs/vs-code2prompt.md +7 -0
  48. package/docs/vs-gitingest.md +7 -0
  49. package/docs/vs-repomix.md +10 -1
  50. package/docs/workspace.md +1 -1
  51. package/package.json +8 -2
@@ -8,14 +8,14 @@ anyone can run:
8
8
  node scripts/benchmark.mjs /path/to/repo "the question to slice for"
9
9
  ```
10
10
 
11
- The run below used the default question, on the repository at 0.12.34: 313 files, 987,750 estimated
12
- tokens in full.
11
+ The run below used the default question, on this repository at **0.21.0 on 2026-11-30**: 221 files,
12
+ 764,225 estimated tokens in full.
13
13
 
14
14
  | Mode | Files | Parts | Tokens | vs full | Time |
15
15
  | :-- | --: | --: | --: | --: | --: |
16
- | full | 313 | 11 | 987,750 | 100% | 1.66 s |
17
- | slice | 4 | 1 | 66,430 | 6.7% | 1.57 s |
18
- | budget (30,000) | 21 | 1 | 36,315 | 3.7% | 1.55 s |
16
+ | full | 221 | 9 | 764,225 | 100% | 2.05 s |
17
+ | slice | 7 | 1 | 63,983 | 8.4% | 1.68 s |
18
+ | budget (30,000) | 22 | 1 | 36,005 | 4.7% | 1.69 s |
19
19
 
20
20
  ## What the columns mean
21
21
 
@@ -48,22 +48,22 @@ node scripts/benchmark-suite.mjs <url> ... # your own list
48
48
 
49
49
  Each repository is cloned shallow into a scratch directory, packed by all three tools, and the
50
50
  clone is deleted. A repository that cannot be cloned is reported as skipped with the reason, never
51
- dropped from the table. Measured at 0.14.5, repomix 1.19.0, gitingest from PyPI, and
52
- re-run on 2026-11-18 at 0.17.55: all ten repositories packed by all three tools, every number
53
- identical, which is what a deterministic scanner should do.
51
+ dropped from the table. Measured at **0.21.0 on 2026-11-30**, with repomix 1.19.0 and gitingest from
52
+ PyPI. The shape held; small file-count differences are policy (notably bounded previews), not
53
+ scanner drift.
54
54
 
55
55
  | Repository | Ours files | Ours tokens | repomix tokens | repomix / ours | gitingest bytes |
56
56
  | :-- | --: | --: | --: | --: | --: |
57
- | jonschlinkert/is-odd | 11 | 5,450 | 4,291 | 0.79 | 29,392 |
57
+ | jonschlinkert/is-odd | 11 | 5,447 | 4,291 | 0.79 | 29,392 |
58
58
  | chalk/chalk | 32 | 77,684 | 79,006 | 1.02 | 238,864 |
59
59
  | tj/co | 19 | 12,996 | 9,189 | 0.71 | 74,613 |
60
- | isaacs/minimatch | 85 | 319,879 | 64,846,987 | 202.72 | 1,800,672 |
61
- | moment/luxon | 151 | 303,032 | 250,093 | 0.83 | 806,740 |
60
+ | isaacs/minimatch | 87 | 303,508 | 64,794,947 | 213.49 | 1,764,476 |
61
+ | moment/luxon | 151 | 303,029 | 250,093 | 0.83 | 806,740 |
62
62
  | psf/requests | 117 | 382,695 | 687,333 | 1.80 | 524,712 |
63
63
  | pallets/click | 177 | 470,265 | 335,153 | 0.71 | 1,413,342 |
64
- | expressjs/express | 215 | 261,829 | 198,639 | 0.76 | 792,177 |
65
- | colinhacks/zod | 686 | 1,762,835 | 1,748,187 | 0.99 | 4,468,877 |
66
- | anuraghazra/github-readme-stats | 131 | 205,009 | 169,079 | 0.82 | 553,367 |
64
+ | expressjs/express | 215 | 261,817 | 198,639 | 0.76 | 792,177 |
65
+ | colinhacks/zod | 687 | 1,768,759 | 1,752,965 | 0.99 | 4,485,971 |
66
+ | anuraghazra/github-readme-stats | 131 | 205,013 | 169,079 | 0.82 | 553,367 |
67
67
 
68
68
  Read it carefully:
69
69
 
@@ -73,7 +73,7 @@ Read it carefully:
73
73
  reasonable estimates of the same text do.
74
74
  - **minimatch is the exception, and it is a policy difference, not an estimate.** That repository
75
75
  carries five benchmark fixtures of 20 to 25 MB of JSON. repomix emits them (64.8M tokens); our
76
- large-file rule emits a bounded preview and records the omission, so the pack stays 319,879 tokens.
76
+ large-file rule emits a bounded preview and records the omission, so the pack stays 303,508 tokens.
77
77
  A pack that will not fit in a context window has not helped the reader, however complete it is.
78
78
  - **gitingest publishes no token count**, so its column is the size of its one-document digest.
79
79
  - **File counts agree within one or two** everywhere except minimatch, where our preview keeps the
@@ -98,32 +98,32 @@ node scripts/compare.mjs --repomix # add --json for machine-readable output
98
98
  ```
99
99
 
100
100
  repomix is fetched through `npx` at run time and gitingest through `python -m gitingest`;
101
- neither is a dependency of this package. Measured on this repository at 0.14.2, repomix 1.19.0,
102
- gitingest from PyPI, same machine:
101
+ neither is a dependency of this package. Measured on this repository at **0.21.0 on 2026-11-30**,
102
+ repomix 1.19.0, gitingest from PyPI, same machine:
103
103
 
104
104
  | Tool / mode | Files | Content bytes | Tokens | vs full | Time |
105
105
  | :-- | --: | --: | --: | --: | --: |
106
- | codebase-snapshot (full) | 336 | 3,301,883 | 1,060,727 | 100% | 2.22 s |
107
- | codebase-snapshot (slice) | 4 | 239,837 | 66,903 | 6.3% | 2.14 s |
108
- | codebase-snapshot (budget 30,000) | 22 | 119,915 | 36,107 | 3.4% | 2.09 s |
109
- | repomix 1.19.0 | 335 | 3,519,653 | 888,168 | 83.7% | n/a |
110
- | gitingest | ? | 3,123,817 | n/a | n/a | n/a |
106
+ | codebase-snapshot (full) | 221 | 2,549,431 | 764,225 | 100% | 2.04 s |
107
+ | codebase-snapshot (slice) | 7 | 231,622 | 63,983 | 8.4% | 1.63 s |
108
+ | codebase-snapshot (budget 30,000) | 22 | 119,794 | 36,005 | 4.7% | 1.70 s |
109
+ | repomix 1.19.0 | 386 | 4,245,226 | 1,067,915 | 139.7% | n/a |
110
+ | gitingest | ? | 3,848,714 | n/a | n/a | n/a |
111
111
 
112
112
  Read that honestly:
113
113
 
114
- - **repomix reports fewer tokens for a similar pack** (854k against our 1.03M, 83%). The cause is
115
- the estimator, not the content: our manifest counts word runs, punctuation and newlines (the
116
- budget planner uses bytes/4), while repomix uses a tokenizer.
117
- Our number is conservative, which is the right direction for a budget — a plan that fits
118
- 1,027,911 tokens fits a tokenizer count of 854,178 far more often than the reverse.
119
- - **Our pack is smaller in bytes** (3.20 MB of file content against repomix's 3.39 MB of output,
120
- which includes its own wrappers), and the file sets differ slightly: 330 against 329.
114
+ - **The comparison is not a purity test.** repomix packed 386 files and 4.25 MB; our full run packed
115
+ 221 files and 2.55 MB. The file sets differ because the ignore rules differ, so the token totals
116
+ describe two different packs.
117
+ - **Each tool counts tokens its own way.** Our manifest counts word runs, punctuation and newlines
118
+ (the budget planner uses bytes/4); repomix uses a tokenizer. Neither is the model's exact count;
119
+ read the share, not the absolute number.
120
+ - **Our pack is smaller in bytes** (2.55 MB of file content against repomix's 4.25 MB of output,
121
+ which includes its own wrappers), and gitingest's digest is larger still at 3.85 MB.
121
122
  - **The modes are what the other tool does not have.** repomix packs the repository; a slice and a
122
- budget are the same snapshot narrowed after scanning, at 6.5% and 3.5% of the tokens.
123
- - **gitingest's digest is smaller in bytes** (3.12 MB against our 3.30 MB of file content), and it
124
- publishes no token count at all; the harness reports its digest size and says so. Its output is
125
- one flat document with a tree and a separator per file, which is why a byte comparison is the
126
- only honest one.
123
+ budget are the same snapshot narrowed after scanning, at 8.4% and 4.7% of our full tokens.
124
+ - **gitingest publishes no token count at all.** The harness reports its digest size and says so.
125
+ Its output is one flat document with a tree and a separator per file, which is why a byte
126
+ comparison is the only honest one.
127
127
 
128
128
  The same caveats apply to any comparison: different ignore rules, different wrappers, different
129
129
  tokenizers. What is comparable is the shape — full packs are too large for a context window, and a
package/docs/brief.md CHANGED
@@ -1,109 +1,108 @@
1
- # The brief: the half only you can write
1
+ # Briefs
2
2
 
3
- `PROMPT.md` is generated, and part of it cannot be. The manifest can prove which files are here,
4
- which were skipped and why, what the system map is and what the standard requires. It cannot know
5
- what the software is *for*, what has already gone wrong, or which failures this team would
6
- recognise. That is judgement, so it is supplied as a file and merged into the brief.
3
+ `codebase-snapshot brief` packs one reviewer-ready Markdown document: a question or a change, the
4
+ impact it reaches, the candidate tests, and bounded redacted source windows. It is the formatting
5
+ layer over `impact` and `context`; it does not invent a second graph.
7
6
 
8
- ```bash
9
- # init writes BRIEF.md next to the config, with the five headings and guidance in comments
10
- npx codebase-snapshot init --yes
7
+ ## Run it
11
8
 
12
- # then enable it with one edit, or name your own file on the command line
13
- npx codebase-snapshot generate --brief docs/brief.md
9
+ ```bash
10
+ codebase-snapshot brief "how does authentication work?"
11
+ codebase-snapshot brief --diff origin/main
12
+ codebase-snapshot brief --paths src/router.ts --out notes/review.md
13
+ codebase-snapshot brief --diff HEAD --copy
14
+ codebase-snapshot brief --diff HEAD --format json
14
15
  ```
15
16
 
16
- ```js
17
- // snapshot.config.mjs
18
- export default {
19
- brief: "BRIEF.md", // relative to the project root; a missing file is an error
20
- promptTask: "audit", // audit | review | explain
21
- };
22
- ```
17
+ With neither a question nor `--diff`/`--paths`, the change is the working tree against `HEAD`.
18
+ The brief uses the live index by default and writes nothing into the repository; `--no-live`
19
+ requires the persisted snapshot.
23
20
 
24
- ## The five headings
21
+ ## What it contains
25
22
 
26
- | Heading | What happens |
27
- | :--- | :--- |
28
- | `## Stakes` | rendered as its own section, right after the job |
29
- | `## The system` | replaces the generated narrative; the measured facts still follow under "What the index records" |
30
- | `## What came before` | rendered above the generated commit ledger |
31
- | `## The bar` | replaces the standard |
32
- | `## Calibration` | replaces the example failures |
23
+ 1. A trust stamp: index source, freshness, coverage, redaction count, omitted count, and any named
24
+ partial reason.
25
+ 2. The question or impact summary.
26
+ 3. For a change: changed files, symbol-pruned affected files, routes, candidate tests and warnings.
27
+ 4. For a diff: the diff hunks, passed through the same span-masking redaction as every other artifact.
28
+ No raw credential excerpt is copied into the brief.
29
+ 5. Bounded source windows for the files that matter, until `--max-tokens` is reached.
30
+ 6. A named list of files that did not fit or are unavailable. Nothing is dropped silently.
33
31
 
34
- Any other `##` heading is kept, verbatim, under **Owner notes**. Nothing is dropped because the
35
- merge did not recognise it — a brief is your text, and silently discarding a section is the one
36
- thing this tool does not do.
32
+ `--format pr-comment` renders the affected-file list and details as a collapsible GitHub comment.
33
+ `--out` writes inside the repository only; a path that escapes through `..` or a link is refused.
34
+ `--copy` uses the platform clipboard command (`clip`, `pbcopy`, `wl-copy` or `xclip`) with
35
+ `shell: false`.
37
36
 
38
- Every owner section is marked in `PROMPT.md` as written by the project owner, so a reader can tell
39
- an assertion from a measurement.
37
+ ## Options
40
38
 
41
- ## A worked example
39
+ | Option | Meaning |
40
+ | :-- | :-- |
41
+ | `--diff <ref>` | Compare the working tree with a git ref. |
42
+ | `--paths <a,b>` | Treat repository-relative paths as the change. |
43
+ | `--max-tokens <n>` | Token budget for the assembled brief (default 12000, minimum 500). |
44
+ | `--lines-per-file <n>` | Line window per file (default 80). |
45
+ | `--include-tests` | Include candidate tests, not only production impact. |
46
+ | `--copy` | Copy the finished brief to the clipboard. |
47
+ | `--out <path>` | Write the brief to a repository-relative path. |
48
+ | `--format json` | Return `{ markdown, usedTokens, files, omitted, trust }` and keep stdout parseable. |
49
+ | `--format pr-comment` | Render collapsible PR-comment sections. |
50
+ | `--no-cache` | Bypass the OS live-index summary cache. |
51
+ | `--no-live` | Require the generated snapshot. |
42
52
 
43
- ```markdown
44
- <!-- BRIEF.md: fill in what you know; an empty section is simply not rendered -->
53
+ ## When a brief is the right tool
45
54
 
46
- ## Stakes
55
+ - **A pull request needs one review artefact.** The brief puts the change, its affected files, the
56
+ candidate tests and bounded source windows in one Markdown document a reviewer can paste into a
57
+ comment or a model.
58
+ - **The reviewer is not the author.** A trust stamp and an explicit omission list let someone who
59
+ did not write the code judge whether the context is complete.
60
+ - **You need a redacted diff.** The diff is masked with the same span rules as every other artifact;
61
+ a credential in the hunk does not reach the brief.
47
62
 
48
- Runs live production for one owner. A wrong cleanup deletes their data, and the backup is taken by
49
- the same process it is protecting.
63
+ Use a snapshot instead when the task is "explain this repository"; use impact when the task is
64
+ "tell me what this change reaches" and you do not need prose.
50
65
 
51
- ## What came before
66
+ ## What a review looks like
52
67
 
53
- Four rounds, 23 defects. The recurring shapes: a guard at the route but not the timer, and an `ok`
54
- flag that means only that the call returned.
68
+ codebase-snapshot brief --diff origin/main --format pr-comment
55
69
 
56
- ## Calibration
70
+ ```text
71
+ # Change brief
57
72
 
58
- - a grant signed for one recipe executing another recipe's deletions
59
- - a recipe that never worked, because its test supplied a number where the daemon sends a string
60
- ```
73
+ Trust: source=live-overlay · freshness=live-computed · coverage=complete · redacted=0 · omitted=0
61
74
 
62
- ## What is refused, and why
75
+ **Changed:** 3 · **Affected:** 7 · **Tests:** 2
63
76
 
64
- Three things are errors rather than overrides, because each would make the document lie:
77
+ <details><summary>Affected files</summary>
78
+ ...
79
+ </details>
65
80
 
66
- - **a measured heading.** `Coverage`, `This snapshot`, `Attaching this`, `The job`, `What you have`
67
- and the rest are rendered from the manifest. Redefining one would let prose overwrite a
68
- measurement.
69
- - **a file that cannot be read.** A snapshot must not quietly ship without the half you wrote.
70
- - **an edited brief after generating.** Its digest is recorded, so `validate` reports
71
- `brief: docs/brief.md changed since this snapshot was generated`.
72
-
73
- A brief must also stay inside the repository and must not be a credential-bearing file; a path
74
- that escapes the repository is refused, because an untrusted `snapshot.config.json` must not turn
75
- the brief into a host-file read. Its prose is redacted with the full content scanner, so a PEM
76
- private key pasted into the text is masked as a block.
77
-
78
- Two smaller ones: a heading defined twice is ambiguous and refused, and a file over 64 KiB is
79
- refused with its size — past that it is a second codebase rather than instruction.
81
+ ### `src/auth/session.ts` — changed
82
+ ...
83
+ ```
80
84
 
81
- ## How the file is parsed
85
+ The exact headings depend on the format. In every format the same three facts are present: what
86
+ changed, what the tool believes it reaches, and what it could not include.
82
87
 
83
- | Input | Result |
84
- | :--- | :--- |
85
- | `## stakes`, `## STAKES` | the stakes section; headings match case-insensitively |
86
- | `## Stakes:` | the stakes section; a trailing colon is a typo, not a different heading |
87
- | `<!-- ... -->` | removed before parsing — the `init` scaffold is all comments and renders nothing |
88
- | a section with no text | not rendered at all |
89
- | a fenced block containing `## Coverage` | content, not a heading |
90
- | CRLF, or a UTF-8 byte-order mark | read like the plain case |
91
- | a control character | escaped, as everywhere else this tool reproduces text |
88
+ ## What it does not do
92
89
 
93
- ## The job changes, the standard does not
90
+ - It does not run the tests it names; it selects candidates.
91
+ - It does not prove runtime reachability; the impact report is a static, conservative analysis.
92
+ - It does not silently fill a budget with unrelated files. A file that does not fit is named in the
93
+ omission list.
94
+ - It does not edit the repository unless --out names a path; that write is confined to the repository.
94
95
 
95
- `promptTask` changes only the opening section:
96
+ ## Why it exists
96
97
 
97
- - `audit` (the default) — find what is still wrong or will break;
98
- - `review` — say what a change breaks, and what it claims but does not do;
99
- - `explain` — explain how a subsystem works, and cite the lines.
98
+ A review starts with a diff, but the diff is not the change: the call sites, the route and the test
99
+ that will fail are elsewhere. The brief puts those on one page, marks what is evidence and what is a
100
+ candidate, and stamps the trust envelope so a reader can tell a complete answer from a partial one.
100
101
 
101
- The standard, the coverage duty and the answer shape are the same in all three. An unknown value
102
- is a usage error, never a silent fall back to the default.
102
+ → [Impact reports](impact.md) · [CLI reference](cli.md) · [MCP tools](tools.md)
103
103
 
104
- ## Relationship to the rest of the snapshot
104
+ ## Related
105
105
 
106
- `brief` is instruction, not payload: changing it does not change the files that are copied, but it
107
- does change the config digest, so a stale brief is flagged exactly like a stale snapshot. The
108
- writer’s prose is masked like every other reproduced string, and the brief file itself is an
109
- ordinary file in the repository — it may be snapshotted, or excluded with `excludePatterns`.
106
+ - [Impact reports](impact.md) — the analysis a brief is built from.
107
+ - [MCP server for a codebase](mcp-server-for-codebase.md) — the same tools over MCP.
108
+ - [LLM codebase context](llm-codebase-context.md) — the broader guide.
package/docs/cli.md CHANGED
@@ -57,7 +57,12 @@ as it makes it.
57
57
  - [Commands](#commands)
58
58
  - [`generate`](#generate)
59
59
  - [`validate` / `check`](#validate--check)
60
+ - [`serve`](#serve)
61
+ - [`health`](#health)
60
62
  - [`report`](#report)
63
+ - [`impact`](#impact)
64
+ - [`guard`](#guard)
65
+ - [`brief`](#brief)
61
66
  - [`setup`](#setup)
62
67
  - [`init`](#init)
63
68
  - [`explain <path>`](#explain-path)
@@ -65,6 +70,7 @@ as it makes it.
65
70
  - [`describe`](#describe)
66
71
  - [`update`](#update)
67
72
  - [`skill`](#skill)
73
+ - [`mcp`](#mcp)
68
74
  - [Options](#options)
69
75
  - [Exit codes](#exit-codes)
70
76
  - [Output streams](#output-streams)
@@ -98,7 +104,7 @@ Exit `0` when the snapshot passes its own integrity check, `1` when it does not.
98
104
 
99
105
  ```
100
106
  📸 Generating snapshot for: /path/to/repo
101
- Branch: main (fallback) | Part budget: 300 KB | Generator: 0.20.13 (project dependency ^0.20.13)
107
+ Branch: main (fallback) | Part budget: 300 KB | Generator: 0.22.0 (project dependency ^0.22.0)
102
108
 
103
109
  ✅ Snapshot generated in 0.14s:
104
110
  - Tracked files: 121 included of 128 paths found — 7 skipped (default-ignore 5, binary 1, sensitive-file 1); every one is listed in snapshot/reports/audit.md
@@ -199,6 +205,78 @@ It takes `--cwd`, `--out-dir`, `--no-config`, `--format` and `--no-update-check`
199
205
  generation settings are rejected, not ignored: `report --max-part-bytes 120k` exits `2` with a
200
206
  message naming the commands that do accept it.
201
207
 
208
+ ### `impact`
209
+
210
+ ```bash
211
+ codebase-snapshot impact --diff main
212
+ codebase-snapshot impact --paths src/lib/jwt.ts,src/routes/login.ts --format json
213
+ ```
214
+
215
+ Builds a live index from `manifest.json` when one is current, overlays changed and new files in
216
+ memory when the working tree has moved, or scans the confined working tree when no snapshot exists.
217
+ It resolves the change through the same import resolver the generator used and reports the
218
+ reverse-import closure (what imports the changed files, then what imports those) plus the tests that
219
+ directly import a changed or affected file. Test files are kept out of `affected[]` and listed in
220
+ `tests[]`, so the production blast radius is not inflated by every test that imports a barrel. It
221
+ never writes into the repository.
222
+
223
+ Use exactly one source for the change:
224
+
225
+ - `--diff <ref>` compares the working tree with that git ref, including staged, unstaged and
226
+ untracked changes. A ref beginning with `-` is refused.
227
+ - `--paths <a,b>` treats the named repository-relative paths as the change. Absolute paths and
228
+ `..` segments are refused.
229
+
230
+ The report separates what it knows: `changed[]` says whether each path is in the snapshot,
231
+ `affected[]` carries the distance and the exact import specifier for every hop, `tests[]` lists
232
+ candidate tests (never coverage), `unresolved[]` names repository-internal imports that did not
233
+ resolve (bare packages and Node built-ins are not counted), and
234
+ `warnings[]` says when the snapshot is dirty or the result was truncated. `--depth` (default 3,
235
+ max 8) bounds the reverse walk; `--max-results` (default 200, max 1000) bounds `affected[]`.
236
+
237
+ Exit `0` when the report was produced, `1` when the live index cannot be built or an existing
238
+ manifest is unreadable, and `2` for a usage error. `--format json` writes the stable report object to stdout; text mode writes the
239
+ human report to stderr, like every other human-facing command.
240
+
241
+ → [Impact reports](impact.md): the field contract, resolution rules and what the report does not claim.
242
+
243
+ ### `guard`
244
+
245
+ ~~~bash
246
+ codebase-snapshot guard --changed
247
+ codebase-snapshot guard --paths src/auth.ts --format json
248
+ codebase-snapshot guard --hook claude < payload.json
249
+ ~~~
250
+
251
+ Checks whether a change is complete: untouched consumers, candidate tests and affected routes,
252
+ minus everything the change already touched. It uses the same live index and import resolver as
253
+ `impact`, so no `generate` run is required. The report is bounded to 10 consumers, 5 tests and
254
+ 5 routes; when it is cut, `truncated` is true and `omitted` records the counts.
255
+
256
+ `--hook <claude|copilot|codex|raw>` reads one JSON payload from stdin and writes the host-shaped
257
+ `additionalContext` to stdout, or `{}` when there is nothing to report. It is fail-open: an error
258
+ returns `{}` and a note on stderr, so a broken guard cannot fail an agent turn.
259
+
260
+ Exit `0` when the check ran (including a clean report and a hook returning `{}`), `1` when the
261
+ live index cannot be built or `--no-live` has no manifest, and `2` for a usage error.
262
+
263
+ → [Change Guard](guard.md): hook setup for Claude Code, Copilot and Codex, and what it does not claim.
264
+
265
+ ### `brief`
266
+
267
+ ```bash
268
+ codebase-snapshot brief "how does authentication work?"
269
+ codebase-snapshot brief --diff main --copy
270
+ codebase-snapshot brief --paths src/router.ts --out notes/review.md --format pr-comment
271
+ ```
272
+
273
+ Pack one redacted, bounded Markdown brief for a reviewer or a model. With a question it uses the
274
+ planner; with `--diff` or `--paths` it uses the impact report. The diff hunks pass through the
275
+ same redaction as every artifact, the trust envelope is stamped at the top, and every file that did
276
+ not fit is named rather than dropped. `--copy` copies the result, `--out` writes it inside the
277
+ repository, and `--format json` returns `{ markdown, usedTokens, files, omitted }` without
278
+ printing the Markdown first.
279
+
202
280
  ### `setup`
203
281
 
204
282
  ```bash
@@ -224,7 +302,7 @@ The whole first run in one command, with defaults and no prompts. This is the sa
224
302
  🚀 Setup for: /path/to/repo
225
303
  ✅ Created snapshot.config.json (preset: nextjs)
226
304
  Added npm scripts: snapshot, snapshot:validate
227
- Added devDependency: codebase-snapshot ^0.20.13
305
+ Added devDependency: codebase-snapshot ^0.22.0
228
306
  Added to .gitignore: /snapshot/, /snapshot.tmp/
229
307
  ⏳ Installing dependencies…
230
308
  ✅ Installed dependencies (npm install, 2.1s)
@@ -276,7 +354,7 @@ It also has three side effects on files you own, and it says so when it does the
276
354
  ```
277
355
  ✅ Created snapshot.config.json (preset: node-lib)
278
356
  Added npm scripts: snapshot, snapshot:validate
279
- Added devDependency: codebase-snapshot ^0.20.13
357
+ Added devDependency: codebase-snapshot ^0.22.0
280
358
  Added to .gitignore: /snapshot/, /snapshot.tmp/
281
359
  ```
282
360
 
@@ -426,12 +504,12 @@ agent](agent.md).
426
504
  Ask the npm registry whether a newer release exists, and print the version it compared against:
427
505
 
428
506
  ```bash
429
- npx codebase-snapshot@0.20.12 update # is this build current? print the answer
430
- npx codebase-snapshot@0.20.12 update --format json
507
+ npx codebase-snapshot@0.22.0 update # is this build current? print the answer
508
+ npx codebase-snapshot@0.22.0 update --format json
431
509
  ```
432
510
 
433
511
  ```text
434
- You are on codebase-snapshot 0.20.12, and the registry publishes 0.20.12. No update is available.
512
+ You are on codebase-snapshot 0.20.13, and the registry publishes 0.20.13. No update is available.
435
513
  ```
436
514
 
437
515
  Exit `0` when the installed version is current, `1` when a newer release exists, `2` when the
@@ -447,14 +525,17 @@ finds a release, an hour when it finds none, and five minutes after a failed req
447
525
 
448
526
  ```bash
449
527
  codebase-snapshot skill # print on stdout
450
- codebase-snapshot skill --install # write both registries
528
+ codebase-snapshot skill --install # write all three registries
451
529
  codebase-snapshot skill --install --target claude
530
+ codebase-snapshot skill --install --with-mcp
452
531
  ```
453
532
 
454
533
  Prints or installs the bundled agent skill. Installation writes
455
- `.claude/skills/codebase-snapshot/SKILL.md` and `.cursor/rules/codebase-snapshot.mdc`;
456
- `--target claude` or `--target cursor` limits it to one. Both are **registries keyed by
457
- skill name**, so the file cannot be mistaken for your own documentation.
534
+ `.agents/skills/codebase-snapshot/SKILL.md`, `.claude/skills/codebase-snapshot/SKILL.md` and
535
+ `.cursor/rules/codebase-snapshot.mdc`; `--target` limits it to one registry. All three are
536
+ **registries keyed by skill name**, so the file cannot be mistaken for your own documentation.
537
+ `--with-mcp` merges one `codebase-snapshot` entry into `.mcp.json` without removing other servers
538
+ and keeps an existing different entry, with a note.
458
539
 
459
540
  It does not write `AGENTS.md`. That file is your project's agent contract — build commands,
460
541
  conventions, house rules — and a tool has no business editing it. If you want the skill
@@ -478,8 +559,8 @@ codebase-snapshot mcp # serve the current directory over stdio
478
559
  codebase-snapshot mcp --cwd <path> # serve another repository
479
560
  ```
480
561
 
481
- Serves the repository to a Model Context Protocol client over stdio: 26 tools, `snapshot://`
482
- resources and seven prompts. Stdout carries JSON-RPC messages and nothing else; every note goes to
562
+ Serves the repository to a Model Context Protocol client over stdio: 7 tools, `snapshot://`
563
+ resources and seven prompts, with live reads by default. Stdout carries JSON-RPC messages and nothing else; every note goes to
483
564
  stderr. It speaks both protocol eras — the legacy `initialize` handshake and the stateless
484
565
  `2026-07-28` revision — and answers whichever the client starts with. With `--http`, modern
485
566
  requests carry `MCP-Protocol-Version`, `Mcp-Method` and (for named calls) `Mcp-Name`;
@@ -500,8 +581,8 @@ for the two install flags, and the init-and-setup flags list both commands.
500
581
 
501
582
  | Option | Type | Default | Applies to | Meaning |
502
583
  | :--- | :--- | :--- | :--- | :--- |
503
- | `--cwd <path>` | path | current directory | generate, validate, report, explain, init, setup, skill, mcp | Repository to operate on. Must exist and be a directory. `diff` and `describe` take no `--cwd`; for `mcp` it chooses the one repository the server serves. |
504
- | `--out-dir <path>` | path | `snapshot` | generate, validate, report, explain, init, setup | Where the snapshot is written or read. May be absolute. |
584
+ | `--cwd <path>` | path | current directory | generate, validate, report, impact, guard, brief, explain, init, setup, skill, mcp, health, serve | Repository to operate on. Must exist and be a directory. `diff` and `describe` take no `--cwd`; for `mcp` it chooses the one repository the server serves. |
585
+ | `--out-dir <path>` | path | `snapshot` | generate, validate, report, impact, guard, brief, explain, init, setup, health | Where the snapshot is written or read. May be absolute. |
505
586
  | `--max-part-bytes <n>` | size | `307200` (300 KB) | generate, validate, init, setup | Hard ceiling per markdown part. Accepts `120k`, `1.5mb`. Minimum 4096. |
506
587
  | `--max-part-tokens <n>` | size | unset | generate, validate, setup | A per-part ceiling in **tokens**, for a context window rather than a disk. Narrows `--max-part-bytes` to the equivalent byte count (`tokens × 4`); the smaller of the two ceilings always wins, and both are recorded in the manifest. Accepts `32k`. Minimum 1024 — below that it is a usage error, not a value quietly raised to the floor. The byte ceiling is what is enforced: `estimatedTokens` is an estimate, and a part whose estimate exceeds the token ceiling is named in a warning rather than silently accepted. |
507
588
  | `--large-file-bytes <n>` | size | the part budget (307200) | generate, validate, explain, setup | Above this, a file becomes a head/tail preview. It may not exceed `--max-part-bytes`: a file between the two could not fit a part. |
@@ -509,7 +590,7 @@ for the two install flags, and the init-and-setup flags list both commands.
509
590
  | `--brief <path>` | path | unset | generate, validate | The owner-written half of `PROMPT.md`: `Stakes`, `The system`, `What came before`, `The bar`, `Calibration`. Unknown headings are kept as Owner notes; measured headings cannot be redefined; the file is digested, so editing it is drift. |
510
591
  | `--remote <url>` | url | unset | generate | Fetch a repository instead of scanning the current directory. https only, public addresses only, shallow clone; the manifest records the URL and the commit. See [remote](remote.md). |
511
592
  | `--ref <branch>` | string | unset | generate | With `--remote`: the branch or tag to clone. |
512
- | `--allow-private` | flag | off | generate | With `--remote`: allow private addresses and `file:` URLs. Refused by default. |
593
+ | `--allow-private` | flag | off | generate, serve | With `--remote`: allow private addresses and `file:` URLs. Refused by default. |
513
594
  | `--keep-clone` | flag | off | generate | With `--remote`: keep the temporary clone and print where it is. |
514
595
  | `--http` | flag | off | mcp | Serve MCP over HTTP (Streamable HTTP: POST a JSON-RPC message to `/mcp`) instead of stdio. Loopback by default; a bearer token is generated and printed unless `--token` or `--no-auth` is given. Health endpoint: `GET /healthz`. |
515
596
  | `--port <n>` | string | `4789` | mcp, serve | `mcp --http`: port to bind. `0` picks an ephemeral port and prints it. |
@@ -520,7 +601,7 @@ for the two install flags, and the init-and-setup flags list both commands.
520
601
  | `--all-members` | flag | off | health | Audit every snapshot a `--workspace` run wrote, not only the one at `outDir`. The combined score is the weakest member. |
521
602
  | `--deep` | flag | off | health | Replay every full body from the source bytes on disk and compare it with the part. The only allowed difference is a redaction marker. Off by default because it re-reads the repository. |
522
603
  | `--strict` | flag | off | health | `health` only: exit 2 when a critical check fails, and 1 when a warning is the only thing left. Without it a critical check exits 1 and warnings exit 0. |
523
- | `--mode <command>` | string | unset | generate, validate, report, explain, init, setup, diff, describe, skill | Select the command when no command word is given. A command word and `--mode` must name the same command; a contradiction is a usage error (exit 2). |
604
+ | `--mode <command>` | string | unset | generate, validate, report, impact, guard, brief, explain, init, setup, diff, describe, skill, mcp, health, update, serve | Select the command when no command word is given. A command word and `--mode` must name the same command; a contradiction is a usage error (exit 2). |
524
605
  | `--no-update-check` | flag | off | all commands except `update` | Skip the check for a newer published version. Already skipped when stdout is not a terminal, in CI, in a JSON invocation, and in `mcp`, which makes no network requests. `update` exists to contact the registry, so it has no check to skip. |
525
606
  | `--prompt-task <task>` | string | `audit` | generate, validate | `audit`, `review` or `explain` — which job the brief is written for. Changes the opening section, not the standard. |
526
607
  | `--budget-tokens <n>` | count | unset | generate | Fit the snapshot into n tokens by selecting whole files (entry points, then the most-imported). Records a `budget` block; the rest are `not-selected`. See [budget](budget.md). |
@@ -534,19 +615,39 @@ for the two install flags, and the init-and-setup flags list both commands.
534
615
  | `--slice <question>` | string | unset | generate | Narrow the snapshot to what the retrieval planner picks for this question. Records a `slice` block and `skipped[]` reasons `not-selected`. See [slices](slice.md). |
535
616
  | `--slice-tokens <n>` | count | `30000` | generate | The token budget for `--slice`. |
536
617
  | `--delta <path>` | path | unset | generate | Narrow the snapshot to what changed since a base snapshot, plus the one-hop importers. Unchanged files are recorded in `delta.unchanged` and `skipped[]`. See [delta](delta.md). |
537
- | `--include-diffs` | flag | off | generate | Also write `reports/diff.md`: the unstaged and staged diff, with the commands, bounded to 200 KiB. Absent when the tree is clean; outside a git repository the run warns and writes nothing. |
538
- | `--include-logs <n>` | count | unset | generate | Also write `reports/log.md`: the last n commits (1–500), one line each; outside a git repository the run warns and writes nothing. |
539
- | `--token-tree` | flag | off | generate | Also write `reports/tokens.md`: per-file token estimates sorted by cost, with directory rollups. |
618
+ | `--include-diffs` | flag | off | generate, validate | Also write `reports/diff.md`: the unstaged and staged diff, with the commands, bounded to 200 KiB. Absent when the tree is clean; outside a git repository the run warns and writes nothing. |
619
+ | `--include-logs <n>` | count | unset | generate, validate | Also write `reports/log.md`: the last n commits (1–500), one line each; outside a git repository the run warns and writes nothing. |
620
+ | `--token-tree` | flag | off | generate, validate | Also write `reports/tokens.md`: per-file token estimates sorted by cost, with directory rollups. |
540
621
  | `--max-parts <n>` | count | unset | generate, validate | **Experimental.** Grow the per-part budget until the snapshot has at most `n` parts, so the file count stays fixed as the code grows. The budget it settles on is recorded in `manifest.budgets.maxPartBytes` and may exceed `--max-part-bytes`; a warning says so. `0` is a usage error. |
541
622
  | `--attachment-slots <n>` | count | `10` | generate | Files the destination accepts in one message; `0` means no limit. `PROMPT.md` plans the delivery against it — which parts to attach, what to leave behind, and the `--max-part-bytes` value that would merge them. It changes no part and no file, so it is recorded in the manifest but is not part of the config digest. |
542
623
  | `--include-monolith` | flag | off | generate, validate, setup | Also write `full-codebase.json` and `full-codebase.md`. |
543
624
  | `--include-sensitive-files` | flag | off | generate, validate, explain, init, setup | Emit `.env`, `*.pem`, `.npmrc` and similar. Off by default; they are reported as skipped. |
544
625
  | `--skip-artifacts <names>` | list | unset | generate, validate, init, setup | Comma-separated artifacts to omit. |
545
626
  | `--only-artifacts <names>` | list | unset | generate, validate, init, setup | Write *only* these, and **turn on** any this names: a config with `artifacts: { audit: false }` still gets `reports/audit.md` from `--only-artifacts audit`, because "only these" is a statement about the whole selection rather than a suppression list. Cannot be combined with `--skip-artifacts`. |
546
- | `--format <text\|json>` | enum | `text` | generate, validate, report, explain, init, setup, diff, describe, skill | `json` writes a pure JSON payload to stdout. Every command except `mcp` honours it — stdout there is the JSON-RPC protocol stream — and `describe` reports the same nine-command list. |
627
+ | `--format <text\|json\|markdown\|pr-comment>` | enum | `text` | generate, validate, report, impact, guard, brief, explain, init, setup, diff, describe, skill, health, update | `json` writes a pure JSON payload to stdout. `impact` and `brief` also accept `markdown`; `pr-comment` renders the same brief with collapsible sections. Every command except `mcp` and `serve` honours `--format` — stdout there is the JSON-RPC protocol stream. |
547
628
  | `--sarif` | flag | off | generate, validate, setup | Also write `reports/audit.sarif`: the redaction findings as SARIF 2.1.0, for upload to GitHub Code Scanning. The artefact carries the path, the line and the rule — never the value. Works with `--skip-artifacts audit`, because a CI gate does not read markdown. Rule ids are fixed per rule name, so adding a custom rule never re-points an existing alert. |
548
629
  | `--skeleton` | flag | off | generate, validate, setup | Emit signatures instead of bodies: each function or method body becomes `{ /* ... */ }` in place, so formatting and comments around it are untouched. Covers `.ts`, `.tsx`, `.mts`, `.cts`, `.js`, `.jsx`, `.mjs` and `.cjs`; `.d.ts` files are left alone because they are already declarations. The summary still describes the whole file, and affected entries carry `inclusionMode: "signatures"`. `--include-monolith` still writes the whole body, so the monolith's `inclusionMode: "full"` stays true. |
549
630
  | `--changed-since <ref>` | git ref | unset | generate, validate, explain | Include only files changed since this ref, plus untracked ones. Every other file is recorded in `manifest.skipped[]` with reason `unchanged` and is never opened. `validate` re-resolves the scope: a skipped file that has changed since is reported as drift, and one that has not is left alone — and with `--with-dependents`, so is a file that now imports one that changed. `explain` answers with the same rule. A ref beginning with `-` is refused. |
631
+ | `--diff <ref>` | git ref | unset | impact, guard, brief | Compare the working tree against this ref for the impact report or change brief. Includes committed, staged, unstaged and untracked changes relative to it. Mutually exclusive with `--paths`; a ref beginning with `-` is refused. |
632
+ | `--paths <a,b>` | list | unset | impact, guard, brief | Comma-separated repository-relative paths to treat as the change. Absolute paths and `..` segments are refused. Mutually exclusive with `--diff`. |
633
+ | `--depth <n>` | count | `3` | impact, guard, brief | Reverse-import hops to follow for the impact report or change brief. Minimum 1, maximum 8. |
634
+ | `--max-results <n>` | count | `200` | impact, guard, brief | Maximum files in `affected[]`. Minimum 1, maximum 1000; a hit sets `truncated` and adds a warning. |
635
+ | `--no-cache` | flag | off | impact, guard, brief | Bypass the optional OS live-index summary cache. No cache file is written, and nothing is ever written inside the repository. |
636
+ | `--no-live` | flag | off | impact, guard, brief | Require the generated snapshot instead of building or overlaying the live index. |
637
+ | `--tests-paths` | flag | off | impact | Print candidate test paths, one per line, instead of the report. |
638
+ | `--run` | flag | off | impact | Run the repository's own Vitest, Jest or `node --test` entry against the candidate tests. Uses `shell: false`; a build or test configuration change adds a full-suite warning. |
639
+ | `--precise` | flag | off | impact | Add compiler-resolved symbol references to the report. Requires the live index. |
640
+ | `--include-imports` | flag | off | impact | Add outgoing dependencies of every changed file. |
641
+ | `--include-cycles` | flag | off | impact | Add import cycles in the impacted subgraph. |
642
+ | `--hook <client>` | enum | unset | guard | Read one hook payload from stdin and shape the response for `claude`, `copilot`, `codex` or `raw`. Fail-open: an error returns `{}` and a stderr note. |
643
+ | `--changed` | flag | off | guard | Check the working tree against `HEAD`. This is the default when `--hook` is not given. |
644
+ | `--max-chars <n>` | count | `1200` | guard | Cap the model-facing hook text. Minimum 200, maximum 10000. |
645
+ | `--copy` | flag | off | brief | Copy the finished brief to the platform clipboard. |
646
+ | `--out <path>` | path | unset | brief | Write the brief to this repository-relative path. A path that resolves outside the repository is refused. |
647
+ | `--max-tokens <n>` | count | `12000` | brief | Token budget for the assembled brief. |
648
+ | `--lines-per-file <n>` | count | `80` | brief | Line window per file in the brief. |
649
+ | `--include-tests` | flag | off | brief | Include candidate test files. |
650
+ | `--with-mcp` | flag | off | skill | With `skill --install`, merge a `codebase-snapshot` server entry into `.mcp.json` without clobbering other servers. |
550
651
  | `--staged` | flag | off | generate, validate, explain | Include only files staged for the next commit. The bytes are read from the **index**, not the working tree, so a file with staged changes plus later unstaged edits is snapshotted at what `git commit` will write; a staged deletion is recorded in `manifest.skipped[]` with reason `deleted`. |
551
652
  | `--with-dependents` | flag | off | generate, validate, explain | With either of the two above, also include the files that import a changed one — a one-hop closure, not a transitive walk. Needs a scope; alone it is a usage error. |
552
653
  | `--install-hook` | flag | off | init, setup | Write `.git/hooks/pre-commit` so a commit is refused while the snapshot is out of date. The hook checks the `outDir` the config names, so it works for a project that does not use `snapshot/`. An existing hook is never replaced; the note says what to add to it instead. |
@@ -554,7 +655,7 @@ for the two install flags, and the init-and-setup flags list both commands.
554
655
  | `--watch` | flag | off | generate | Regenerate on every change until interrupted. Redaction and parsing are cached per file across runs in the same process, keyed on the content hash, so a one-file edit regenerates from that one file instead of from the whole repository. The cache is memory only and is dropped when the process exits. |
555
656
  | `--autopilot` | flag | off | generate | Set the project up without asking — config, `.gitignore`, npm scripts, devDependency, install — then generate. Never overwrites an existing config; refuses an empty directory (exit `1`); contradicts `--no-config` (exit `2`). |
556
657
  | `--no-install` | flag | off | setup, generate `--autopilot` | Skip the dependency install. Anywhere else it is a usage error, because it would change nothing. |
557
- | `--no-config` | flag | off | generate, validate, report, explain, diff, mcp | Ignore every `snapshot.config.*` file and run on the built-in defaults. `diff` never loads a config anyway and accepts the flag for consistency; `mcp` uses it when a repository config cannot be read or should not be trusted. |
658
+ | `--no-config` | flag | off | generate, validate, report, impact, brief, explain, diff, mcp | Ignore every `snapshot.config.*` file and run on the built-in defaults. `diff` never loads a config anyway and accepts the flag for consistency; `mcp` uses it when a repository config cannot be read or should not be trusted. |
558
659
  | `--discovery <mode>` | enum | `auto` | generate, validate, explain, setup | How files are found: `auto` lists through git when git works and refuses when a `.git` directory cannot be listed; `git` requires git; `walk` scans the tree and reads `.gitignore` files directly. The escape hatch for a broken `.git`. |
559
660
  | `--preset <name>` | name | detected | init, setup | Force a preset instead of detecting one. |
560
661
  | `--include <globs>` | list | unset | init, setup | Allow-list recorded in the generated config. |
@@ -562,7 +663,7 @@ for the two install flags, and the init-and-setup flags list both commands.
562
663
  | `--yes` | flag | off | init, setup | Never prompt; accept every default. |
563
664
  | `--force` | flag | off | init, setup | Replace an existing JSON-family config in place. An executable `.ts`/`.js`/`.mjs` config is refused, naming the file to remove. |
564
665
  | `--install` | flag | off | *skill only* | Write the skill into the repository instead of printing it. |
565
- | `--target <name>` | enum | `all` | *skill only* | `claude`, `cursor` or `all`. |
666
+ | `--target <name>` | enum | `all` | *skill only* | `agents`, `claude`, `cursor` or `all`. |
566
667
  | `-h`, `--help` | flag | — | every command | Print usage. |
567
668
  | `-v`, `--version` | flag | — | every command | Print the version on stdout: a bare `v`-prefixed semver (for example `v1.2.3`), with no package name. |
568
669
 
@@ -600,15 +701,15 @@ same run. With `--mode`, the remaining positionals are that command's arguments,
600
701
  `--mode explain src/server.ts` and `--mode diff old-snapshot snapshot` work the same way the
601
702
  positional form does.
602
703
 
603
- It accepts the ten commands plus the `check` alias — the eleven names the error lists — and it is
704
+ It accepts the fifteen commands plus the `check` alias — the sixteen names the error lists — and it is
604
705
  deliberately strict: asking for two different commands is an error rather than a silent winner.
605
706
 
606
707
  ```
607
708
  ❌ --mode validate contradicts the command "generate". Pass one or the other.
608
- ❌ Unknown --mode "bogus". Expected one of: generate, validate, check, report, init, setup, explain, diff, describe, skill, mcp.
709
+ ❌ Unknown --mode "bogus". Expected one of: generate, validate, check, report, impact, brief, init, setup, explain, diff, describe, skill, mcp, health, update, serve.
609
710
  ```
610
711
 
611
- `describe` does list `--mode` in its option table (`appliesTo` names the ten canonical commands),
712
+ `describe` does list `--mode` in its option table (`appliesTo` names every command that accepts it),
612
713
  but `--help` does not: the positional form is the documented one for people, and the flag exists
613
714
  for wrappers and for the contract.
614
715