codebase-snapshot 0.10.2 → 0.11.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/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.10.2 mcp
13
+ npx -y codebase-snapshot@0.11.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.10.2", "mcp", "--cwd", "/absolute/path/to/repo"]
28
+ "args": ["-y", "codebase-snapshot@0.11.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.10.2 mcp --cwd /absolute/path/to/repo
37
+ claude mcp add codebase-snapshot -- npx -y codebase-snapshot@0.11.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
package/docs/output.md CHANGED
@@ -10,6 +10,7 @@ explains everything they omit.
10
10
  snapshot/
11
11
  ├── .codebase-snapshot ownership marker (see Safety)
12
12
  ├── README.md human summary of this snapshot
13
+ ├── PROMPT.md the instruction sheet to paste with it
13
14
  ├── manifest.json machine index: files, parts, config, hashes, skips
14
15
  ├── parts/
15
16
  │ ├── part-001.md the code, grouped and size-budgeted
@@ -42,6 +43,55 @@ impossible field: a file cannot record its own sha256, so `artifacts.fullJson` i
42
43
  embedded copy and a `selfReference` sentence points at `manifest.json`, which carries the real
43
44
  `byteSize` and `sha256` for that file.
44
45
 
46
+ ## PROMPT.md
47
+
48
+ The one artifact written for the model rather than for you, and the only one that is a *brief*
49
+ rather than an index. Paste it with the payload. It has two halves:
50
+
51
+ **The brief** — what to do and how to be believed:
52
+
53
+ - **The job**: find what is still wrong or will break, with the method left to the reader and an
54
+ honest account of coverage owed in return. A narrower task in the closing slot wins, and the
55
+ standard still applies to it.
56
+ - **The system**, from the manifest: layers and their file counts, the modules with the most
57
+ importers (so a reader knows what a change reaches), entry points by convention, the routes,
58
+ handlers and components the index found — or a plain statement that none were recorded, so a
59
+ model does not go looking for a surface that is not there — the largest files, and the share of
60
+ bytes that is tests.
61
+ - **What came before**: the last ten commit subjects, labelled as claims rather than evidence,
62
+ with the instruction to verify a recorded fix holds instead of rediscovering it. When git
63
+ cannot be read the section says so; it is never invented.
64
+ - **The bar**: quoted lines, the state that reaches them, why the apparent guard does not stop it;
65
+ no style findings, no invented findings, a clean surface proven by quoting the guard.
66
+ - **Coverage**: paths found, included and skipped with reasons, partial files with their missing
67
+ line ranges, redactions, and "everything unseen is unread, never clean".
68
+ - **Calibration**: the classes of defect that do not crash — a guard at one call site and not its
69
+ twin, a budget shorter than the work it guards, a success flag that means the call returned.
70
+
71
+ **The apparatus** — this run only:
72
+
73
+ - the fingerprint to quote back, the timestamp, the commit, whether the tree was dirty, and the
74
+ validation status with the warning that it describes the run and not the tree now;
75
+ - every part by name, and every file not present in full with its reason and missing ranges;
76
+ - the delivery arithmetic below.
77
+
78
+ Everything factual is rendered from the manifest and the repository, so the brief cannot describe
79
+ a different run. It only names artifacts that were actually written: `--skip-artifacts
80
+ parts,audit` produces a brief that does not tell a model to read parts, and says the per-file
81
+ redaction detail is unavailable rather than pointing at a file that is not there.
82
+
83
+ It also does the arithmetic of sending it. Hosted chats take a fixed number of files — 10 is the
84
+ common cap — and every part is one file, so a 12-part snapshot cannot be delivered whole. The
85
+ `## Attaching this` section states which files fit, what to leave behind, and the `--max-part-bytes`
86
+ value that would merge the parts into a number the destination accepts. The instructions themselves
87
+ are pasted as text, so they cost no attachment slot.
88
+
89
+ It only names artifacts that were actually written: `--skip-artifacts parts,audit` produces a
90
+ prompt that does not tell a model to read parts, and says the per-file redaction detail is
91
+ unavailable rather than pointing at a file that is not there. Its digest is recorded under
92
+ `artifacts.prompt`, so editing it by hand makes `validate` fail — a prompt that names a previous
93
+ run's parts is worse than no prompt, because it reads as current.
94
+
45
95
  Every artifact can be turned off. `--skip-artifacts parts` omits the parts,
46
96
  `--only-artifacts manifest` writes nothing but the manifest, and `config.artifacts` does the
47
97
  same persistently. The ownership marker is always written.
@@ -104,13 +154,13 @@ diff the manifest only when you need to know that a run happened.
104
154
  | `generatedAt` | ISO timestamp of the run. |
105
155
  | `generator` | `{ name, version }` of the tool that wrote it. |
106
156
  | `git` | `{ branch, commit, isDirty }`. `branch` falls back to the configured branch on a detached HEAD and outside a repository; `commit` is `"unknown"` and `isDirty` is `false` when git cannot report. A `false` there means "not known to be dirty", not "clean tree" — check `commit` to tell the two apart. |
107
- | `budgets` | The effective byte limits for the run: `{ maxPartBytes, largeFileBytes }`. The per-layer overrides live at `config.budgets`, which is `{ default, byLayer }`. |
157
+ | `budgets` | The effective byte limits for the run: `{ maxPartBytes, largeFileBytes }`. The per-layer overrides live at `config.budgets`, which is `{ default, byLayer }`. With the experimental `maxParts`, `maxPartBytes` here is the budget the run grew to and `config.maxPartBytes` keeps the configured ceiling. |
108
158
  | `config` | The resolved configuration actually used (preset, artifacts, sizing, scoping). |
109
159
  | `counts` | `{ totalFiles, totalSizeBytes, totalLines, partsCount, skippedCount, largeFileCount, truncatedPreviewCount, incompleteCount }`. |
110
160
  | `totals` | Bookkeeping: `{ candidateFiles, includedFiles, fullFiles, previewFiles, skippedFiles, totalSourceBytes, totalContentBytes, sourceLines, emittedLines, estimatedTokens, partCount, warningCount, redactedLines }`. `sourceLines` is the source line count before previews and part budgets; `emittedLines` is what the parts actually carry. `redactedLines` counts the lines whose values were masked — one per line, not one per matching rule — and is what the summary's `Redacted:` line prints. |
111
161
  | `fingerprint` | Stable hash of the snapshot content **and** the settings that shaped it. Two runs over unchanged input and unchanged settings produce the same value; changing the budget, a preset, a layer rule or the secret rules moves it, because the parts move too. It is recomputed by `validate` from `files[]` and `config.digest`, so an edited file list cannot keep the recorded value — and because the partitioner may change a file's `inclusionMode` after the fingerprint is taken, the mode is not part of the hash. |
112
162
  | `validation` | `{ status: "passed" \| "failed", errors: [] }` for the run's own integrity check. |
113
- | `artifacts` | A digest of every artifact the run wrote: `readme`, `navigation`, `projectTree`, `audit`, `fullJson`, `fullMarkdown` and `sarif` when present, each `{ byteSize, sha256 }`. `validate` requires each recorded file to exist and match, so deleting the README or the navigation index is a failure rather than a silent omission. Monolith entries are `null` when the file was not written; a key absent for an older manifest is not drift. |
163
+ | `artifacts` | A digest of every artifact the run wrote: `readme`, `prompt`, `navigation`, `projectTree`, `audit`, `fullJson`, `fullMarkdown` and `sarif` when present, each `{ byteSize, sha256 }`. `validate` requires each recorded file to exist and match, so deleting the README or the navigation index is a failure rather than a silent omission. Monolith entries are `null` when the file was not written; a key absent for an older manifest is not drift. |
114
164
  | `layers`, `kinds` | File counts per layer and per kind. |
115
165
  | `indexes` | Cross-references: `routes`, `components`, `handlers`, `features`, `imports`, `directives`. `imports.byFile` holds one entry per file whose import edges are known — including a previewed or oversized file, whose specifiers are still extracted because they are what makes it a dependent. Such an entry has `exportsOmitted: true`: its `exports` list was never read, and an empty array there would claim "no exports". |
116
166
  | `parts` | One entry per part (below). |
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "codebase-snapshot",
3
- "version": "0.10.2",
3
+ "version": "0.11.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",