Codebase Snapshot logo

Codebase Snapshot

Creates bounded, redacted repository context with manifests, drift validation, impact analysis, and review briefs.

Install Codebase Snapshot

Run the project’s own setup commands, in order.

Setup steps from the project

codebase-snapshot installs with its own steps rather than a config we can generate, so these are copied as-is. Follow them in order and run the commands in a terminal. Source: github.com

  1. 1. Install
    npm install -D codebase-snapshot      # or add it to a project
    

Overview

The codebase-snapshot MCP server turns a local repository into bounded, verifiable context for AI-assisted development. It indexes the working tree in memory, includes uncommitted changes, redacts sensitive content, and can persist a structured snapshot with Markdown parts and a manifest. Its repository workflows cover impact analysis, question-focused briefs, snapshot generation, and validation. Reach for it when an agent needs repository context that remains within a byte budget and can be checked against the source tree.

Use cases

  • Generate a bounded repository snapshot for an AI prompt
  • Analyze the files affected by a Git diff
  • Create a focused brief about a codebase question
  • Validate that a stored snapshot still matches the working tree
  • Explain why a repository path was skipped

Key features

  • Byte-bounded Markdown parts
  • Manifest of included, skipped, and incomplete files
  • Secret redaction and audit reporting
  • Git diff impact analysis
  • Drift validation with hashes and fingerprints
  • Support for multiple programming languages

Security & health

What it can reach and how reliably it runs — from our own checks, not the maintainer’s claims.

ActiveLast checked

Recent health check succeeded.

Adoption & maintenance

Factual signals from GitHub, npm, and our automated checks — not a rating.

GitHub stars2Stargazers on the source repository.
npm downloads10kPackage downloads in the last 30 days.
Last commit1d agoMost recent push to the default branch.

How Codebase Snapshot works

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:

Terminal
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:

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

Written by AllMCPs with AI assistance from the project’s README and listing data. How we build listings

Reviews

No reviews yet — be the first to share how it worked for you.

Frequently Asked Questions about Codebase Snapshot

codebase-snapshot is an MCP server that connects AI clients to a local code repository and provides repository-context tools for impact analysis, question-focused briefs, and snapshot generation. It creates bounded, redacted Markdown context with a manifest, while validation checks whether the snapshot still matches the working tree.

Install it with npm or run it through npx. Use `npm install -g codebase-snapshot` for the `snapshot` command, or run `npx codebase-snapshot generate` without a global install. Node.js 18 or newer is required.

Run `npx codebase-snapshot generate`, or use `snapshot` after a global installation. The generated artifacts are written to `./snapshot/`, including Markdown parts, a manifest, prompt instructions, and reports.

Run `npm run snapshot:validate` or the corresponding `validate` command. Validation compares repository file hashes and the generation settings with the stored snapshot and exits nonzero when drift is detected.

Yes, codebase-snapshot is listed for Cursor as an MCP client. It is also described as working with Claude and ChatGPT, and its repository-context workflows can provide bounded snapshots, briefs, and impact information.

Related MCP servers

Add a badge to your READMEShow it’s listed — live SVG, Markdown or HTML.

AllMCPs Directory Badge

Full Badge Customizer

Showcase your server listing on GitHub or your project documentation. Embed this dynamic SVG badge to highlight official listing status and live engagement.

Badge Style:
Live Dynamic SVG PreviewCodebase Snapshot AllMCPs Directory Badge
Markdown (GitHub README)
[![AllMCPs](https://allmcps.com/api/badge/codebase-snapshot?style=directory)](https://allmcps.com/mcp/codebase-snapshot)
HTML Embed
<a href="https://allmcps.com/mcp/codebase-snapshot"><img src="https://allmcps.com/api/badge/codebase-snapshot?style=directory" alt="Codebase Snapshot on AllMCPs" /></a>