snaprepo
Format codebases for AI tools — create context-optimized snapshots of your repository.
What it does
snaprepo creates formatted snapshots of your codebase optimized for pasting into AI assistants. It respects .gitignore, supports custom include/exclude patterns, and outputs a single text block with file paths and contents ready for LLM consumption.
Key features
- Smart filtering — respects
.gitignoreand supports glob-based include/exclude patterns - Token-aware — estimates token count to help you stay within context limits
- Multiple output formats — plain text, XML tags, or Markdown code blocks
- Tree view — optional directory tree prepended to output
Tech stack
Python CLI using pathspec for gitignore matching and tiktoken for token estimation.