# codebase-snapshot [Health: Active]

**Category:** 💻 Developer Tools  
**Repository:** https://github.com/ankurhalder/codebase-snapshot  
**GitHub Stars:** 2  
**npm Downloads (last month):** 10196  
**Views:** 0  
**Installs:** 0  
**Upvotes:** 0  
**Directory Page:** https://allmcps.com/mcp/codebase-snapshot

## 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.

## Claude Desktop Quick Installation
No generated config for this server: it installs through its own setup steps.

The project's own setup steps (from https://github.com/ankurhalder/codebase-snapshot), copied verbatim. Follow them in order; they are not an mcpServers config.

1. Install:

```sh
npm install -D codebase-snapshot      # or add it to a project
```

## Documentation

## What codebase-snapshot does

codebase-snapshot packages a repository into context that an AI model can inspect without relying on an unbounded source dump. Its primary output is a snapshot directory containing Markdown parts, a machine-readable manifest, a prompt file, and reports. The parts are size-bounded; files that cannot fit completely are represented with head and tail content plus an omission marker.

The manifest records included files, skipped paths, file hashes, parts, languages, structural information, and reasons for exclusion. It also tracks incomplete files and the line ranges omitted from them. Reports can include a project tree, navigation between repository layers and parts, and an audit covering secrets, large files, parser diagnostics, and Git state.

## How it works

The tool indexes the working tree locally and overlays uncommitted edits for operations that run without an existing snapshot. `impact --diff HEAD` identifies the reach of changes, while `brief` creates a focused context package for a question such as how authentication works. `generate` writes a persistent snapshot under `./snapshot/` that can be shared with a prompt, chat, retrieval pipeline, or repository review.

A hard `maxPartBytes` ceiling controls each generated part. Files are classified and filtered with reasons recorded rather than silently omitted. Repeated runs over unchanged input produce identical content parts and the same manifest fingerprint, apart from artifacts that contain run-specific metadata. `validate` re-hashes the repository and checks the generation settings, returning a nonzero exit status when the source tree or relevant configuration has drifted.

## Setup and configuration

Node.js 18 or newer is required. Use the package through an npm installation, a project dependency, or `npx`:

```bash
npm install -g codebase-snapshot
npx codebase-snapshot generate
```

The global installation provides the `snapshot` command. In a project, initialization can create configuration, scripts, a development dependency, and a `.gitignore` entry:

```bash
npx codebase-snapshot init --yes
npm install
npm run snapshot
npm run snapshot:validate
```

Running `snapshot` interactively detects the project and walks through setup. `npx codebase-snapshot --autopilot` is available for unattended runs. TypeScript and JavaScript receive primary support, with recognition also covering Python, Go, Rust, Java and Kotlin, C#/.NET, PHP, Ruby, C/C++, Vue, Svelte, and Astro.

## Tools and capabilities

- Generate a persistent, shareable repository snapshot.
- Produce question-focused briefs from the indexed working tree.
- Analyze the files reached by a Git diff.
- Validate snapshot hashes and generation settings against the repository.
- Explain why an individual path was included or skipped.
- Redact sensitive content and record exclusions in the manifest.

## Limitations and notes

The package is in the 0.x release line, so its CLI surface may change between minor releases. A snapshot is bounded context rather than a complete repository copy. Oversized files may be partial, and excluded paths remain outside the emitted code while their reasons appear in the manifest.

The output directory is managed defensively: generation uses a scratch directory and an atomic swap, and it refuses to replace a directory it did not create. The tool also avoids writing to the repository during in-memory impact and brief operations. The project is licensed under MIT.

_Full upstream README: https://allmcps.com/mcp/codebase-snapshot/readme_

