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.
- package/CHANGELOG.md +44 -6
- package/README.md +46 -19
- package/SECURITY.md +2 -2
- package/dist/bin.js +12173 -9823
- package/dist/{chunk-TUKY6KLH.js → chunk-TDPYLX7X.js} +6312 -4472
- package/dist/cli.cjs +12074 -9744
- package/dist/cli.d.cts +76 -2
- package/dist/cli.d.ts +76 -2
- package/dist/cli.js +549 -14
- package/dist/{generate-worker-DMzNbsAW.d.cts → generate-worker-D56JeXwx.d.cts} +2 -2
- package/dist/{generate-worker-CRMESc0b.d.ts → generate-worker-DakxZs-l.d.ts} +2 -2
- package/dist/index.cjs +6292 -4466
- package/dist/index.d.cts +281 -63
- package/dist/index.d.ts +281 -63
- package/dist/index.js +1 -1
- package/dist/mcp.cjs +10486 -4393
- package/dist/mcp.d.cts +26 -11
- package/dist/mcp.d.ts +26 -11
- package/dist/mcp.js +1 -1
- package/dist/{types-C5ytHMYz.d.ts → types-D5XYzksd.d.cts} +50 -2
- package/dist/{types-C5ytHMYz.d.cts → types-D5XYzksd.d.ts} +50 -2
- package/docs/about.md +86 -0
- package/docs/agent.md +28 -6
- package/docs/answer.md +99 -48
- package/docs/benchmarks.md +34 -34
- package/docs/brief.md +80 -81
- package/docs/cli.md +103 -27
- package/docs/codebase-token-budget.md +14 -13
- package/docs/configuration.md +1 -1
- package/docs/contents.md +66 -0
- package/docs/deploy.md +2 -2
- package/docs/faq.md +112 -0
- package/docs/glossary.md +152 -0
- package/docs/health.md +1 -1
- package/docs/how-to-feed-a-repo-to-claude.md +6 -0
- package/docs/impact.md +102 -0
- package/docs/install.md +4 -3
- package/docs/llm-codebase-context.md +166 -0
- package/docs/mcp-server-for-codebase.md +155 -0
- package/docs/mcp.md +81 -82
- package/docs/migration.md +83 -85
- package/docs/output.md +1 -3
- package/docs/security-review.md +20 -9
- package/docs/slice.md +1 -1
- package/docs/tools.md +159 -185
- package/docs/troubleshooting.md +11 -11
- package/docs/vs-code2prompt.md +7 -0
- package/docs/vs-gitingest.md +7 -0
- package/docs/vs-repomix.md +10 -1
- package/docs/workspace.md +1 -1
- package/package.json +9 -2
package/docs/tools.md
CHANGED
|
@@ -1,187 +1,161 @@
|
|
|
1
1
|
# MCP tools
|
|
2
2
|
|
|
3
|
-
The server exposes
|
|
4
|
-
call
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
`
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
{ "
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
"
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
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.
|
package/docs/troubleshooting.md
CHANGED
|
@@ -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`, `
|
|
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\`, \`
|
|
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;
|
|
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
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
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
|
-
|
|
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
|
package/docs/vs-code2prompt.md
CHANGED
|
@@ -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).
|
package/docs/vs-gitingest.md
CHANGED
|
@@ -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.
|
package/docs/vs-repomix.md
CHANGED
|
@@ -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** —
|
|
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 . #
|
|
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.
|
|
4
|
-
"
|
|
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"
|