paper-trail-purge

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

A command for finding and cleaning invalid links to paper references in a State-of-the-Art review, a document that summarizes current research on a topic.

In plain words
What is it for?
Use it to preview or apply repairs to broken reference links in one review document.
Why use it?
It removes links to withdrawn, orphaned, malformed, or technical files while leaving the reference registry unchanged and creating a Git backup before applying edits.

Command for Claude Code

Written for Claude Code: shipped in a Claude Code plugin.

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

Good fit Use it to preview or apply repairs to broken reference links in one review document.

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

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

Your own site · 80×15
<a href="https://agentmods.dev/commands/roomi-fields/paper-trail/paper-trail-purge"><img src="https://agentmods.dev/badge/commands/roomi-fields/paper-trail/paper-trail-purge.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 84 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 608 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.00084 $0.00608
Opus 5 $0.00042 $0.00304
Sonnet 5 $0.00017 $0.00122
Haiku 4.5 $0.00008 $0.00061

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

Security

Grade A, and why

paper-trail-purge 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 10d 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-purge.md · 53 lines

What it actually says

Étape 2 du pipeline cible refondu. Scanne tous les wikilinks d'un SOTA et corrige les 6 cas invalides connus. Ne touche pas au registre (c'est /paper-trail:arbitrate ou :registry-cleanup qui font ça).

Usage

/paper-trail:purge <SOTA-path>           # dry-run (montre le plan)
/paper-trail:purge <SOTA-path> --apply   # applique + backup git

Ce que fait Claude

  1. Vérifie git initialisé dans le vault (sinon refuse).

  2. Lance le plan :

    python3 -m pipeline purge <SOTA-path>
    

    Affiche le récap : combien de wikilinks invalides par catégorie, avec les 15 premiers détails (numéro de ligne, wikilink, action prévue).

  3. Si --apply :

    python3 -m pipeline purge <SOTA-path> --apply
    

    Commit git auto avant modification, applique les substitutions et suppressions, affiche le compte final.

Les 6 cas détectés

Cas Détection Action
A wikilink vers ref state=retracted avec retracted_reason=merged_into:X remplace par [[X]]
A' wikilink vers ref state=retracted pure strip (garde texte humain)
B wikilink vers lastname_0000_* avec sibling lastname_YYYY_* validé remplace par sibling
C wikilink avec suffixe numérique moche (_2_3, _2_3_4) strip
D wikilink vers fichier technique (path 20_ATLAS/, 30_DEV/, ext .canvas) strip
D' wikilink vers slug non-bibliographique TitleCase (IR_Spec_Preliminaire) strip

Style

  • Concis. Une phrase par étape.
  • En cas d'erreur (SOTA introuvable, backup git échoué), explique et propose un retry.
  • Pas de modification du registre (pas d'effet de bord).
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. 10d ago First seen · 53 lines · 84 tokens per session scan A fdf12a3207d4

Subscribe to this mod's changes

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