diff

A command for comparing two local files, including text, structured data, PDFs, and images.

In plain words
What is it for?
Use it to compare text files, JSON, CSV, or XML data, PDF text, or image pixels; image comparisons can also produce a difference heatmap.
Why use it?
It explains what changed and distinguishes differences from actual command failures, instead of leaving you to inspect raw output.

Command

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/diff
Clone the repo
git clone --depth 1 https://github.com/coltonbearden/carrel
Per session 29 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 430 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.00029 $0.00430
Opus 5 $0.00015 $0.00215
Sonnet 5 $0.00006 $0.00086
Haiku 4.5 $0.00003 $0.00043

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

Security

Grade A, and why

diff 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.

plugins/carrel-inspect/commands/diff.md · 25 lines

What it actually says

Compare the two files the user asked about: $ARGUMENTS

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

carrel diff A B [--mode auto|text|struct|image|pdf] [--out FILE] --json
  • --mode auto (default) picks by type pair; only override when the user asks for a specific comparison:
    • text: unified diff.
    • struct: json (dotted-path added/removed/changed), csv (per-row/column cell changes), xml (element-path changes).
    • pdf: extracted-text diff plus page counts.
    • image: Pillow pixel diff — dimensions, changed-pixel percentage, mean channel delta.
  • --out FILE (image mode only): writes a per-pixel delta heatmap PNG — offer this when comparing images.

Interpret the exit code first: 0 = identical, 1 = files differ (that's data, not an error), 2 = bad usage, 3 = missing optional dependency (pdf mode needs pdftotext — relay the install hint), 4 = missing/unsupported input or no mode fits the type pair. Then summarize the differences for the user: what changed, where, and how much — not a raw dump.

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. yesterday First seen · 25 lines · 29 tokens per session scan A d16cc8a29953

Subscribe to this mod's changes

diff is a command published in the GitHub repository coltonbearden/carrel (1 stars, last pushed 20d ago), licensed MIT. It adds 29 tokens to every session and 430 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.