codebase-snapshot 0.14.0 → 0.16.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 +184 -0
- package/README.md +3 -3
- package/SECURITY.md +2 -2
- package/dist/bin.js +341 -10
- package/dist/{chunk-2YNQ42B3.js → chunk-AEGJYOCF.js} +326 -10
- package/dist/{chunk-7WSZUMT6.js → chunk-ZDTAWUD4.js} +1 -1
- package/dist/cli.cjs +341 -10
- package/dist/cli.d.cts +11 -1
- package/dist/cli.d.ts +11 -1
- package/dist/cli.js +18 -3
- package/dist/index.cjs +326 -10
- package/dist/index.d.cts +3 -3
- package/dist/index.d.ts +3 -3
- package/dist/index.js +1 -1
- package/dist/mcp.cjs +248 -9
- package/dist/mcp.d.cts +1 -1
- package/dist/mcp.d.ts +1 -1
- package/dist/mcp.js +2 -2
- package/dist/{types-CbD8yQRZ.d.cts → types-Cr5H2Y3t.d.cts} +13 -0
- package/dist/{types-CbD8yQRZ.d.ts → types-Cr5H2Y3t.d.ts} +13 -0
- package/docs/benchmarks.md +54 -9
- package/docs/cli.md +7 -5
- package/docs/deploy.md +2 -2
- package/docs/mcp.md +7 -5
- package/docs/slice.md +8 -0
- package/docs/tools.md +16 -2
- package/docs/vs-repomix.md +1 -1
- package/package.json +1 -1
package/docs/mcp.md
CHANGED
|
@@ -10,7 +10,7 @@ walk — that the client sees.
|
|
|
10
10
|
## Start it
|
|
11
11
|
|
|
12
12
|
```bash
|
|
13
|
-
npx -y codebase-snapshot@0.
|
|
13
|
+
npx -y codebase-snapshot@0.16.0 mcp
|
|
14
14
|
```
|
|
15
15
|
|
|
16
16
|
The server serves the directory it was started in. `--cwd <path>` points it elsewhere, and that
|
|
@@ -25,7 +25,7 @@ Claude Desktop and Cursor:
|
|
|
25
25
|
"mcpServers": {
|
|
26
26
|
"codebase-snapshot": {
|
|
27
27
|
"command": "npx",
|
|
28
|
-
"args": ["-y", "codebase-snapshot@0.
|
|
28
|
+
"args": ["-y", "codebase-snapshot@0.16.0", "mcp", "--cwd", "/absolute/path/to/repo"]
|
|
29
29
|
}
|
|
30
30
|
}
|
|
31
31
|
}
|
|
@@ -34,7 +34,7 @@ Claude Desktop and Cursor:
|
|
|
34
34
|
Claude Code registers the same thing from a shell:
|
|
35
35
|
|
|
36
36
|
```bash
|
|
37
|
-
claude mcp add codebase-snapshot -- npx -y codebase-snapshot@0.
|
|
37
|
+
claude mcp add codebase-snapshot -- npx -y codebase-snapshot@0.16.0 mcp --cwd /absolute/path/to/repo
|
|
38
38
|
```
|
|
39
39
|
|
|
40
40
|
On Windows, wrap the command as `cmd /c npx` with the same arguments — `npx` is a `.cmd` shim
|
|
@@ -43,7 +43,7 @@ there, and clients that spawn without a shell cannot execute it directly.
|
|
|
43
43
|
## Over HTTP, for clients that cannot spawn a process
|
|
44
44
|
|
|
45
45
|
```bash
|
|
46
|
-
npx -y codebase-snapshot@0.
|
|
46
|
+
npx -y codebase-snapshot@0.16.0 mcp --http --port 4789
|
|
47
47
|
```
|
|
48
48
|
|
|
49
49
|
This is the Streamable HTTP shape: POST one JSON-RPC message (or an array) to `/mcp` and read
|
|
@@ -92,7 +92,7 @@ into logs and is documented as such. A heartbeat every 15 s keeps the connection
|
|
|
92
92
|
shutdown ends the streams rather than waiting on them. Request bodies are capped at 2 MB, the rate is
|
|
93
93
|
capped at 60 requests per 10 seconds per address, and every response is one bounded JSON document.
|
|
94
94
|
|
|
95
|
-
## The
|
|
95
|
+
## The 26 tools
|
|
96
96
|
|
|
97
97
|
Each tool has an entry with a ready-to-send call in the [tool reference](tools.md).
|
|
98
98
|
|
|
@@ -107,6 +107,8 @@ between them should not have to guess.
|
|
|
107
107
|
| `snapshot_status` | Is there a snapshot, when was it built, what does it cover? | no |
|
|
108
108
|
| `snapshot_health` | Does the written snapshot match its manifest, carry any secret or host path, and cost what it claims? `maxScanBytes` bounds the text scan. | no |
|
|
109
109
|
| `snapshot_query` | Filter the index by layer, kind, path pattern or symbol | no |
|
|
110
|
+
| `snapshot_answer` | Question to cited, line-numbered windows within a budget | no |
|
|
111
|
+
| `snapshot_budget` | Planner output at several budgets: what raising the budget would add | no |
|
|
110
112
|
| `snapshot_history` | The commits the snapshot was built from (reads `reports/log.md`) | no |
|
|
111
113
|
| `snapshot_tests` | The tests that import a file (or every test and what it covers) | no |
|
|
112
114
|
| `snapshot_workspace` | The members of a multi-repository workspace and the imports that cross between them | no |
|
package/docs/slice.md
CHANGED
|
@@ -38,6 +38,14 @@ Every path that was scanned and not chosen is in `skipped[]` with reason `not-se
|
|
|
38
38
|
`unchanged`, which would be a different and untrue statement. The brief says at the top that the
|
|
39
39
|
snapshot is a slice, quotes the question, and warns that unselected paths are not in the parts.
|
|
40
40
|
|
|
41
|
+
## The snapshot explains its own selection
|
|
42
|
+
|
|
43
|
+
A slice writes `reports/selection.md`: the question, the budget, every chosen file with its token
|
|
44
|
+
cost and the reason it was chosen, how many files were left out, and — for `--budget-tokens` — the
|
|
45
|
+
files a larger budget would buy next, with their costs. The same numbers are in the manifest
|
|
46
|
+
(`slice`, `budget.headroomTokens`, `budget.nextInLine`), and `validate` checks the report like any
|
|
47
|
+
other artifact, so an edited report is drift.
|
|
48
|
+
|
|
41
49
|
## What it does not do
|
|
42
50
|
|
|
43
51
|
- It does not read files that were excluded: sensitive files stay out, so a question about them
|
package/docs/tools.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# MCP tools
|
|
2
2
|
|
|
3
|
-
The server exposes
|
|
3
|
+
The server exposes 26 tools. This page is the reference: what each answers, what it costs, and one
|
|
4
4
|
call you can send as it stands. [MCP](mcp.md) covers the transports and the protocol; this page is
|
|
5
5
|
the catalogue.
|
|
6
6
|
|
|
@@ -52,7 +52,9 @@ Every tool is read-only unless it says **writes**. Cost is the class `tools/list
|
|
|
52
52
|
```json
|
|
53
53
|
{ "name": "snapshot_locate", "arguments": { "query": "src/mcp/tools.ts", "by": "path" } }
|
|
54
54
|
```
|
|
55
|
-
- **`snapshot_symbol`** — medium, read-only. A symbol by name: defining file, kind, signature
|
|
55
|
+
- **`snapshot_symbol`** — medium, read-only. A symbol by name: defining file, kind, signature,
|
|
56
|
+
and — unless `references: false` — the call sites where the name appears, with line numbers.
|
|
57
|
+
|
|
56
58
|
the exports that reference it.
|
|
57
59
|
```json
|
|
58
60
|
{ "name": "snapshot_symbol", "arguments": { "name": "generateSnapshot" } }
|
|
@@ -64,6 +66,18 @@ Every tool is read-only unless it says **writes**. Cost is the class `tools/list
|
|
|
64
66
|
|
|
65
67
|
## Reading
|
|
66
68
|
|
|
69
|
+
- **`snapshot_answer`** — medium, read-only. One call from question to context: plans the
|
|
70
|
+
question, then returns each chosen file as a head window with line numbers inside the token
|
|
71
|
+
budget. Every file says why it is there; every planned file that did not fit says why not.
|
|
72
|
+
```json
|
|
73
|
+
{ "name": "snapshot_answer", "arguments": { "question": "how does redaction work", "maxTokens": 20000 } }
|
|
74
|
+
```
|
|
75
|
+
- **`snapshot_budget`** — medium, read-only. The planner at several budgets, with what each
|
|
76
|
+
one adds: files, tokens used, and the paths gained over the previous budget. The answer to
|
|
77
|
+
"should I raise the budget, and what would I get?"
|
|
78
|
+
```json
|
|
79
|
+
{ "name": "snapshot_budget", "arguments": { "budgets": [10000, 30000, 60000] } }
|
|
80
|
+
```
|
|
67
81
|
- **`snapshot_history`** — cheap, read-only. The commits behind the snapshot, from
|
|
68
82
|
`reports/log.md`; says how to generate the report when it is absent.
|
|
69
83
|
```json
|
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 | No — operates on a local checkout | **Yes** — packs a GitHub URL directly |
|
|
32
|
-
| MCP server | **Yes** —
|
|
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 |
|
|
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 |
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "codebase-snapshot",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.16.0",
|
|
4
4
|
"description": "Create a codebase snapshot an LLM can read: budgeted Markdown parts for Claude, ChatGPT and Cursor, a manifest of every included and skipped file, secret redaction, and validate, which fails when the snapshot drifts. Local CLI and MCP server.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"codebase-snapshot",
|