pack

A command that combines selected files or folders into one document formatted for an AI coding tool. It can produce Markdown, XML, or JSON, limit the amount of content, split large output into parts, and optionally include only the folder structure.

In plain words
What is it for?
Preparing code context for an AI assistant, narrowing files with include or exclude patterns, checking packing statistics, and creating chunked context files.
Why use it?
It avoids manually collecting project context and helps keep the result within file-size or token limits.

Command

Part of the carrel-inspect plugin — 1 skill, 4 commands shipped together

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 commands/coltonbearden/carrel/pack
Clone the repo
git clone --depth 1 https://github.com/coltonbearden/carrel

Or install carrel-inspect, the plugin that ships this one along with the rest of its 1 skill, 4 commands.

Per session 28 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 593 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.00028 $0.00593
Opus 5 $0.00014 $0.00296
Sonnet 5 $0.00006 $0.00119
Haiku 4.5 $0.00003 $0.00059

Measured 2d ago against content hash e76a92194e5f, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

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 2d ago.

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.

plugins/carrel-inspect/commands/pack.md · 30 lines

What it actually says

Pack these paths into an LLM-ready context document: $ARGUMENTS

Run the carrel CLI via Bash. Map the user's request onto these real flags of carrel pack (verify with carrel pack --help if unsure — never invent flags):

carrel pack PATHS... [-o FILE] [--format md|xml|json] [--include GLOB] [--exclude GLOB]
            [--no-gitignore] [--max-bytes N] [--max-file-bytes N] [--chunk TOKENS]
            [--tree-only] [--ocr] [--stats]
  • --format md (default) = header + fenced tree + per-file fenced sections; xml = <context><tree/><file/></context> with CDATA (Claude-friendly); json = {meta, tree, files}.
  • -o FILE: write to a file instead of stdout — strongly prefer this for anything nontrivial so stdout stays readable.
  • --include/--exclude GLOB (repeatable): narrow what gets packed.
  • --chunk TOKENS (requires -o): split into OUT.part1..N, each within the token budget.
  • --max-bytes / --max-file-bytes N: byte budgets; omissions are noted in the pack header.
  • --tree-only: structure without contents — good first pass on unknown folders.
  • --stats: per-file token table (the pack is still written when -o is given).
  • --ocr: also read images/scanned PDFs (needs tesseract/ocrmypdf).
  • .gitignore is honored by default (--no-gitignore disables); .git and .carrel are always skipped; unsupported binaries are listed in the tree, never inlined.

Workflow: for an unfamiliar or large folder, run --stats or --tree-only first to gauge size, then pack with an appropriate --chunk/--exclude. Afterwards report the output path(s) and the token estimate, and consult the context-packing skill of this plugin for budgeting guidance.

Requires the carrel CLI on PATH. If carrel is not found, tell the user to install it with uv tool install <path-to-carrel-repo> (see the repo's INSTALL notes), or run it as uv run carrel ... from the carrel repo root.

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. 2d ago First seen · 30 lines · 28 tokens per session scan A e76a92194e5f

Subscribe to this mod's changes

pack is a command published in the GitHub repository coltonbearden/carrel (1 stars, last pushed 21d ago), licensed MIT. It adds 28 tokens to every session and 593 once invoked, about $0.0001 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.