paper-trail-registry-cleanup

paper-trail-registry-cleanup is a command for Claude Code from roomi-fields/paper-trail. It costs 109 tokens per session (742 once invoked), scanned A, original, MIT.

A command for cleaning up an entire research-paper registry, including old placeholder entries and duplicate names created by earlier imports.

In plain words
What is it for?
Use it for a broad historical cleanup of a registry containing hundreds of reference records.
Why use it?
It finds incomplete, unnamed, and suspiciously numbered entries, then asks a resolver to merge, complete, or block them instead of editing the registry blindly.

Command for Claude Code

Written for Claude Code: shipped in a Claude Code plugin. Also seen: mentions subagents.

Part of the paper-trail plugin — 6 skills, 22 commands, 6 agents, 3 hooks shipped together

Good fit Use it for a broad historical cleanup of a registry containing hundreds of reference records.

Compare 6 commands from other repositories ↓
Install with agentmods
npx agentmods add commands/roomi-fields/paper-trail/paper-trail-registry-cleanup
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/roomi-fields/paper-trail

Made for: Claude Code.

Or install paper-trail, the plugin that ships this one along with the rest of its 6 skills, 22 commands, 6 agents, 3 hooks.

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 paper-trail-registry-cleanup

README.md
[![agentmods](https://agentmods.dev/badge/commands/roomi-fields/paper-trail/paper-trail-registry-cleanup/github.svg)](https://agentmods.dev/commands/roomi-fields/paper-trail/paper-trail-registry-cleanup)
Your own site
<a href="https://agentmods.dev/commands/roomi-fields/paper-trail/paper-trail-registry-cleanup"><img src="https://agentmods.dev/badge/commands/roomi-fields/paper-trail/paper-trail-registry-cleanup/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 paper-trail-registry-cleanup

Your own site · 80×15
<a href="https://agentmods.dev/commands/roomi-fields/paper-trail/paper-trail-registry-cleanup"><img src="https://agentmods.dev/badge/commands/roomi-fields/paper-trail/paper-trail-registry-cleanup.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 109 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 742 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.00109 $0.00742
Opus 5 $0.00055 $0.00371
Sonnet 5 $0.00022 $0.00148
Haiku 4.5 $0.00011 $0.00074

Measured 11d ago against content hash 13f9ccc64552, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-11, from the pricing page.

Security

Grade A, and why

paper-trail-registry-cleanup 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 11d 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.

commands/paper-trail-registry-cleanup.md · 71 lines

How it starts

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

/paper-trail:registry-cleanup — Nettoyage historique du registre

Distinct de resolve-textbooks (qui est session-locale, ne traite que les refs textbook ingérées sans year/title) : registry-cleanup est global, scanne tout le registre et inclut aussi les duplicates avec suffixes numériques moches.

Usage

/paper-trail:registry-cleanup                  # dry-run (montre les décisions)
/paper-trail:registry-cleanup --apply          # applique

Ce que fait Claude

  1. Liste les candidates :

    python3 -m pipeline registry-cleanup --list > /tmp/registry_cleanup_candidates.json
    

    Inclut :

    • Refs *_0000_* ou _untitled (placeholders INGEST)
    • Refs avec year vide/0000/nd/None
    • Refs avec title vide
    • Refs avec suffixe numérique (_2, _2_3, _2_3_4, etc.) — artefacts des runs précédents
  2. Invoque le sub-agent textbook-resolver avec le JSON :

    Agent(subagent_type="paper-trail:textbook-resolver",
          prompt=<contenu /tmp/registry_cleanup_candidates.json>)
    

    Le sub-agent applique ses règles : merge_into si sibling complet, complete si textbook canonique reconnu, blocked sinon.

  3. Sauve le JSON de décisions dans /tmp/registry_cleanup_decisions.json.

  4. Mode dry-run (défaut) : affiche les décisions par catégorie, demande confirmation avant --apply.

  5. Mode --apply :

    python3 -m pipeline registry-cleanup \
        --apply-from /tmp/registry_cleanup_decisions.json
    

    Les merge_into déclenchent automatiquement sota_sync (les wikilinks dans tous les SOTAs concernés sont mis à jour).

  6. Récap final : N merged + sync, N completed, N blocked.

Quand l'utiliser

  • Après migration vers v0.2.0+ : rattrape les vieux duplicates
  • Tous les 3-6 mois : hygiène registre (au fur et à mesure que le registre accumule des duplicates)

Garde-fous

  • Sub-agent ne fabrique JAMAIS year/title incertain (confidence < 80% → blocked).
  • Fusions traçables : la ref source passe en retracted avec retracted_reason: merged_into:<target>. Réversible via git.
  • Le hook sota_sync automatique met à jour TOUS les SOTAs qui citent les slugs mergés.
  • Backup git du vault avant chaque mutation (_ensure_git_backup).

Read the full file on GitHub · 71 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. 11d ago First seen · 71 lines · 109 tokens per session scan A 13f9ccc64552

Subscribe to this mod's changes

paper-trail-registry-cleanup is a command published in the GitHub repository roomi-fields/paper-trail (5 stars, last pushed 7d ago), licensed MIT. It adds 109 tokens to every session and 742 once invoked, about $0.0005 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.