Pack Codebases for Web-Only AI with Repomix
Bundle any repo into one AI-ready file with Repomix so frontier models locked inside a web UI without repo access can plan and audit your code.

How do you give a web-only AI model full repository context?
Run npx repomix inside your project directory to bundle your repository into a single structured repomix-output.xml file, then upload or paste that artifact into any frontier model's web UI. You get whole-repo planning and architecture audits from browser-only models that cannot connect to your local workspace or Git repositories.
Frontier models frequently surface inside web chats, search modes, or preview tabs before they arrive in your IDE, CLI agent, or subscription tier. Here is a real example from how I work at ZeroShot Studio: my Google AI Pro subscription does not include direct access to Gemini Carbon, yet switching to AI Mode in Google Web Search unlocks that model in the browser. Because the search UI has no repository connector, I pack the target project with Repomix and upload the bundle there to plan architecture changes and audit my source.
The workflow is completely model-agnostic. Whenever a capable model sits behind a browser text box with zero GitHub integration or local file access, one packed bundle bridges the gap without changing your tooling or exposing write permissions.
flowchart LR
Repo["Local Project or GitHub Repo"] --> Filter[".gitignore + --include / --ignore"]
Filter --> Scan["Secretlint Security Check"]
Scan --> Compress["Optional --compress (Tree-sitter)"]
Compress --> Output["repomix-output.xml / .md"]
Output --> WebAI["Upload to Any Web-Only AI UI"]
WebAI --> Review["Plan Architecture & Audit Code Locally"]What is Repomix and why does it work without repo connectors?
Browser-based AI interfaces often feature huge context windows, yet their attachment workflows break down on multi-file repositories. Dragging raw folders into a chat drops nested directory hierarchy or trips file-count caps, while copy-pasting isolated snippets strips away imports, type definitions, and call sites.
Repomix eliminates that friction in a single command. It writes a file summary, renders the complete directory tree, and wraps every module in explicit path tags so any web model understands how components wire together. You can inspect the source and full flag reference on the Official GitHub Repository or the CLI Documentation.
How do you pack a project in under 60 seconds?
You do not need a global install or a project config file to start. Node.js 18+ and npx are enough to generate your first bundle.
-
Pack the current directory. Run the default command from your project root to generate
repomix-output.xmlusing your existing.gitignorerules.npx repomix -
Target a specific subsystem. For monorepos or multi-service projects, pass only the directory you want the web model to audit or plan against so you do not waste context on unrelated packages.
npx repomix packages/api --include "src/**/*.ts,package.json" --ignore "**/*.test.ts" -
Pack a remote GitHub repo without cloning. When you want to audit an external library or compare an upstream pattern in a web session, point
--remoteat the repository slug.npx repomix --remote yamadashy/repomix -
Check your token footprint. Add
--token-count-treewith a threshold to spot bloated files before you upload.npx repomix --token-count-tree 500 --top-files-len 10
If you already tune context files for local coding agents, the same discipline applies here: tighter, higher-signal context produces sharper architectural plans. We covered a similar token-trimming approach in Cut CLAUDE.md Token Overhead.
How do you shrink large repos with Tree-sitter compression?
When a full project blows past your web interface's upload or token ceiling, add --compress. Repomix uses Tree-sitter to strip function bodies and implementation noise while preserving class signatures, function definitions, interfaces, and imports.
We tested npx repomix (v1.19.0) on a 12-file Python automation pipeline directory at ZeroShot Studio to measure the exact difference:
- Standard pack (
npx repomix): 12 files, 66,477 tokens (201,368 characters). The largest rendering module alone consumed 15,666 tokens. - Compressed pack (
npx repomix --compress): 12 files, 33,448 tokens (88,203 characters). That same rendering module dropped from 15,666 to 5,517 tokens, cutting total bundle size roughly in half.
The trade-off is straightforward: --compress is ideal when you hand a project to a web model for high-level planning, dependency mapping, or architectural audits, but it is the wrong flag when you are hunting a logic bug inside a specific function body. In that case, skip --compress and use --include to pack only the 4 or 5 files involved in the bug.
Which output format and flags should you choose?
XML is the default for good reason: frontier models parse XML tag boundaries reliably when separating your prompt instructions from source files. Still, Markdown, JSON, and split outputs each earn their keep depending on the web UI you are feeding.
| Option | Flag | Best Use Case | Trade-off |
|---|---|---|---|
| XML output | --style xml | Default for web UI uploads across Gemini, Claude, and ChatGPT | Slightly higher tag overhead than plain text |
| Markdown output | --style markdown | Readable bundles you want to inspect before uploading | Nested triple backticks can collide without --parsable-style |
| Tree-sitter compress | --compress | Architecture planning and audits on large repos | Strips function bodies needed for line-level debugging |
| Split large bundles | --split-output 2mb | Repos that exceed web attachment size limits | Requires uploading multiple numbered parts in order |
| Git context | --include-diffs --include-logs | Auditing uncommitted changes or recent regressions | Adds extra tokens from commit history and diffs |
| Clipboard copy | --copy | Small subdirectories pasted straight into browser chat or search AI mode | Only practical under ~30,000 tokens |
Two extra flags are worth knowing for repeatable workflows:
--output-show-line-numbersprefixes every line with its line number, which makes the web model's audit findings and refactor notes much easier to trace locally.--token-budget 150000fails the command with a non-zero exit code if your bundle exceeds a set token ceiling, keeping you from generating an oversized artifact by mistake.
How do you prevent secret leaks before uploading?
Every time you upload local source to a browser chat or search AI interface, you are trusting that nothing sensitive slipped into the bundle. Repomix runs a built-in Secretlint check on every item it packs before writing the output.
In our 12-file test run, the security pass checked every file automatically and reported zero suspicious files before writing the XML artifact. If Secretlint flags an API key, private key, or credential pattern, the CLI excludes that entry and warns you in the terminal summary.
For a broader checklist on catching leaked credentials and exposed routes in AI-built apps, see Security Audit Your Vibe-Coded App.
How do you prompt a web UI model to plan and audit your code?
Once repomix-output.xml is attached (or pasted via --copy when a browser UI only accepts text input), treat the session like a principal architecture review or audit rather than a vague chat. Tell the model what the artifact represents, state your goal, and require exact path citations so you can verify every claim against your local repo.
Here is the prompt template I use when handing a packed repo to a web-only model like Gemini Carbon in Google Search AI Mode:
The attached repomix-output.xml contains the source tree for [service/module].Read the directory structure and entry points first.Task: [Audit for security/reliability gaps | Plan the architecture for [feature] | Diagnose [bug]].Constraints:- Reference exact file paths and line numbers from the bundle.- Do not invent files, symbols, or dependencies outside the bundle.- Flag any missing context or files you need unpacked in full next.- Output implementation steps or changes as unified diffs per file.That third constraint keeps your token budget lean. If you packed with --compress or --include to fit a browser cap, the model will tell you which 2 or 3 files it wants unpacked in full, and you can generate a tiny follow-up bundle in 5 seconds. When you want to automate quality checks on the patches or drafts those workflows produce, pair this with AI Review Agents for a Content Pipeline.
FAQ
Does Repomix work with private repositories without sending source to a third-party server? Yes. The CLI runs locally on your machine via Node.js. Nothing leaves your laptop until you manually upload or paste the generated bundle into a web AI interface.
Should I use --compress every time I pack a project?
No. Use --compress when you want a web model to map architecture, plan a refactor, or audit cross-module boundaries under a tight token cap. Skip --compress and narrow the scope with --include when you need line-by-line debugging inside function bodies.
What if a web UI does not accept XML file uploads, or my bundle is too big?
Use --style markdown --copy to paste smaller subsystems straight into browser text boxes like search AI modes, or use --split-output 2mb (or 500kb) to break large bundles into numbered parts such as repomix-output.1.xml and repomix-output.2.xml.
Can I pack a public GitHub repo just to audit an upstream library?
Yes. Run npx repomix --remote owner/repo and Repomix clones it into a temporary directory, packs the repository, and cleans up without cluttering your workspace.