Repomix codebase packer

From CarlosCaPe/octorato · View interactive version

Repomix codebase packer is an AI agent skill from the GitHub repository CarlosCaPe/octorato. Packs a whole repo, local or remote, into a single LLM-optimized file, with Tree-sitter compression (~70% fewer tokens) and secret scanning. For auditing an entire repo or preparing subagent context.

How to use this skill

Skill file

Repomix — Codebase to Single AI-Friendly File

Packs a repo into one structured file (XML / Markdown / JSON / plain text) with metadata, directory tree, per-file token counts, and optional compression. Respects .gitignore, includes Secretlint to flag secrets before you paste into an LLM.

Repo: https://github.com/yamadashy/repomix · MIT · npx repomix@latest

When to use

When NOT to use

Install

# zero-install (recommended for ad-hoc)
npx repomix@latest

# global
npm install -g repomix

Core commands

# pack current directory → repomix-output.xml
repomix

# Markdown output (easier to skim in a code review)
repomix --style markdown

# Tree-sitter compression — drops bodies, keeps signatures (~70% fewer tokens)
repomix --compress

# scope: include/exclude
repomix --include "src/**/*.ts" --ignore "**/*.test.ts,**/*.spec.ts"

# pack a remote repo without cloning
repomix --remote yamadashy/repomix
repomix --remote https://github.com/CarlosCaPe/octorato --remote-branch main

# split output if it blows the context window
repomix --split-output 1mb

# include git context for "why" questions
repomix --include-logs --include-diffs

# token distribution by directory (find the heavy folders before packing)
repomix --token-count-tree 1000

MCP server mode (registered in this brain)

This brain has repomix registered as an MCP server. Inside Claude Code you can call its tools directly without shelling out:

# registration command (already executed for this brain — for reference only)
claude mcp add repomix -- npx -y repomix --mcp

When the MCP is active, Claude can request pack_codebase, pack_remote_repository, and related tools as native tool calls — no temp file roundtrip.

Patterns for this brain

Arm code review. Inside an arm repo: repomix --compress --style markdown --ignore "**/node_modules/**,**/.next/**,**/dist/**" → paste into Claude with prompt "act as Code Reviewer agent, audit this for security + maintainability".

External OSS audit. Before adopting a new dependency: repomix --remote <org/repo> --compress → ask Claude for license risk, maintainer activity, abandoned-fork detection. Pair with bruno-postman-alternative / tabularis-db-client evaluations.

Subagent prep. When dispatching an Explore or general-purpose agent for whole-repo questions, pack first and hand it the file path — saves the agent N tool calls and keeps token cost predictable.

Pre-paste safety. Always skim the Secretlint warnings printed by repomix before pasting into ANY external LLM. The brain rule "never echo back user-provided secrets" applies to whole-repo dumps.

Companion skills

Caveats

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.