repomix-pack

A tool that combines a whole codebase, or selected folders, into one compact file. A codebase is all the source code and related files in a project.

In plain words
What is it for?
Use it when an analysis needs context from the entire repository, such as a security audit, architecture review, or project-wide refactor.
Why use it?
It gives another analysis tool one consistent snapshot of the project instead of making it repeatedly open many separate files.

Cursor rule for Cursor

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add rules/surya8991/agentmaster/repomix-pack
Clone the repo
git clone --depth 1 https://github.com/Surya8991/AgentMaster

Made for: Cursor.

Per session 86 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 1,077 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00086 $0.01077
Opus 5 $0.00043 $0.00539
Sonnet 5 $0.00017 $0.00215
Haiku 4.5 $0.00009 $0.00108

Measured yesterday against content hash 8a51f7801ac5, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

repomix-pack scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured yesterday.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.cursor/rules/repomix-pack.mdc · 107 lines

How it starts

The opening of the file, as written. The whole thing — 107 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Repomix Pack — Whole-Codebase Snapshot

You are the repomix bridge skill. Your job: produce a single compact file representing the current repo state, then hand off to the next skill in the chain.

ARGUMENTS: {{ARGUMENTS}}

When to Use

Invoke this skill when ANY of these signal words appear:

  • "entire codebase", "whole repo", "across the project", "all files"
  • "full audit", "full security scan", "architecture review"
  • "onboard me to this repo", "understand this codebase"
  • "refactor X across the codebase", "find all usages of"
  • Whenever security-audit or codereview is invoked on the repo as a whole (not a diff)

Do NOT use for:

  • Single-file tasks (Read the file directly)
  • Diff-based code review (use codereview on the diff)
  • Targeted exploration (use smart-explore instead — AST-based, cheaper)

Preflight Check

# 1. Confirm repomix is installed
which repomix || npm install -g repomix

# 2. Confirm we're in a git repo (repomix works best with one)
git rev-parse --show-toplevel 2>/dev/null || echo "WARN: not a git repo"

If repomix is missing and npm is unavailable, abort and tell the user: "Install Node + repomix: npm install -g repomix".

Default Pack Command

# Pack to a stable path under the repo's .agentmaster/ dir
mkdir -p .agentmaster
repomix --style xml -o .agentmaster/codebase.xml \
  --ignore "**/node_modules/**,**/dist/**,**/build/**,**/.next/**,**/coverage/**,**/*.lock,**/*.log,**/.agentmaster/**,**/.git/**"

If a .repomixignore exists in the repo, repomix picks it up automatically — do not pass --ignore in that case.

Argument Handling

ARGUMENTS pattern Action
empty Pack the whole repo with default ignores (above)
include <glob> repomix --include "<glob>" -o .agentmaster/codebase.xml --style xml
remote <url> repomix --remote <url> --style xml -o .agentmaster/codebase.xml
refresh Delete .agentmaster/codebase.xml first, then re-pack
stdout Run repomix --stdout --style xml and stream directly into the next skill

Read the full file on GitHub · 107 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. yesterday First seen · 107 lines · 86 tokens per session scan A 8a51f7801ac5

Subscribe to this mod's changes

repomix-pack is a cursor rule published in the GitHub repository Surya8991/AgentMaster (2 stars, last pushed 1mo ago), licensed MIT. It adds 86 tokens to every session and 1,077 once invoked, about $0.0004 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.