← Journal
Check a Repository Before Handing It to an LLM: Running repomix

Check a Repository Before Handing It to an LLM: Running repomix

A record of running repomix without network access. The CLI bundles an entire repository into one file for an LLM, and I checked its token breakdown and built-in secret scan.

Repository covered in this article

yamadashy/repomix

📦 Repomix is a powerful tool that packs your entire repository into a single, AI-friendly file. Perfect for when you need to feed your codebase to Large Language Models (LLMs) or other AI tools like Claude, ChatGPT, DeepSeek, Perplexity, Gemini, Gemma, Llama, Grok, and more.

27.2k TypeScript MIT License

Before you hand an entire repository to an LLM, check two things: the token count and whether you might include a key or credential by mistake. Manual checks take time. You may end up handing over the repository without running them. repomix handles both tasks while it bundles a repository into one file. I built it and ran it against its own source.

repomix scans a repository and combines its file list, directory structure, and file contents into one file. It runs a built-in secret scan during that process. The project publishes its source under the MIT License (*1).

1. Install it

repomix uses Node.js and has few dependencies. The container image took little time to build.

FROM docker.io/library/node:24.18.0-slim
RUN npm install -g repomix@1.16.1
WORKDIR /work
podman build -t repomix-sandbox .

2. Pack its own source

I used repomix's own src directory as the target. I ran the command without network access.

podman run --rm --network none --memory 2g --cpus 2 --pids-limit 512 --userns=keep-id \
  -v "$(pwd)":/work -w /work repomix-sandbox \
  repomix src --style markdown --output /work/output.md

-v makes the specified directory available for reads and writes inside the container. Use an empty directory reserved for the experiment, and do not place private keys or credentials in it.

The command produced this output:

📈 Top 5 Files by Token Count:
──────────────────────────────
1.  core/skill/skillTechStack.ts (4,837 tokens, 19,462 chars, 3.4%)
2.  core/file/fileSearch.ts (4,408 tokens, 19,575 chars, 3.1%)
3.  cli/cliRun.ts (3,929 tokens, 16,962 chars, 2.8%)
4.  core/output/outputGenerate.ts (3,750 tokens, 16,895 chars, 2.6%)
5.  core/metrics/tokenCountCache.ts (3,599 tokens, 14,905 chars, 2.5%)

🔎 Security Check:
──────────────────
✔ No suspicious files detected.

📊 Pack Summary:
────────────────
  Total Files: 137 files
 Total Tokens: 142,511 tokens
  Total Chars: 604,068 chars
       Output: output.md
     Security: ✔ No suspicious files detected

You can use the per-file token counts to identify the files that contribute the largest share of the total before you hand it over. repomix uses @secretlint/secretlint-rule-preset-recommend as-is, a common preset in the JS/TS ecosystem. I confirmed its use under src/core/security/. The target contained no suspicious files, so the scan ended with “no suspicious files.” The scan found nothing to flag in this target. The run does not test the scan's detection accuracy. Before handing over a repository that contains keys or credentials, review the result yourself and treat it as one check.

The generated output.md starts with an explanation of the file format, the directory structure, and instructions for loading the “Repository Instruction” supplied by the repository. repomix adds a usage guide for its LLM reader because users can hand the packed result to an LLM as the next step.

Review token volume and risk before handoff

You need two routine checks when handing a codebase to an LLM: estimate the token volume and assess the risk. repomix combines both in one command, so you can complete them as it packs the repository. The tool makes these checks part of its default operation, so you do not need to decide what to inspect before each handoff.

Sources

*1 repomix (GitHub), https://github.com/yamadashy/repomix, MIT License