codebase-snapshot 0.20.12 → 0.21.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 +44 -6
  2. package/README.md +46 -19
  3. package/SECURITY.md +2 -2
  4. package/dist/bin.js +12173 -9823
  5. package/dist/{chunk-TUKY6KLH.js → chunk-TDPYLX7X.js} +6312 -4472
  6. package/dist/cli.cjs +12074 -9744
  7. package/dist/cli.d.cts +76 -2
  8. package/dist/cli.d.ts +76 -2
  9. package/dist/cli.js +549 -14
  10. package/dist/{generate-worker-DMzNbsAW.d.cts → generate-worker-D56JeXwx.d.cts} +2 -2
  11. package/dist/{generate-worker-CRMESc0b.d.ts → generate-worker-DakxZs-l.d.ts} +2 -2
  12. package/dist/index.cjs +6292 -4466
  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 +10486 -4393
  17. package/dist/mcp.d.cts +26 -11
  18. package/dist/mcp.d.ts +26 -11
  19. package/dist/mcp.js +1 -1
  20. package/dist/{types-C5ytHMYz.d.ts → types-D5XYzksd.d.cts} +50 -2
  21. package/dist/{types-C5ytHMYz.d.cts → types-D5XYzksd.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 +103 -27
  28. package/docs/codebase-token-budget.md +14 -13
  29. package/docs/configuration.md +1 -1
  30. package/docs/contents.md +66 -0
  31. package/docs/deploy.md +2 -2
  32. package/docs/faq.md +112 -0
  33. package/docs/glossary.md +152 -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 +155 -0
  40. package/docs/mcp.md +81 -82
  41. package/docs/migration.md +83 -85
  42. package/docs/output.md +1 -3
  43. package/docs/security-review.md +20 -9
  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 +9 -2
package/docs/tools.md CHANGED
@@ -1,187 +1,161 @@
1
1
  # MCP tools
2
2
 
3
- The server exposes 26 tools. This page is the reference: what each answers, what it costs, and one
4
- call you can send as it stands. [MCP](mcp.md) covers the transports and the protocol; this page is
5
- the catalogue.
6
-
7
- Every tool is read-only unless it says **writes**. Cost is the class `tools/list` publishes as
8
- `_meta["codebase-snapshot/cost"]`: **cheap** reads the manifest, **medium** reads one or a few parts,
9
- **expensive** reads the repository or writes it.
10
-
11
- ## Orientation
12
-
13
- - **`snapshot_status`** — cheap, read-only. Is there a snapshot, when was it built, what does it
14
- cover, what is stale?
15
- ```json
16
- { "name": "snapshot_status", "arguments": {} }
17
- ```
18
- - **`snapshot_explain`** — expensive, read-only. Why is a path in or out of the snapshot? It
19
- resolves the same scan the generator would use, so a `--slice` drop is reported as
20
- `not-selected` with the run's detail.
21
- ```json
22
- { "name": "snapshot_explain", "arguments": { "path": "src/index.ts" } }
23
- ```
24
- - **`snapshot_entrypoints`** — cheap, read-only. The files a reader should start from: manifests
25
- first, then `index`/`main`/`app`/`server`/`cli`, with importer counts.
26
- ```json
27
- { "name": "snapshot_entrypoints", "arguments": {} }
28
- ```
29
- - **`snapshot_stats`** — cheap, read-only. Files by layer and kind, part sizes, token estimate,
30
- heaviest files.
31
- ```json
32
- { "name": "snapshot_stats", "arguments": {} }
33
- ```
34
- - **`snapshot_workspace`** — cheap, read-only. Members of a multi-repository workspace and the
35
- imports that cross between them, from `WORKSPACE.json`.
36
- ```json
37
- { "name": "snapshot_workspace", "arguments": {} }
38
- ```
39
-
40
- ## Finding things
41
-
42
- - **`snapshot_search`** — medium, read-only. Literal or regular-expression search over every part,
43
- with the file and part for each hit. Stops at 4 MB of text and says so.
44
- ```json
45
- { "name": "snapshot_search", "arguments": { "query": "partitionFiles", "regex": false } }
46
- ```
47
- - **`snapshot_query`** — cheap, read-only. Filter the index by layer, kind, path pattern, symbol or
48
- test status; no part is read.
49
- ```json
50
- { "name": "snapshot_query", "arguments": { "layer": "src", "symbol": "plan" } }
51
- ```
52
- - **`snapshot_locate`** — cheap, read-only. Which part holds a path or symbol, and where in it.
53
- ```json
54
- { "name": "snapshot_locate", "arguments": { "query": "src/mcp/tools.ts", "by": "path" } }
55
- ```
56
- - **`snapshot_symbol`** — medium, read-only. A symbol by name: defining file, kind, signature,
57
- and — unless `references: false` — the call sites where the name appears, with line numbers.
58
-
59
- the exports that reference it.
60
- ```json
61
- { "name": "snapshot_symbol", "arguments": { "name": "generateSnapshot" } }
62
- ```
63
- - **`snapshot_routes`**
64
- > Records the **path** with the method for framework route registration (`GET /health`). A
65
- > method-only handler (`export async function GET()` in Next.js) has no literal path to record and
66
- > is reported as the method alone. — cheap, read-only. Every route the summaries recorded, with file and part.
67
- ```json
68
- { "name": "snapshot_routes", "arguments": { "pattern": "users" } }
69
- ```
70
-
71
- ## Reading
72
-
73
- - **`snapshot_answer`** — medium, read-only. One call from question to context: plans the
74
- question, then returns each chosen file as a head window with line numbers inside the token
75
- budget. Every file says why it is there; every planned file that did not fit says why not.
76
- ```json
77
- { "name": "snapshot_answer", "arguments": { "question": "how does redaction work", "maxTokens": 20000 } }
78
- ```
79
- - **`snapshot_budget`** — medium, read-only. The planner at several budgets, with what each
80
- one adds: files, tokens used, and the paths gained over the previous budget. The answer to
81
- "should I raise the budget, and what would I get?"
82
- ```json
83
- { "name": "snapshot_budget", "arguments": { "budgets": [10000, 30000, 60000] } }
84
- ```
85
- - **`snapshot_history`** — cheap, read-only. The commits behind the snapshot, from
86
- `reports/log.md`; says how to generate the report when it is absent.
87
- ```json
88
- { "name": "snapshot_history", "arguments": { "limit": 10 } }
89
- ```
90
- - **`snapshot_tests`** — cheap, read-only. The test side of the graph: given a path, the tests
91
- that import it or are named after it; with no path, every test file and what it covers.
92
- ```json
93
- { "name": "snapshot_tests", "arguments": { "path": "src/mcp/tools.ts" } }
94
- ```
95
- - **`snapshot_read`** — medium, read-only. A bounded window of one file: line range, or the whole
96
- body when it is small.
97
- ```json
98
- { "name": "snapshot_read", "arguments": { "path": "src/index.ts", "fromLine": 1, "lines": 80 } }
99
- ```
100
- - **`snapshot_context`** — medium, read-only. Whole bodies for the files that fit a token budget, in
101
- the order the planner ranks them.
102
- ```json
103
- { "name": "snapshot_context", "arguments": { "files": ["src/mcp/retrieval.ts"], "maxTokens": 12000 } }
104
- ```
105
-
106
- ## The planner
107
-
108
- - **`snapshot_plan_for`** — cheap, read-only. The plan for a question: which files fit a budget, why
109
- each was chosen, what did not fit. Matches stems (`charge`/`chargeCard`), follows imports and
110
- callers, prefers entry points.
111
- ```json
112
- { "name": "snapshot_plan_for", "arguments": { "question": "how does a snapshot get partitioned", "maxTokens": 20000 } }
113
- ```
114
- - **`snapshot_plan`** — expensive, read-only. Would a generate succeed, and what would it include?
115
- Runs the real pipeline in a worker with nothing written.
116
- ```json
117
- { "name": "snapshot_plan", "arguments": {} }
118
- ```
119
-
120
- ## Reviewing a change
121
-
122
- - **`snapshot_review`**
123
- > Validates with the settings the manifest recorded, not with a bare config file: a snapshot
124
- > generated with `--token-tree`, `--include-diffs`, `--remove-empty-lines` or a pack is current
125
- > if the files are, and the review says so instead of telling you to regenerate. — expensive, read-only. Is the snapshot current, what does the health audit
126
- say, what do the given paths contain, and which route methods do they touch?
127
- ```json
128
- { "name": "snapshot_review", "arguments": { "paths": ["src/mcp/tools.ts"] } }
129
- ```
130
- - **`snapshot_diff_context`** — medium, read-only. A changed file's head plus the files that import
131
- it, within a token budget.
132
- ```json
133
- { "name": "snapshot_diff_context", "arguments": { "paths": ["src/mcp/tools.ts"], "maxTokens": 15000 } }
134
- ```
135
- - **`snapshot_dependents`** — cheap, read-only. What imports this path, one or more hops out.
136
- ```json
137
- { "name": "snapshot_dependents", "arguments": { "path": "src/mcp/server.ts", "direction": "imported-by", "limit": 50 } }
138
- ```
139
- - **`snapshot_neighbors`** — medium, read-only. Both directions of the import graph for one path.
140
- ```json
141
- { "name": "snapshot_neighbors", "arguments": { "path": "src/mcp/retrieval.ts" } }
142
- ```
143
- - **`snapshot_cycles`** — medium, read-only. Strongly connected components: files that import each
144
- other in a loop.
145
- ```json
146
- { "name": "snapshot_cycles", "arguments": { "maxComponents": 10 } }
147
- ```
148
-
149
- ## Health and writing
150
-
151
- - **`snapshot_health`** — expensive, read-only. The full audit: hashes, missing parts, secrets, host
152
- paths, token accounting, freshness, signature. Score out of 100, severities, failed check ids.
153
- ```json
154
- { "name": "snapshot_health", "arguments": { "maxScanBytes": 2000000 } }
155
- ```
156
- - **`snapshot_generate`** — expensive, **writes**. Builds the snapshot in a worker. Accepts
157
- `includeDiffs`, `includeLogs`, `tokenTree`, `stripComments`, and reports progress and cancellation.
158
- ```json
159
- { "name": "snapshot_generate", "arguments": { "tokenTree": true, "pack": "xml" } }
160
- ```
161
- It also takes `only` and `ignore` arrays — the CLI's per-run narrowing — which enter the config
162
- digest, so `snapshot_validate` takes the same arrays to compare like with like.
163
- It can also narrow: `slice` with `sliceTokens`, or `budgetTokens` (not both — the tool refuses
164
- the pair, as the CLI does).
165
- ```json
166
- { "name": "snapshot_generate", "arguments": { "slice": "how is auth done", "sliceTokens": 20000 } }
167
- ```
168
- - **`snapshot_validate`** — expensive, read-only. Drift check: files changed or deleted since the
169
- snapshot, part damage, bookkeeping, **and the settings the manifest recorded** — a snapshot
170
- generated with `tokenTree`, `includeDiffs`, `removeEmptyLines` or `skeleton` validates clean
171
- without re-passing the flags, while a changed config file is still drift.
172
- snapshot, part hashes, bookkeeping. A selection snapshot is not second-guessed, and says so.
173
- ```json
174
- { "name": "snapshot_validate", "arguments": {} }
175
- ```
176
-
177
- ## Conventions these tools share
178
-
179
- - Relative paths resolve against the repository the server was started for; `root` moves that for one
180
- call and is bounded by the roots the server allows.
181
- - `outDir` names a snapshot directory other than the configured one; absent means the configured
182
- one.
183
- - A tool that cannot answer says why in `text` and sets `isError`. It does not return an empty list
184
- that looks like a true negative — `snapshot_workspace` without a workspace index tells you to make
185
- one.
186
- - Structured results are returned as `structuredContent` alongside the text, so a client can read
187
- the same answer either way.
3
+ The server exposes **7 tools**. This page is the reference: what each answers, what it costs, and
4
+ a call it accepts. Every read-only tool works against the live index by default: a current
5
+ `manifest.json` is reused, changed files are overlaid in memory, and a repository with no snapshot
6
+ is scanned without writing one. Pass `"live": false` to require the persisted snapshot.
7
+
8
+ `snapshot_generate` is the only writable tool. Every structured response carries a `trust`
9
+ envelope with `indexSource`, `freshness`, `coverage`, redaction and omission counts, and named
10
+ reasons when coverage is partial.
11
+
12
+ ## The seven tools
13
+
14
+ - **`snapshot_impact`**
15
+
16
+ **Cost:** medium · **Read-only:** yes
17
+
18
+ What a change reaches: changed files, symbol-pruned transitive importers, routes, candidate tests,
19
+ unresolved internal imports, optional outgoing imports and import cycles. Barrel re-exports are
20
+ parsed; a consumer of a different symbol is not reported. Test files stay out of `affected[]` and
21
+ appear in `tests[]`.
22
+
23
+ ```json
24
+ {
25
+ "name": "snapshot_impact",
26
+ "arguments": {
27
+ "paths": ["src/impact.ts"],
28
+ "includeCycles": true,
29
+ "includeSnippets": true
30
+ }
31
+ }
32
+ ```
33
+
34
+ Omit `paths` and `base` to compare the working tree with `HEAD`. `symbols` seeds explicit
35
+ symbols; `precise` adds compiler-resolved references; `depth` (1–8) and `maxResults` bound the
36
+ walk.
37
+
38
+ - **`snapshot_context`**
39
+
40
+ **Cost:** medium · **Read-only:** yes
41
+
42
+ The minimum redacted, line-numbered context for a question, file list or symbol list inside a hard
43
+ token budget. `planOnly` returns the ranked reading plan without bodies. Every requested file that
44
+ does not fit is named in `omitted[]`.
45
+
46
+ ```json
47
+ {
48
+ "name": "snapshot_context",
49
+ "arguments": {
50
+ "question": "how does impact pruning work",
51
+ "maxTokens": 12000,
52
+ "linesPerFile": 100
53
+ }
54
+ }
55
+ ```
56
+
57
+ - **`snapshot_locate`**
58
+
59
+ **Cost:** cheap · **Read-only:** yes
60
+
61
+ Find paths, symbols, routes, entrypoints or text in one call. Text mode reads redacted bodies and
62
+ is bounded to 4 MiB. Regex mode passes the same ReDoS guard as the rest of the server. For a
63
+ symbol, `includeReferences` adds compiler-resolved references with `confidence: "ts-semantic"`.
64
+
65
+ ```json
66
+ {
67
+ "name": "snapshot_locate",
68
+ "arguments": { "query": "parseImpact", "by": "symbol" }
69
+ }
70
+ ```
71
+
72
+ - **`snapshot_read`**
73
+
74
+ **Cost:** medium · **Read-only:** yes
75
+
76
+ A line window of one redacted file. A sensitive path (`.env`, `*.pem`, `.npmrc`, `.ssh/`,
77
+ `.tfstate`) is refused even when the path exists on disk, and a response never exceeds 64 KiB.
78
+
79
+ ```json
80
+ {
81
+ "name": "snapshot_read",
82
+ "arguments": { "path": "src/impact.ts", "fromLine": 1, "lines": 120 }
83
+ }
84
+ ```
85
+
86
+ - **`snapshot_validate`**
87
+
88
+ **Cost:** cheap · **Read-only:** yes
89
+
90
+ Three questions in one tool:
91
+
92
+ - `mode: "status"` — does a snapshot exist, and what does it claim?
93
+ - `mode: "drift"` — does it still match the repository? This is the default.
94
+ - `mode: "audit"` — hash, secret, host-path and integrity checks; `deep: true` replays every full
95
+ body.
96
+
97
+ ```json
98
+ {
99
+ "name": "snapshot_validate",
100
+ "arguments": { "mode": "drift" }
101
+ }
102
+ ```
103
+
104
+ A missing snapshot is an answer (`present: false`) in `status` and `drift` mode, not a tool
105
+ failure.
106
+
107
+ - **`snapshot_explain`**
108
+
109
+ **Cost:** expensive · **Read-only:** yes
110
+
111
+ Why a path is included, excluded, sensitive, ignored, binary or truncated. `included: false` is a
112
+ successful explanation, not an error.
113
+
114
+ ```json
115
+ {
116
+ "name": "snapshot_explain",
117
+ "arguments": { "path": ".env" }
118
+ }
119
+ ```
120
+
121
+ - **`snapshot_generate`**
122
+
123
+ **Cost:** expensive · **Writable:** yes
124
+
125
+ Write the snapshot, or preview it with `dryRun: true`. This is the only tool that writes; it never
126
+ installs packages and never edits configuration. It accepts the generation options the CLI accepts,
127
+ including `slice`, `budgetTokens`, `pack`, `stripComments`, `removeEmptyLines`, `skeleton`,
128
+ `sarif`, `changedSince`, `staged` and `withDependents`.
129
+
130
+ ```json
131
+ {
132
+ "name": "snapshot_generate",
133
+ "arguments": { "dryRun": true }
134
+ }
135
+ ```
136
+
137
+ ## Types and visibility
138
+
139
+ The exact JSON Schemas are served by `tools/list`. Inputs reject unknown properties. Every tool
140
+ accepts `root` and `outDir`; both are confined to the directories the server was started for.
141
+ `includeSensitiveFiles` is deliberately absent from every tool: a prompt cannot turn a read-only
142
+ server into an exfiltration primitive.
143
+
144
+ ## Removed tools and their replacements
145
+
146
+ | Removed | Use instead |
147
+ | :-- | :-- |
148
+ | `snapshot_status`, `snapshot_stats`, `snapshot_review` | `snapshot_validate({ mode: "status" })` |
149
+ | `snapshot_health` | `snapshot_validate({ mode: "audit", deep: true })` |
150
+ | `snapshot_plan` | `snapshot_generate({ dryRun: true })` |
151
+ | `snapshot_dependents`, `snapshot_neighbors`, `snapshot_tests`, `snapshot_diff_context`, `snapshot_cycles` | `snapshot_impact` |
152
+ | `snapshot_plan_for`, `snapshot_answer`, `snapshot_budget` | `snapshot_context` |
153
+ | `snapshot_search`, `snapshot_symbol`, `snapshot_query`, `snapshot_routes`, `snapshot_entrypoints` | `snapshot_locate` |
154
+ | `snapshot_history` | `snapshot://reports/log` resource |
155
+ | `snapshot_workspace` | `WORKSPACE.json` and the CLI |
156
+
157
+ ## See also
158
+
159
+ - [MCP server for a codebase](mcp-server-for-codebase.md) — setup, security and large-repo limits.
160
+ - [snapshot_context](answer.md) — the one-call context tool in practice.
161
+ - [All documentation](contents.md) — every guide and reference.
@@ -40,9 +40,9 @@ problem, and for an option the command does not take it also names the commands
40
40
 
41
41
  ```
42
42
  ❌ --watch does not apply to `report` and was not applied. It is accepted by: `generate`.
43
- ❌ --cwd does not apply to `describe` and was not applied. It is accepted by: `generate`, `validate`, `report`, `explain`, `init`, `setup`, `skill`, `mcp`.
44
- ❌ --max-part-bytes does not apply to `report` and was not applied. It is accepted by: `generate`, `validate`, `explain`, `init`, `setup`.
45
- ❌ Unknown --mode "bogus". Expected one of: generate, validate, check, report, init, setup, explain, diff, describe, skill, mcp.
43
+ ❌ --cwd does not apply to `describe` and was not applied. It is accepted by: `generate`, `validate`, `report`, `impact`, `brief`, `explain`, `init`, `setup`, `skill`, `mcp`, `health`, `serve`.
44
+ ❌ --max-part-bytes does not apply to `report` and was not applied. It is accepted by: `generate`, `validate`, `init`, `setup`.
45
+ ❌ Unknown --mode "bogus". Expected one of: generate, validate, check, report, impact, brief, init, setup, explain, diff, describe, skill, mcp, health, update, serve.
46
46
  ```
47
47
 
48
48
  Nothing is silently ignored — that is the point of the message. The per-option `Applies to`
@@ -61,20 +61,20 @@ there, as are `--skeleton`, `--sarif` and `--max-part-tokens`. `--mode` names th
61
61
  | `--autopilot sets a project up and writes a config; --no-config ignores config files. Pass one or the other.` | The two flags contradict each other. Drop one. |
62
62
  | `--no-install only applies to \`setup\`, or to \`generate --autopilot\`.` | The install only happens during a setup. Drop the flag, or add `--autopilot`. |
63
63
  | `--preset does not apply to \`generate\` and was not applied. It is accepted by: \`init\`, \`setup\`. To scope a run, set include/excludePatterns/preset in snapshot.config.ts (or run \`codebase-snapshot init\` to generate one).` | `--preset`, `--include`, `--exclude`, `--yes` and `--force` configure `init` and `setup`, which write them into the config. Set them at generation time in `snapshot.config.ts` instead. |
64
- | `--skip-artifacts does not apply to \`report\` and was not applied. It is accepted by: \`generate\`, \`validate\`, \`explain\`, \`init\`, \`setup\`.` | `report` reads the manifest and prints it, so the generation settings are rejected there. Run `generate` with the artifact selection you want. |
65
- | `Unknown --mode "bogus". Expected one of: generate, validate, check, report, init, setup, explain, diff, describe, skill, mcp.` | `--mode` names the command the run uses; `mcp` is one of the accepted names. Pass the command positionally unless a wrapper builds the argument list. |
64
+ | `--skip-artifacts does not apply to \`report\` and was not applied. It is accepted by: \`generate\`, \`validate\`, \`init\`, \`setup\`.` | `report` reads the manifest and prints it, so the generation settings are rejected there. Run `generate` with the artifact selection you want. |
65
+ | `Unknown --mode "bogus". Expected one of: generate, validate, check, report, impact, brief, init, setup, explain, diff, describe, skill, mcp, health, update, serve.` | `--mode` names the command the run uses; every command is an accepted name. Pass the command positionally unless a wrapper builds the argument list. |
66
66
  | `--install does not apply to \`generate\` and was not applied. It is accepted by: \`skill\`.` | `--install` and `--target` configure `skill` only. |
67
67
  | `--cwd directory does not exist: …` / `--cwd is not a directory: …` | Point `--cwd` at an existing repository directory. |
68
68
  | `--out-dir requires a value (received an empty string).` | An unset shell variable expanded to nothing. Quote it or drop the flag. Every string option rejects `""` rather than silently using the default. |
69
69
  | `--max-part-bytes received a value that looks like another flag (for example a negative number). Use the "--option=value" form, and note that sizes must be positive.` | A negative number reads as a flag. Use `--max-part-bytes=-5`, and note that sizes must be positive. |
70
70
  | `Unknown preset "nope". Expected one of: …` | The message lists all 25 valid names. |
71
- | `--target must be one of: claude, cursor, all (received "bogus").` | Fix the value. |
71
+ | `--target must be one of: agents, claude, cursor, all (received "bogus").` | Fix the value. |
72
72
  | `diff expects exactly two arguments …` / `explain expects exactly one path.` | Fix the arity. |
73
73
 
74
- The `agents` target was removed in 4.1.1: `skill --install` writes only into the two registries
75
- agent tools read by name (`.claude/skills/` and `.cursor/rules/`) and never writes `AGENTS.md`,
76
- which is your repository's own agent contract. To put the skill there, print it and paste it
77
- yourself: `codebase-snapshot skill >> AGENTS.md`.
74
+ `skill --install` writes into the three registries agent tools read by name
75
+ (`.agents/skills/`, `.claude/skills/` and `.cursor/rules/`) and never writes `AGENTS.md`, which is
76
+ your repository's own agent contract. To put the skill there, print it and paste it yourself:
77
+ `codebase-snapshot skill >> AGENTS.md`. `--with-mcp` additionally merges an entry into `.mcp.json`.
78
78
 
79
79
  ## Exit code 1 — the state was wrong
80
80
 
@@ -404,7 +404,7 @@ repository, or scan a local checkout.
404
404
 
405
405
  ### `This snapshot has no reports/log.md`
406
406
 
407
- `snapshot_history` reads an opt-in report. Generate with `includeLogs` (MCP) or
407
+ The history resource reads an opt-in report. Generate with `includeLogs` (MCP) or
408
408
  `--include-logs <n>` (CLI); the commit subjects are repository content, so the report is not written
409
409
  unless asked for.
410
410
  ## The snapshot is too big
@@ -65,3 +65,10 @@ produces a prompt that might contain it.
65
65
  If your problem is *"my prompt is not structured the way I want"*, code2prompt solves it and this
66
66
  tool does not. If your problem is *"my context does not fit, and I cannot tell whether it is still
67
67
  accurate"*, that is this tool's entire reason to exist.
68
+
69
+ ## Is codebase-snapshot a code2prompt alternative?
70
+
71
+ They solve different halves of the problem. code2prompt renders a prompt from a repository;
72
+ codebase-snapshot writes a bounded, indexed payload and can tell you when that payload is stale.
73
+ If your prompt is already the right shape, keep code2prompt. If the payload is the problem, start
74
+ with [LLM codebase context](llm-codebase-context.md).
@@ -72,3 +72,10 @@ once the repository is one you maintain and want context generated reproducibly.
72
72
  For a one-off look at someone else's repository, gitingest is better and always will be — it wins
73
73
  on friction, and friction is what most people are short of. This tool is for codebases you own and
74
74
  pipelines you maintain, where a ceiling, a drift check and an audit trail are the point.
75
+
76
+ ## Is codebase-snapshot a gitingest alternative?
77
+
78
+ Only if you need a repeatable artefact rather than a quick look. gitingest wins on friction: a
79
+ URL becomes text in a browser with no install. codebase-snapshot wins when the context has to be
80
+ generated in CI, checked for drift, or bounded by a byte budget. For a one-off read of someone
81
+ else's repository, use gitingest.
@@ -29,7 +29,7 @@ If you want the most popular, most integrated tool: **use repomix.**
29
29
  | Reproducible output | Parts are byte-identical across runs; a fingerprint covers them | Content is stable; no published determinism guarantee |
30
30
  | Staleness check | `validate` re-hashes the repository and exits non-zero on drift | Not a feature |
31
31
  | Remote repositories | **Yes** — `--remote` clones an HTTPS URL (or `file://` with `--allow-private`); git is required | **Yes** — packs a GitHub URL directly |
32
- | MCP server | **Yes** — 26 tools over stdio, and it serves the validated snapshot rather than the working tree | **Yes** — packs a repository, including by URL |
32
+ | MCP server | **Yes** — 7 tools over stdio, live by default and validated on request | **Yes** — packs a repository, including by URL |
33
33
  | Secret handling | 32 default rules, value-span masking, per-line audit table | Secretlint integration |
34
34
  | Language awareness | 25 presets, AST or structural summaries labelled by confidence | Tree-sitter parsing with a compression mode |
35
35
  | Adoption | New | **Mature** — large user base, many integrations |
@@ -89,3 +89,12 @@ repomix is the safer recommendation for most people today, because maturity and
89
89
  more than any single feature. This tool exists for the narrower case where a size ceiling, a drift
90
90
  check and reproducibility are requirements rather than nice-to-haves — and for the case where an
91
91
  agent has to operate it without a human reading the docs first.
92
+
93
+ ## Is codebase-snapshot a repomix alternative?
94
+
95
+ Yes, for a narrower job. repomix is the better choice when you want one file, wide format
96
+ support and a mature integration list. codebase-snapshot is the better choice when the
97
+ artefact has to stay under a byte ceiling, record every omission, redact secrets and prove it
98
+ still matches the tree. If you are searching for a repomix alternative because a pack was too
99
+ large or too stale, start with [LLM codebase context](llm-codebase-context.md) and the
100
+ [token-budget guide](how-to-context-budget.md).
package/docs/workspace.md CHANGED
@@ -22,7 +22,7 @@ codebase-snapshot health --all-members --out-dir context --strict
22
22
  codebase-snapshot validate --cwd api --out-dir ../context/api
23
23
 
24
24
  # 4. Serve the index to an agent
25
- codebase-snapshot mcp --cwd . # snapshot_workspace reads context/WORKSPACE.json
25
+ codebase-snapshot mcp --cwd . # the server reads context/WORKSPACE.json for workspace context
26
26
  ```
27
27
 
28
28
  `health --all-members` fails the run when any member fails, so step 2 can gate a release the way a
package/package.json CHANGED
@@ -1,13 +1,16 @@
1
1
  {
2
2
  "name": "codebase-snapshot",
3
- "version": "0.20.12",
4
- "description": "Turn a repository into LLM-ready Markdown under a hard byte budget: a manifest of every included and skipped file, secret redaction, drift validation, and an MCP server for Claude, ChatGPT and Cursor.",
3
+ "version": "0.21.0",
4
+ "mcpName": "io.github.ankurhalder/codebase-snapshot",
5
+ "description": "LLM codebase context you can verify: turn a repository into budgeted Markdown with a manifest of every included and skipped file, secret redaction, drift validation, and 7 MCP tools for Claude, ChatGPT, Cursor and CI.",
5
6
  "keywords": [
6
7
  "codebase-snapshot",
7
8
  "codebase",
8
9
  "snapshot",
9
10
  "llm",
10
11
  "llm-context",
12
+ "llm-codebase",
13
+ "llm-codebase-context",
11
14
  "repo-to-llm",
12
15
  "codebase-to-markdown",
13
16
  "codebase-to-prompt",
@@ -101,6 +104,7 @@
101
104
  "typecheck": "tsc --noEmit",
102
105
  "lint": "node scripts/lint.mjs",
103
106
  "check:workflows": "node scripts/check-workflows.mjs",
107
+ "check:docs": "node scripts/check-docs-sync.mjs",
104
108
  "check": "npm run lint && npm run typecheck && npm test",
105
109
  "pretest": "npm run build",
106
110
  "test": "node scripts/test-run.mjs",
@@ -113,10 +117,12 @@
113
117
  "audit-site": "node scripts/audit-site.mjs",
114
118
  "readme-lint": "node scripts/readme-lint.mjs",
115
119
  "seo-rank": "node scripts/seo-rank.mjs",
120
+ "indexnow": "node scripts/indexnow.mjs",
116
121
  "verify": "npm run check && npm run check:workflows && npm run sync-docs -- --check && npm run site && node scripts/check-site-links.mjs && npm run audit-site && npm run readme-lint && npm run pack-check",
117
122
  "snapshot": "node ./dist/bin.js generate",
118
123
  "snapshot:validate": "node ./dist/bin.js validate",
119
124
  "coverage-diff": "node scripts/coverage-diff.mjs",
125
+ "eval:intelligence": "node scripts/eval-intelligence.mjs",
120
126
  "reproducible": "node scripts/reproducible.mjs",
121
127
  "verify:deep": "npm run verify && node scripts/verify-deep.mjs"
122
128
  },
@@ -127,6 +133,7 @@
127
133
  "esbuild": "^0.28.1"
128
134
  },
129
135
  "devDependencies": {
136
+ "@modelcontextprotocol/client": "^2.4.0",
130
137
  "@types/node": "^22.0.0",
131
138
  "marked": "^18.1.3",
132
139
  "tsup": "^8.3.0"