codebase-snapshot

4 min read · by

codebase-snapshot vs repomix

Both tools answer the same question — how do I hand a whole repository to a model that cannot clone it? They disagree about almost everything else. This page states where each one is the better choice, including where repomix clearly is.

Written by the author of codebase-snapshot. Numbers are the maintained project's own claims at the time of writing, and the comparison is deliberately unkind to this project where it deserves it.

The short version

repomix packs a repository into one AI-friendly file. It is the established tool in this space by a wide margin — tens of thousands of stars, an MCP server, remote repository URLs, and an ecosystem of integrations.

codebase-snapshot produces size-budgeted parts rather than one file, and treats the snapshot as something that can go stale and be proven current. Its distinguishing features are a hard byte ceiling per part, deterministic output, and validate.

If you want the most popular, most integrated tool: use repomix.

Side by side

codebase-snapshot repomix
Output shape Multiple parts, each under a hard byte budget, plus a JSON manifest A single packed file (XML, Markdown or JSON)
Hard size ceiling Yes — maxPartBytes is a ceiling, not a target Token counting and warnings; no per-artifact ceiling
Reproducible output Parts are byte-identical across runs; a fingerprint covers them Content is stable; no published determinism guarantee
Staleness check validate re-hashes the repository and exits non-zero on drift Not a feature
Remote repositories No — operates on a local checkout Yes — packs a GitHub URL directly
MCP server Yes — seven tools over stdio, and it serves the validated snapshot rather than the working tree Yes — packs a repository, including by URL
Secret handling 30 default rules, value-span masking, per-line audit table Secretlint integration
Language awareness 25 presets, AST or structural summaries labelled by confidence Tree-sitter parsing with a compression mode
Adoption New Mature — large user base, many integrations
Runtime Node.js ≥ 18, one dependency Node.js, npm package

Where repomix is the better choice

Where this is the better choice

Both at once

There is no conflict. A common arrangement is to use this tool for the budgeted, validated case (CI, RAG ingestion, anything automated) and repomix when a human wants one file to paste into a chat. They read the same repository and write to different directories.

npx codebase-snapshot setup          # config, scripts, dependency, install, generate
npx codebase-snapshot validate       # exit 0 means the snapshot matches the disk

Honest summary

repomix is the safer recommendation for most people today, because maturity and integrations matter more than any single feature. This tool exists for the narrower case where a size ceiling, a drift check and reproducibility are requirements rather than nice-to-haves — and for the case where an agent has to operate it without a human reading the docs first.