codebase-snapshot 0.20.13 → 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 (50) hide show
  1. package/CHANGELOG.md +33 -6
  2. package/README.md +41 -19
  3. package/SECURITY.md +2 -2
  4. package/dist/bin.js +12482 -10348
  5. package/dist/{chunk-GNVRD7XS.js → chunk-TDPYLX7X.js} +6062 -4438
  6. package/dist/cli.cjs +11759 -9645
  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 +6037 -4435
  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 +10231 -4354
  17. package/dist/mcp.d.cts +13 -7
  18. package/dist/mcp.d.ts +13 -7
  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 +100 -25
  28. package/docs/codebase-token-budget.md +14 -13
  29. package/docs/contents.md +66 -0
  30. package/docs/deploy.md +2 -2
  31. package/docs/faq.md +112 -0
  32. package/docs/glossary.md +152 -0
  33. package/docs/health.md +1 -1
  34. package/docs/how-to-feed-a-repo-to-claude.md +6 -0
  35. package/docs/impact.md +102 -0
  36. package/docs/install.md +4 -3
  37. package/docs/llm-codebase-context.md +166 -0
  38. package/docs/mcp-server-for-codebase.md +155 -0
  39. package/docs/mcp.md +43 -66
  40. package/docs/migration.md +83 -90
  41. package/docs/output.md +1 -3
  42. package/docs/security-review.md +8 -8
  43. package/docs/slice.md +1 -1
  44. package/docs/tools.md +159 -185
  45. package/docs/troubleshooting.md +11 -11
  46. package/docs/vs-code2prompt.md +7 -0
  47. package/docs/vs-gitingest.md +7 -0
  48. package/docs/vs-repomix.md +10 -1
  49. package/docs/workspace.md +1 -1
  50. package/package.json +8 -2
@@ -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.13",
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
  },