This free tool packs your whole codebase into one file an AI can read. I tested Repomix
Key takeaways
- Repomix packs an entire code repository into one tidy file you can paste straight into ChatGPT, Claude or Gemini
- Setup difficulty: easy. One npx command, no install, ran in about three seconds
- It counts your tokens, scans for leaked secrets, and can compress big repos by roughly 40 percent
- Worth it if you regularly ask an AI about a whole project instead of a single file
Here is a job everyone who codes with AI knows. You want ChatGPT or Claude to understand your whole project, not one stray file. So you open ten tabs, copy ten files, paste them one by one, and lose track of which is which. By file four the model has forgotten file one.
Repomix kills that chore. It is a free, open source tool that scoops up an entire repository and packs it into one tidy file built for AI to read. I did not just skim the docs. I installed it and threw real code at it.
What it actually does
You point Repomix at a folder or a GitHub link, and it hands you back a single document with every file laid out and labelled. You paste that into your AI tool of choice and ask away. It works with Claude, ChatGPT, Gemini, Grok, whatever you like, because the output is just plain text in a clean structure.
I ran it on real repos
Setup was one command. I used `npx repomix` so there was nothing to install first, and it packed a small ten-file project in about three seconds.
The numbers are the useful part. That little repo came out at 11,243 tokens in Repomix's default format. The same repo in Markdown format ballooned to 17,929 tokens, so the default actually saves you money on every prompt. It also printed a neat list of which files were eating the most tokens, with the test file and the licence hogging more than half between them.
Then I pointed it at a bigger codebase over a thousand files. It packed the lot in two seconds flat.
The bits that surprised me
Two features earn their place. First, it scans for secrets before it hands anything over. My packs came back with a clean "no suspicious files detected", which is a real safeguard when you are about to paste your code into a chatbot. Nobody wants an API key going for a walk.
Second, there is a compress option that uses code parsing to strip out the filler and keep the structure. On my test repo it cut the output from 48,420 characters down to 28,262, roughly 40 percent smaller, without losing the shape of the code.
The catch
That thousand-file repo packed into 1.2 million tokens. Most AI models choke long before that. So on anything large you cannot just dump the whole thing in. You need the compress flag, or you point Repomix at only the folders you care about. It is a tool you run from a command line too, so it suits people comfortable typing a command rather than clicking a button.
The verdict
Setup difficulty: easy. Worth it if you regularly ask an AI about a whole project, review pull requests with a model, or want a chatbot to learn a codebase before you ask it anything. It is free, fast, and the secret scanning alone makes it worth a look. If you only ever ask about one file at a time, you do not need it. For everyone else feeding code to AI, it quietly removes a daily annoyance.