What Output Formats Does Repomix Support for AI Tools?
Updated
Repomix packs a local or remote repository into a single AI-friendly file, and you can choose between XML, Markdown, JSON, or plain text output. The right format depends on which AI tool consumes it and whether you need machine-parseable structure or a compact, readable dump. XML is the default-style choice for structured prompts, Markdown suits chat tools and code review reading, JSON fits programmatic pipelines, and plain text is the simplest fallback when you just want raw content.
The four output formats
| Format | Best for | Trade-off |
|---|---|---|
| XML | Structured prompts to Claude, ChatGPT, Gemini; MCP workflows | Verbose tags add tokens |
| Markdown | Human reading, code review, chat context | Less rigid for parsers |
| JSON | Scripts, automation, downstream tooling | Escaping can inflate token count |
| Plain text | Minimal overhead, quick paste | No structure or metadata |
Repomix's page lists these as the pack output formats, alongside options that shape what goes inside the pack.
What you can include alongside the format
Format is only part of the output. Repomix also exposes toggles that change the file's contents:
- Include / ignore patterns — glob patterns to select or exclude files.
- File summary — a per-file overview.
- Directory structure — a tree of the repo.
- Line numbers — useful when you want the AI to cite specific lines.
- Parsable format — escapes the output according to the chosen style schema. The page notes this can increase token count, so enable it only when a downstream parser needs it.
Reducing tokens before you pick a format
Two file-processing options matter more than format choice for large repos:
- Compress code — uses Tree-sitter to extract essential code signatures and structure while removing implementation details, "significantly reducing token usage."
- Remove comments and remove empty lines — straightforward trims.
If you are near a context limit, compress first, then decide on format. A compressed XML pack is often smaller than an uncompressed plain-text one.
How to choose
- Feeding a chat assistant or reviewing code yourself → Markdown.
- Building a prompt with clear file boundaries for Claude, ChatGPT, or Gemini → XML.
- Wiring Repomix into a script or MCP pipeline → JSON, with parsable format on only if the consumer requires it.
- Fastest possible paste with no metadata → plain text.
For most one-off AI conversations, start with the default and switch to JSON only when something downstream needs to parse the output.