Run This Ai
EN DE

Repomix Tutorial — Feed Your Repository to Claude, ChatGPT & Gemini

Step-by-step tutorial showing how to use Repomix to feed your codebase to LLMs. Real debugging story, Docker setup, and pro tips included.

Repomix Logo

How to Feed Your Entire Codebase to Claude in 10 Seconds

You've got a bug. A weird one. Claude keeps giving you wrong answers because it can't see the full picture. I've been there — spent 45 minutes copying file after file into the chat window like it's 1999.

Let me show you how Repomix fixes this. I'll walk through a real example — a Next.js project I was debugging last week.

🚀 Want to deploy Repomix yourself?

Docker configs, system requirements, and guides — all on one page.

View Repomix Tool Page →

Installation

You've got three options. Pick whichever feels right.

Option 1: npx (easiest, no install)

npx repomix

This runs it directly. Takes about 3 seconds to download and execute. Perfect for one-off use.

Option 2: npm global install

npm install -g repomix

If you'll use it daily (and trust me, you will), install it globally.

Option 3: Docker

docker run -v ./:/app remyxai/gh-yamadashy-repomix:latest

Mounts your current directory into the container and runs Repomix on it.

⚠️ Docker gotcha: I tried running without the volume mount first. Obviously, the container couldn't see my files. Mount your project root to /app.

Quick Start: Your First Repomix Run

Navigate to your project and run:

cd my-project
npx repomix

You'll see output like this — this is real output from my Next.js project:

📦 Repomix v0.2.27
🔍 Security check enabled
📊 Repository stats:
  • Files: 127
  • Total characters: 284,503
  • Estimated tokens: 71,126
✅ Output: repomix-output.xml (286 KB)

If you see "Security check enabled" — your API keys are being scanned. If it finds any, it'll prompt you before including them.

✅ If you see this output — congratulations, you're done. The file repomix-output.xml is ready to drop into any LLM.

❌ If nothing happens or you get errors — make sure you're in a directory with files. Repomix won't run on an empty folder.


Real Use Case: Debugging a Next.js Auth Bug

Here's what actually happened to me. I had a Next.js app where the auth callback kept failing — but only in production. The error message was useless: "Invalid state parameter."

I spent an hour looking at the auth route handler. Nothing wrong there. Then the API client. Nothing. Then I gave up and ran Repomix on the whole project:

npx repomix

I uploaded repomix-output.xml to Claude and said: "Find the auth state bug."

Claude found it in 12 seconds. — the middleware.ts file (which I'd forgotten to check) was overriding the session cookie on every request, wiping the OAuth state before the callback could read it. The middleware was in the root of the project, separate from the auth route. I'd never have connected those two files manually.

That one debugging session paid for all the time I spent learning Repomix.

Pro Tips (Learned the Hard Way)

Use --style markdown for ChatGPT. ChatGPT handles markdown better than XML. Claude is fine with XML, but for GPT, try:

npx repomix --style markdown

Filter files with --include. Don't need your test files? Exclude them:

npx repomix --ignore "**/*.test.ts,**/*.spec.ts"

Piping mode for agents. Repomix can pipe directly into MCP tools. If you're using Claude Code or Cline, configure Repomix as an MCP server and let the agent call it when needed.


Performance & Resource Usage

Metric Value
Cold start (npx)~3 seconds
100 files processed<2 seconds
500 files processed~5 seconds
RAM usage~50-80 MB
Output size (100 files)~200-500 KB

Final Thought

Repomix is one of those rare tools that instantly becomes part of your workflow. You'll wonder how you lived without it. Install it now — even if you don't need it today, you will.

🚀 Explore Repomix on Run This Ai

Docker Compose configs, system requirements, installation guides, and more — all in one place.

View Repomix Tool Page →
#repomix #tutorial #cli #debugging #docker