Personal Python 2

snaprepo

Format codebases for AI tools — create context-optimized snapshots of your repository.

ai-toolsclideveloper-toolscontext-window

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 .gitignore and 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.