# Repomix (VYAGENT Radar #05)

> Pack an entire repository into a single AI-friendly XML or Markdown file with .gitignore filtering, secret scanning, and token counts.

- **URL**: https://vyagent.com/radar/repomix
- **Published**: 2026-11-25
- **Category**: CLI & MCP · Codebase Context
- **License**: MIT
- **Pricing**: Free & Open Source (MIT)
- **Agent Ready**: CLI, MCP, Local-first, Open Source
- **Source**: https://github.com/yamadashy/repomix
- **Package / Docs**: https://repomix.com/

## 1. Friction Solved
When asking a long-context model for an architectural audit, security review, or refactor plan, manually copying twenty files into chat loses directory structure and risks accidentally pasting .env secrets. Repomix packages any local or remote repo cleanly while respecting ignore rules and running Secretlint checks locally.

## 2. Best-Fit Scenarios
- Preparing a clean, structured codebase snapshot for deep architecture or security reviews in long-context LLMs.
- Onboarding onto an unfamiliar open-source GitHub repository in minutes via `npx repomix --remote owner/repo`.
- Checking exact per-file token budgets before deciding which folders to include in an automated review prompt.

## 3. Setup (One-Line CLI & Tree-Sitter Compression)
```
# Pack current repository into repomix-output.xml (respects .gitignore)
npx repomix

# Compress to signatures/interfaces (~70% fewer tokens) in Markdown format
npx repomix --compress --style markdown --output context.md

# Pack a public GitHub repo directly without cloning
npx repomix --remote yamadashy/repomix --include "src/**/*.ts"
```

## 4. Reality Check & Trade-offs
- Large monorepos easily exceed even 200K–1M token windows; always scope with --include/--ignore or enable --compress for big projects.
- Secretlint catches common API key patterns, but custom internal tokens or proprietary business data still require human review before sending to cloud models.
- Tree-sitter --compress strips function bodies—great for architecture maps, unsuitable when debugging a subtle line-level bug.

## 5. Editorial Verdict
A clean Unix-style utility that bridges local Git repos and long-context models without forcing you into a proprietary IDE or cloud indexer.

## 6. FAQ
### How does Repomix keep binary files and node_modules out of the bundle?
It automatically honors .gitignore, .repomixignore, and default ignore lists for lockfiles, build artifacts, and binaries.

### Which output style works best for LLMs: XML, Markdown, or plain text?
XML is the default because explicit file tags help models avoid confusing code blocks with prompt instructions; Markdown is easier for humans to skim.
