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.
- package/CHANGELOG.md +45 -6
- package/README.md +46 -19
- package/SECURITY.md +2 -2
- package/dist/bin.js +14535 -12036
- package/dist/{chunk-GNVRD7XS.js → chunk-NPCDJBE4.js} +6097 -4425
- package/dist/cli.cjs +11184 -8708
- package/dist/cli.d.cts +94 -2
- package/dist/cli.d.ts +94 -2
- package/dist/cli.js +944 -95
- package/dist/{generate-worker-DMzNbsAW.d.cts → generate-worker-BUNhTXkj.d.cts} +2 -2
- package/dist/{generate-worker-CRMESc0b.d.ts → generate-worker-TUMvHlgz.d.ts} +2 -2
- package/dist/index.cjs +6073 -4423
- package/dist/index.d.cts +281 -63
- package/dist/index.d.ts +281 -63
- package/dist/index.js +1 -1
- package/dist/mcp.cjs +10240 -4315
- package/dist/mcp.d.cts +13 -7
- package/dist/mcp.d.ts +13 -7
- package/dist/mcp.js +1 -1
- package/dist/{types-C5ytHMYz.d.ts → types-DQXKiaXk.d.cts} +50 -2
- package/dist/{types-C5ytHMYz.d.cts → types-DQXKiaXk.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 +126 -25
- package/docs/codebase-token-budget.md +14 -13
- package/docs/contents.md +68 -0
- package/docs/deploy.md +2 -2
- package/docs/faq.md +112 -0
- package/docs/glossary.md +152 -0
- package/docs/guard.md +154 -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 +163 -0
- package/docs/mcp.md +48 -67
- package/docs/migration.md +83 -90
- package/docs/output.md +1 -3
- package/docs/security-review.md +8 -8
- 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 +8 -2
package/docs/migration.md
CHANGED
|
@@ -1,91 +1,84 @@
|
|
|
1
|
-
# Migrating to 0.
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
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
|
-
stdio is still the default. `--http` adds Streamable HTTP with a bearer token and a loopback
|
|
54
|
-
bind; `--no-auth` is refused on a non-loopback bind. The page and the MCP endpoint can share
|
|
55
|
-
one port with `serve`.
|
|
56
|
-
|
|
57
|
-
## 0.18.0 to 0.20.13: what changed
|
|
58
|
-
|
|
59
|
-
| Change | Since | Why it matters |
|
|
1
|
+
# Migrating to 0.21.0
|
|
2
|
+
|
|
3
|
+
0.21.0 is a breaking release. The MCP surface is deliberately smaller, `impact` and `brief` work
|
|
4
|
+
without a generated snapshot, and the default read path is live. There is no silent compatibility
|
|
5
|
+
layer: a removed tool or a changed default fails loudly.
|
|
6
|
+
|
|
7
|
+
## Before you upgrade
|
|
8
|
+
|
|
9
|
+
1. Pin the exact 0.21.0 release in the manifest or lockfile you deploy.
|
|
10
|
+
2. Run `codebase-snapshot validate` against the old snapshot. Re-generate before relying on the
|
|
11
|
+
new live tools; the manifest format is still readable, but the MCP surface changed.
|
|
12
|
+
3. If an agent or CI job calls an MCP tool by name, update it from the table below. The seven tools
|
|
13
|
+
are the complete set: `snapshot_impact`, `snapshot_context`, `snapshot_locate`,
|
|
14
|
+
`snapshot_read`, `snapshot_validate`, `snapshot_explain`, `snapshot_generate`.
|
|
15
|
+
|
|
16
|
+
## MCP: 27 tools to 7
|
|
17
|
+
|
|
18
|
+
| Removed tool(s) | Replacement |
|
|
19
|
+
| :--- | :--- |
|
|
20
|
+
| `snapshot_status`, `snapshot_stats`, `snapshot_review` | `snapshot_validate` with `mode: "status"` or `mode: "audit"` |
|
|
21
|
+
| `snapshot_health` | `snapshot_validate` with `mode: "audit"` and `deep: true` |
|
|
22
|
+
| `snapshot_dependents`, `snapshot_neighbors`, `snapshot_tests`, `snapshot_diff_context`, `snapshot_cycles` | `snapshot_impact` |
|
|
23
|
+
| `snapshot_plan_for`, `snapshot_answer`, `snapshot_budget` | `snapshot_context` (use `planOnly: true` for the plan without bodies) |
|
|
24
|
+
| `snapshot_search`, `snapshot_symbol`, `snapshot_query`, `snapshot_routes`, `snapshot_entrypoints` | `snapshot_locate` |
|
|
25
|
+
| `snapshot_history` | `snapshot://reports/log`, or the report file on disk |
|
|
26
|
+
| `snapshot_workspace` | `context/WORKSPACE.json` and the CLI |
|
|
27
|
+
|
|
28
|
+
The seven remaining tools keep the same read/write rule: only `snapshot_generate` writes. The
|
|
29
|
+
other six are read-only and must never create a cache, a temp file, or a snapshot inside the
|
|
30
|
+
repository. Live reads may write the documented OS cache under the user cache directory, never
|
|
31
|
+
inside the served repository.
|
|
32
|
+
|
|
33
|
+
## Changed defaults
|
|
34
|
+
|
|
35
|
+
- `impact` defaults to `HEAD`. It no longer requires a prior `generate`; it builds a live index in
|
|
36
|
+
memory and overlays uncommitted edits.
|
|
37
|
+
- `impact` and `brief` use the live index by default. Pass `--no-live` to require the persisted
|
|
38
|
+
snapshot. `--no-cache` bypasses only the OS summary cache.
|
|
39
|
+
- `snapshot_read` prefers snapshot part bodies when the index source is `snapshot`; live bytes are
|
|
40
|
+
used only for `live-overlay` or `live-memory`.
|
|
41
|
+
- `snapshot_validate` with `mode: "status"` reports presence, counts, fingerprint and timestamps;
|
|
42
|
+
it does **not** claim `current`. Use the default drift mode for freshness. Audit mode reports
|
|
43
|
+
health, not drift.
|
|
44
|
+
- `brief` was added. It emits redacted diff hunks and bounded source windows, with every omitted
|
|
45
|
+
file named. `--out` refuses symbolic and hard links.
|
|
46
|
+
- `skill --install` writes three registries: `.agents/`, `.claude/` and `.cursor/`.
|
|
47
|
+
`--with-mcp` merges one entry into `.mcp.json` and preserves other servers.
|
|
48
|
+
|
|
49
|
+
## New flags
|
|
50
|
+
|
|
51
|
+
| Flag | Command | Meaning |
|
|
60
52
|
| :--- | :--- | :--- |
|
|
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
|
-
newer
|
|
53
|
+
| `--brief <path>` | generate, validate | Merge an owner-written half into `PROMPT.md`. |
|
|
54
|
+
| `--prompt-task <task>` | generate, validate | `audit`, `review` or `explain`. |
|
|
55
|
+
| `--attachment-slots <n>` | generate | Plan delivery for a destination that accepts n files. |
|
|
56
|
+
| `--max-parts <n>` | generate, validate | Grow the part budget until the snapshot has at most n parts. |
|
|
57
|
+
| `--tests-paths` | impact | Print candidate test paths, one per line. |
|
|
58
|
+
| `--run` | impact | Run the detected runner on the candidate tests (text output only). |
|
|
59
|
+
| `--precise` | impact | Add bounded compiler-resolved symbol references. |
|
|
60
|
+
| `--include-imports`, `--include-cycles` | impact | Add outgoing imports or cycles. |
|
|
61
|
+
| `--no-live`, `--no-cache` | impact, brief | Require the snapshot, or bypass the live-index cache. |
|
|
62
|
+
| `--copy`, `--out` | brief | Copy the brief, or write it inside the repository. |
|
|
63
|
+
| `--with-mcp` | skill | Merge a server entry into `.mcp.json`. |
|
|
64
|
+
|
|
65
|
+
## Configuration and behaviour
|
|
66
|
+
|
|
67
|
+
- `maxPartBytes` is a hard byte ceiling. `maxParts` is explicitly experimental: it may grow the
|
|
68
|
+
budget and records a warning when it does.
|
|
69
|
+
- `--delta` and `--changed-since` record unchanged paths as `unchanged`; a file dropped later by
|
|
70
|
+
`--budget-tokens` or `--slice` is `not-selected`, not `unchanged`. Validate therefore does not
|
|
71
|
+
confuse a budget drop with an unchanged file.
|
|
72
|
+
- `--only` narrows the CLI. On the MCP surface it cannot replace an include allow-list declared in
|
|
73
|
+
`snapshot.config.json`; the request is refused instead of widening scope.
|
|
74
|
+
- A snapshot generated with `--include-sensitive-files` is refused by the MCP server, including
|
|
75
|
+
its part resources. Regenerate without that flag before serving a prompt.
|
|
76
|
+
|
|
77
|
+
## Older lines
|
|
78
|
+
|
|
79
|
+
The 0.20 line was published in place and remains documented in its own history. If you are on
|
|
80
|
+
0.12.x, upgrade to the newest 0.20 release first, then follow this page. The configuration file
|
|
81
|
+
format has not changed; removed MCP tools and the new live defaults are the migration work.
|
|
82
|
+
|
|
83
|
+
`validate` on a snapshot written by an older version still works: newer manifest keys are optional,
|
|
84
|
+
and an artifact the manifest does not record is not required to exist.
|
package/docs/output.md
CHANGED
|
@@ -96,9 +96,7 @@ examples from its own incidents. Each is marked as written by the project owner.
|
|
|
96
96
|
- the delivery arithmetic below.
|
|
97
97
|
|
|
98
98
|
Everything factual is rendered from the manifest and the repository, so the brief cannot describe
|
|
99
|
-
a different run.
|
|
100
|
-
parts,audit` produces a brief that does not tell a model to read parts, and says the per-file
|
|
101
|
-
redaction detail is unavailable rather than pointing at a file that is not there.
|
|
99
|
+
a different run.
|
|
102
100
|
|
|
103
101
|
It also does the arithmetic of sending it. Hosted chats take a fixed number of files — 10 is the
|
|
104
102
|
common cap — and every part is one file, so a 12-part snapshot cannot be delivered whole. The
|
package/docs/security-review.md
CHANGED
|
@@ -35,8 +35,8 @@ untrusted input can arrive.
|
|
|
35
35
|
tracked `notes.txt`.
|
|
36
36
|
- **Every snapshot file read is confined.** PROMPT.md, reports, the manifest, WORKSPACE.json and
|
|
37
37
|
signature.json are opened through one reader that refuses a symlink and requires the canonical
|
|
38
|
-
target inside the snapshot directory. The MCP resources, `
|
|
39
|
-
`
|
|
38
|
+
target inside the snapshot directory. The MCP resources, `snapshot_validate`,
|
|
39
|
+
`snapshot_explain`, signing verification and `serve` use it; a part lookup also requires its
|
|
40
40
|
`parts/` directory and the resolved part to stay inside the snapshot.
|
|
41
41
|
- **The diff report fails closed.** Git is forced to emit unquoted ASCII prefixes, a section that
|
|
42
42
|
cannot be attributed to a path is omitted rather than trusted, redaction runs before truncation
|
|
@@ -66,8 +66,7 @@ executable config in it is refused, because a fetched repository is not a truste
|
|
|
66
66
|
- **Bounded work**: 2 MiB bodies, 60 requests per 10 s per address, one JSON document per response,
|
|
67
67
|
and at most four MCP tool calls in flight across all HTTP sessions. The session and rate maps are
|
|
68
68
|
capped and evicted, so a client cannot grow either without bound.
|
|
69
|
-
- **Untrusted regexes are bounded.** `
|
|
70
|
-
reject nested quantifiers, more than one unbounded repetition, optional-chain blowups and
|
|
69
|
+
- **Untrusted regexes are bounded.** `snapshot_locate` rejects nested quantifiers, more than one unbounded repetition, optional-chain blowups and
|
|
71
70
|
backreferences before compiling; glob and gitignore patterns are bounded by wildcard, brace and
|
|
72
71
|
alternative counts. JavaScript has no regex timeout, so the alternative is a main-thread stall.
|
|
73
72
|
- **Errors are JSON-RPC error objects**, never stack traces.
|
|
@@ -131,10 +130,11 @@ addition was reviewed with the same question — what new input arrives, and wha
|
|
|
131
130
|
- **The audit stopped trusting the manifest** (0.13.6-0.13.10): bodies, counts and pack membership
|
|
132
131
|
are recomputed. An attacker who edits a part and updates its hash, or edits a manifest count,
|
|
133
132
|
now fails the audit; before, both passed. This turns a tampered snapshot into a detected one.
|
|
134
|
-
- **`
|
|
133
|
+
- **`snapshot_context`** (0.15.5) reads only `parts/` through the same parser, so redaction and
|
|
135
134
|
exclusions apply exactly as they do to `snapshot_read`; it adds no file-system surface.
|
|
136
|
-
- **`--only`/`--ignore`** (0.14.6) widen
|
|
137
|
-
|
|
135
|
+
- **`--only`/`--ignore`** (0.14.6, tightened 0.21.0) never widen the MCP surface: the CLI may
|
|
136
|
+
replace its own config's allow-list, but an MCP request that tries to replace a declared
|
|
137
|
+
`include` allow-list is refused. `--ignore` only adds excludes. Sensitive files stay excluded.
|
|
138
138
|
- **The 0.20.5 second audit** closed the bypasses left by 0.20.4: symlink targets now have to be
|
|
139
139
|
included under their own name, uppercase authorization headers are masked, C-quoted diff paths
|
|
140
140
|
and gitignore/exclude targets are handled, resource/manifest/report reads are confined,
|
|
@@ -154,7 +154,7 @@ addition was reviewed with the same question — what new input arrives, and wha
|
|
|
154
154
|
credentials and unterminated PEM bodies have no length/prefix blind spot; alternation and glob
|
|
155
155
|
branch budgets bound the event loop; workspace members inherit every generation flag;
|
|
156
156
|
`validate` agrees with `--skip-artifacts parts`; HTTP batches are charged per message and
|
|
157
|
-
batched `initialize` mints a session; `
|
|
157
|
+
batched `initialize` mints a session; `snapshot_locate` is bounded; explicit false overrides
|
|
158
158
|
reach validation; `..notes.ts` is accepted at the segment boundary; `health --all-members`
|
|
159
159
|
confines the index and members; `serve` rejects non-HTTP loopback origins and records nested
|
|
160
160
|
repository roots; and report fences grow with their content.
|
package/docs/slice.md
CHANGED
|
@@ -5,7 +5,7 @@ codebase-snapshot generate --slice "how does checkout retry a failed payment" --
|
|
|
5
5
|
```
|
|
6
6
|
|
|
7
7
|
A slice is a snapshot built for a question. The retrieval planner that powers
|
|
8
|
-
[`
|
|
8
|
+
[`snapshot_context`](tools.md) planner runs at generate time, and only the files it chooses are written. The
|
|
9
9
|
result is a snapshot small enough to paste, with the selection and the omissions recorded.
|
|
10
10
|
|
|
11
11
|
## What it keeps
|
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.
|