refs

refs is a command for Claude Code from coltonbearden/carrel. It costs 30 tokens per session (966 once invoked), scanned A, original, MIT.

A command for finding reference numbers in local files and showing which files share them. It can identify values such as invoice, purchase-order, bank, tax, and tracking numbers, and can tag matching files.

In plain words
What is it for?
Use it to search folders for financial and other identifiers, link documents with the same reference, and tag matching files.
Why use it?
It removes the need to open files one by one to find identifiers and discover related documents. It also validates some reference types before reporting them.

Command for Claude Code

Written for Claude Code: allowed-tools in frontmatter.

Part of the carrel-finance plugin — 1 skill, 2 commands, 1 agent shipped together

Good fit Use it to search folders for financial and other identifiers, link documents with the same reference, and tag matching files.

Compare 6 commands from other repositories ↓
Install with agentmods
npx agentmods add commands/coltonbearden/carrel/refs
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.

Clone the repo
git clone --depth 1 https://github.com/coltonbearden/carrel

Made for: Claude Code.

Or install carrel-finance, the plugin that ships this one along with the rest of its 1 skill, 2 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 refs

README.md
[![agentmods](https://agentmods.dev/badge/commands/coltonbearden/carrel/refs/github.svg)](https://agentmods.dev/commands/coltonbearden/carrel/refs)
Your own site
<a href="https://agentmods.dev/commands/coltonbearden/carrel/refs"><img src="https://agentmods.dev/badge/commands/coltonbearden/carrel/refs/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for refs

Your own site · 80×15
<a href="https://agentmods.dev/commands/coltonbearden/carrel/refs"><img src="https://agentmods.dev/badge/commands/coltonbearden/carrel/refs.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 30 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 966 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
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.00030 $0.00966
Opus 5 $0.00015 $0.00483
Sonnet 5 $0.00006 $0.00193
Haiku 4.5 $0.00003 $0.00097

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

Security

Grade A, and why

refs 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 today.

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-finance/commands/refs.md · 51 lines

What it actually says

Find the reference numbers the user asked about: $ARGUMENTS

Run the carrel CLI via Bash. Map the request onto the real flags in the --help block below (regenerated from the CLI by scripts/sync_plugins.py; if the installed carrel refs --help differs, trust the installed version — never invent flags):

Usage: carrel refs [OPTIONS] PATHS...

  Find reference numbers (invoice, PO, IBAN, routing, tracking, …) in PATH...

  Directories are walked like `index` (hidden and .gitignored entries skipped; images only with
  --ocr). Every supported file type works; the text comes from the same spine `pack` and `index`
  use. Values with a check digit (iban, routing, isbn, gtin, cc) are reported only when it verifies.
  JSON output is a list of {path, refs: [{kind, value, count, valid, pages, lines}]} — or, with
  --link, [{kind, value, files, count}]. Kinds are shared with `redact --builtin`.

Options:
  --kind K1,K2          Only these kinds, comma-separated. Default: every reference and identifier
                        kind (invoice, po, order, check, account, tracking, ticket, iban, routing,
                        ein, vat, isbn, gtin, doi, ups, usps); PII kinds (email, phone, ssn, ipv4,
                        cc) only when named.
  --pattern NAME=REGEX  Extra kind to look for (repeatable). A (?P<v1>…) group is the value;
                        otherwise the whole match is.
  --tag                 Tag each file in the desk db under --root with ref:<kind>:<value>.
  --link                Group by reference instead of by file: which files share each value.
  --all                 With --link, also list values seen once.
  --ocr                 OCR images and scanned PDFs (needs tesseract / ocrmypdf).
  --fail-empty          Exit 5 when no reference was found.
  --json                Machine-readable JSON output.
  --help                Show this message and exit.
  • Start with carrel --json refs PATH... on the files or folder in question; every supported type works (PDF, docx, xlsx, md, txt, eml, …) and PDFs report page numbers.
  • "Which files mention invoice X" / "what belongs together" → --link (values seen in more than one file; --all lists every value).
  • "Tag them" / "link them in the desk" → --tag writes ref:<kind>:<value> tags into the desk db under the global --root (default cwd); afterwards carrel tag find ref:invoice:inv-2026-0042 and carrel search QUERY --tag ref:... find every document carrying that reference.
  • Narrow with --kind invoice,po,iban; the PII kinds (email, phone, ssn, ipv4, cc) are only scanned when named. Add a house format with --pattern NAME=REGEX (a (?P<v1>…) group is the value).
  • Values with a check digit (IBAN, routing, ISBN, GTIN, card) are only reported when it verifies ("valid": true); other kinds carry "valid": null.
  • Scanned PDFs and images need --ocr (tesseract); a missing binary exits 3 with the install hint — report it rather than guessing.

Report what was found conversationally: per file, the kinds and values (with pages), then any shared references. The same kinds are available to /carrel-documents:redact --builtin when the user wants them removed instead.

Requires the carrel CLI on PATH. If carrel is not found, tell the user to install it with uv tool install carrel (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. today First seen · 51 lines · 30 tokens per session scan A d39915cf6ddb

Subscribe to this mod's changes

refs is a command published in the GitHub repository coltonbearden/carrel (1 stars, last pushed today), licensed MIT. It adds 30 tokens to every session and 966 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-11.