Repomix: Pack Your Entire Codebase into a Single AI-Friendly File
Why This Matters
Ever tried feeding your entire codebase to an LLM like Claude or ChatGPT, only to hit token limits or struggle with messy file uploads? Repomix solves that. It’s a clever tool that bundles your repository—files, structure, and all—into a single, cleanly formatted file optimized for AI consumption. No more manual copy-pasting or juggling context windows.
What It Does
Repomix scans your repository, intelligently excludes noise (like node_modules
), and generates a consolidated file with:
- Directory structure (as comments)
- File contents (with syntax highlighting preserved)
- Configurable filters (ignore files, limit sizes, etc.)
The output is a .repomix
file that’s easy to share, archive, or—most importantly—paste directly into an LLM prompt.
Why It’s Cool
- AI-First Design: Optimized for LLM context windows, with smart truncation for large files.
- GitHub Integration: Works as a CLI or GitHub Action, so you can automate it in CI/CD.
- Cross-Tool Compatibility: Tested with Claude, ChatGPT, Gemini, and others.
- Lightweight: Written in TypeScript (MIT licensed), so it’s easy to hack on.
How to Try It
- Install:
npm install -g repomix
- Run it in your repo:
repomix pack
- Get a
your-repo.repomix
file. Done.
Or check the live demo to see it in action.
Final Thoughts
Repomix isn’t revolutionary—it’s practical. If you’ve ever wasted time stitching together code snippets for an AI, this tool cuts that friction to near zero. It’s especially handy for:
- Debugging with LLMs
- Onboarding new devs (share a snapshot of the repo)
- Archiving projects
The code’s on GitHub, and at 17k+ stars, it’s clearly hitting a nerve. Worth a look.
Pro tip: Pair it with a .repomixignore
file (like .gitignore
) to skip irrelevant files.