# Codebase snapshot FAQ

Short answers to the questions people ask before using codebase-snapshot. Each answer links to
the page with the full detail.

## What is a codebase snapshot?

A codebase snapshot is a bounded, indexed copy of a repository prepared for a language model:
source files are packed into Markdown parts under a byte budget, and a manifest records every
included file, every skipped path with the reason, and every file that had to be shortened. The
point is not to copy the repository; it is to produce context a reader can inspect and a pipeline
can validate.

## How is this different from repomix or gitingest?

repomix and gitingest pack a repository into one AI-readable document. codebase-snapshot also
partitions the output, records why each path was included or skipped, redacts secret-shaped values,
and can prove the snapshot still matches the tree. That last property is the main difference: a
packed file cannot tell you it is stale. See the honest comparisons with
[repomix](vs-repomix.md), [gitingest](vs-gitingest.md) and [code2prompt](vs-code2prompt.md).

## Does codebase-snapshot send my code anywhere?

No. The CLI and the MCP server run locally. They read a directory you name and write a directory
you name. There is no account, no upload and no telemetry. A remote source is fetched only when you
explicitly pass a URL with --remote, and that path is documented in
[remote sources](remote.md).

## Which languages are supported?

TypeScript and JavaScript get the deepest parser and symbol support. Python, Go, Rust, Java/Kotlin,
C#/.NET, PHP, Ruby, C/C++, Vue, Svelte and Astro have language profiles for classification, imports
and previews. Every file type can still be included as text when the profile has nothing to add.
See [configuration](configuration.md) for the preset and layer rules.

## How do I feed a whole repository to Claude or ChatGPT?

Generate a snapshot, attach the parts the prompt tells you to attach, and paste the instructions
from PROMPT.md. If the repository does not fit the destination's file limit, increase the part
budget or scope the run to the folders you are asking about. The end-to-end recipe is
[Feeding a codebase to an LLM](how-to-feed-a-repo-to-claude.md).

## How many tokens is my codebase?

A rough estimate is bytes divided by 3.5, or lines multiplied by 11. Source code is denser than
English prose, so a 1 MB repository is usually around 285,000 tokens, not 250,000. The tool reports
the estimate it actually used in manifest.totals.estimatedTokens. The arithmetic and a table of
budgets are in [How many tokens is a codebase?](codebase-token-budget.md).

## What is the MCP server for?

The MCP server exposes the repository to an MCP client as seven tools (six read-only): impact, context,
locate, read, validate, explain and generate. Instead of attaching a 12-part snapshot, an agent can
ask for the one part, symbol or changed-file report it needs. Setup, tool schemas and the security
boundary are in [MCP server for a codebase](mcp-server-for-codebase.md).

## How do I keep a snapshot from going stale?

Run validate after the code changes. It re-hashes the files and exits non-zero when the snapshot no
longer matches the tree, so a CI job or a pre-commit hook can refuse stale context. The MCP read
tools use the live tree by default, so an agent sees uncommitted edits without regenerating. See
[Stale context is your bug](stale-context-is-your-bug.md).

## Does it include .env files or secrets?

Credential files such as .env, .pem, .npmrc, .ssh and .tfstate are excluded by default and recorded
as skipped. Secret-shaped values inside ordinary files are replaced with a marker; the audit
artifact names the file and line but never the value. If you explicitly pass
--include-sensitive-files, the MCP and serve transports refuse to serve that snapshot. Read the
[security review](security-review.md) for the exact guarantees and residual risks.

## Can I use it in CI?

Yes. generate writes the snapshot, validate exits non-zero on drift, and health --strict fails on a
critical integrity or secret finding. The CLI keeps progress on stderr and JSON on stdout, so a
pipeline can parse it. A typical job is: generate once on the base branch, validate on every pull
request, and upload the parts as an artifact only when they are current.

## Does it work with monorepos and Windows?

Yes. A workspace run writes one snapshot per member plus a WORKSPACE.json index; Windows paths,
junctions and OneDrive rename failures are handled explicitly. The output directory is only
replaced when the tool can prove it wrote it. See [workspaces](workspace.md) and the
[troubleshooting guide](troubleshooting.md).

## Is it free, and how is it maintained?

MIT licensed, with no paid tier and no hosted service. The project is maintained in public; the
test suite, security review, changelog and source are all in the repository. If you need a
guarantee for a regulated environment, commission your own review rather than treating a README
as one.

## What is a token budget?

A token budget is the number of model tokens a run is allowed to spend on context. In this tool it
is expressed as a byte ceiling per part (maxPartBytes), because the partitioner enforces bytes and
estimates tokens. The budget is a hard ceiling: a file that does not fit is shortened with an
explicit omission record, never silently overflowed. See
[Budgeting LLM context](how-to-context-budget.md).

## What is agent experience?

Agent experience (AX) is whether an agent can fetch, read and act on a site or tool without a human
translating for it. For documentation that means static HTML, clear headings, stable URLs, a
machine-readable contract and bounded responses. The evidence behind that claim is summarised in
[AX is the New AEO](https://arxiv.org/abs/2609.34951) and [What Drives AI Citations?](https://arxiv.org/abs/2610.15033).

## Related

- [About this project](about.md)
- [All documentation](contents.md)
- [Glossary](glossary.md)
