edit

edit is a command for Claude Code from coltonbearden/carrel. It costs 42 tokens per session (1,503 once invoked), scanned A, original, MIT.

A command-line tool for making non-destructive changes to PDFs, images, text files, and JSON files. It writes changes beside the source rather than editing the original in place.

In plain words
What is it for?
Use it to merge, split, rotate, or decrypt PDFs; resize or crop images; find and replace text; or set and delete JSON values.
Why use it?
It handles common file changes without requiring separate specialist tools or risking the original file. It can also keep JSON structure valid when changing values by path.

Command for Claude Code

Written for Claude Code: allowed-tools in frontmatter.

Part of the carrel-convert plugin — 6 commands, 1 agent 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/edit
Clone the repo
git clone --depth 1 https://github.com/coltonbearden/carrel

Made for: Claude Code.

Or install carrel-convert, the plugin that ships this one along with the rest of its 6 commands, 1 agent.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for edit

README.md
[![agentmods](https://agentmods.dev/badge/commands/coltonbearden/carrel/edit.svg)](https://agentmods.dev/commands/coltonbearden/carrel/edit)
Your own site
<a href="https://agentmods.dev/commands/coltonbearden/carrel/edit"><img src="https://agentmods.dev/badge/commands/coltonbearden/carrel/edit.svg" alt="Measured on agentmods" height="20"></a>
Per session 42 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,503 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.1 $0.00042 $0.01503
Opus 5 $0.00021 $0.00751
Sonnet 5 $0.00008 $0.00301
Haiku 4.5 $0.00004 $0.00150

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

Security

Grade A, and why

edit 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-convert/commands/edit.md · 113 lines

How it starts

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

Edit the file the user asked about: $ARGUMENTS

Run the carrel CLI via Bash. carrel edit is a group with four subcommands — pdf, image, text, json. Pick the one matching the file type and intent, then map the request onto the real flags in the --help blocks below (regenerated from the CLI by scripts/sync_plugins.py; if the installed carrel edit <sub> --help differs, trust the installed version — never invent flags):

Usage: carrel edit [OPTIONS] COMMAND [ARGS]...

  Edit files in place-adjacent, non-destructive ways (pdf/image/text/json).

Options:
  --json  Machine-readable JSON output.
  --help  Show this message and exit.

Commands:
  image  Resize, rotate, crop, re-encode or strip metadata from an image.
  json   Set or delete values in a JSON file by dotted path (a.b.0.c).
  pdf    Merge, split, extract pages, rotate, linearize or decrypt a PDF.
  text   Find & replace in a text file (txt/md/html/csv/xml/json-as-text).
Usage: carrel edit image [OPTIONS] SRC

  Resize, rotate, crop, re-encode or strip metadata from an image.

  Operation order: crop → resize → rotate.

Options:
  --resize WxH|N%          Resize to WxH or by percent.
  --rotate DEG             Rotate clockwise by DEG degrees (canvas expands).
  --crop X,Y,W,H           Crop box: left,top,width,height.
  --strip                  Drop EXIF/metadata from the output.
  --quality INTEGER RANGE  JPEG/WebP quality (1-100).  [1<=x<=100]
  -o, --out PATH           Output file. Default: SRC.edited.<ext>.
  --force                  Allow overwriting existing files.
  --json                   Machine-readable JSON output.
  --help                   Show this message and exit.
Usage: carrel edit json [OPTIONS] SRC

  Set or delete values in a JSON file by dotted path (a.b.0.c).

Options:
  --set PATH=VALUE  Set dotted PATH to VALUE (parsed as JSON, string fallback). Repeatable.
  --del PATH        Delete dotted PATH. Repeatable; applied after --set.
  -o, --out PATH    Output file. Default: SRC.edited.json.
  --force           Allow overwriting existing files.
  --json            Machine-readable JSON output.
  --help            Show this message and exit.
Usage: carrel edit pdf [OPTIONS] SRC

  Merge, split, extract pages, rotate, linearize or decrypt a PDF.

  Pipeline: decrypt → merge → --pages selection → rotate → write (--split writes one file per page)
  → linearize. --pages extracts: the output contains only the selected pages, so --rotate applies to
  that selection.

Options:
  --merge PATH    Append these PDFs after SRC (repeatable, in order).
  --split         Write one PDF per page into OUT (a directory).
  --pages SPEC    Keep only these pages, e.g. '1-3,7' (1-based).
  --rotate DEG    Rotate output pages clockwise (multiple of 90).
  --linearize     Linearize output for fast web view (qpdf).
  --decrypt PW    Decrypt SRC with password (qpdf).
  -o, --out PATH  Output file (or directory with --split). Default: SRC.edited.pdf / SRC-pages/.
  --force         Allow overwriting existing files.
  --json          Machine-readable JSON output.
  --help          Show this message and exit.
Usage: carrel edit text [OPTIONS] SRC

  Find & replace in a text file (txt/md/html/csv/xml/json-as-text).

  Requires -o OUT or an explicit -i/--in-place — never silently rewrites SRC.

Options:
  --find PAT      Text (or regex) to find.  [required]
  --replace REP   Replacement text (may be empty).  [required]
  --regex         Treat PAT as a Python regular expression.
  -i, --in-place  Rewrite SRC itself.
  -o, --out PATH  Output file.
  --force         Allow overwriting an existing output file.
  --json          Machine-readable JSON output.
  --help          Show this message and exit.

Choosing the subcommand:

  • pdf: merge (--merge repeatable, appended after SRC in order), split into one file per page (--split, -o is then a directory), keep pages (--pages '1-3,7'), rotate, --linearize (qpdf), --decrypt PW (qpdf). Pipeline order is decrypt → merge → pages → rotate → write → linearize.
  • image: --crop X,Y,W,H, --resize WxH|N%, --rotate DEG (applied crop → resize → rotate), --strip EXIF, --quality for JPEG/WebP.
  • text: --find / --replace (--regex for Python regex). It requires either -o OUT or an explicit -i/--in-place — it never rewrites SRC silently. Only pass -i when the user clearly asked to change the file itself.
  • json: --set a.b.0.c=VALUE (VALUE parsed as JSON, string fallback; repeatable) and --del PATH (applied after --set).

Read the full file on GitHub · 113 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 · 113 lines · 42 tokens per session scan A cc21899008bf

Subscribe to this mod's changes

edit is a command published in the GitHub repository coltonbearden/carrel (1 stars, last pushed yesterday), licensed MIT. It adds 42 tokens to every session and 1,503 once invoked, about $0.0002 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-09-05.