Anti-hallucination plugin for academic research in Claude Code. Create literature reviews and papers guaranteed without fabricated citations.
$ npx -y skills add roomi-fields/paper-trail --agent claude-code
What's inside
Anti-hallucination plugin for academic research in Claude Code. Create literature reviews and papers guaranteed without fabricated citations.
Citation hallucinations in academic writing — fabricated quotes, inverted attributions, misidentified authors — are systemic when the author writes from memory and looks up sources afterward. Retracted papers from major venues have shown the failure mode is structural, not anecdotal.
paper-trail makes the error mechanically impossible by enforcing
a research-first workflow with strict state transitions, automated PDF
acquisition with anti-homonymy validation, and per-citation audit
against the actual source text.
docs/ACQUISITION_HEADFUL.mdDISCLAIMER.mdRECEIPTS.md classifying each
citation as VALID / ADJUST / INVALID / UNVERIFIABLEpaper-trail's acquisition cascade and search layer cover the major academic indexing and full-text platforms.
| Source | Coverage | Used for |
|---|---|---|
| Crossref | Cross-domain DOI registry, 150M+ records | DOI lookup, metadata, open-access URL |
| arXiv | Preprints (CS, math, physics, q-bio, q-fin, stats, EE) | Full-text PDFs of preprints |
| OpenAlex | 200M+ scholarly works, cross-domain aggregator | Metadata, abstracts, citation graph |
| Unpaywall | 30M+ free full-text articles | OA PDF discovery |
| HAL | French academic repository | Full-text, OA |
| CORE | UK-based aggregator, 200M+ OA records | Full-text fallback |
| archive.org | Digitized books and articles, Internet Archive | Books, older publications, scans |
| Semantic Scholar | AI-curated academic graph, 200M+ papers | Cross-reference, related papers |
| PubMed / PMC / bioRxiv / medRxiv | Biomedical, preprints | Biomedical full-text |
| Zenodo / SSRN / DBLP / DOAJ / BASE / IACR / EuropePMC | Cross-domain | Additional metadata and full-text |
| Source | Coverage | Activation |
|---|---|---|
| Sci-Hub | Paywalled scholarly literature, ~88M papers | RESEARCH_ENABLE_SHADOW_LIBS=1 |
| Anna's Archive | Books and articles, aggregates Library Genesis, Sci-Hub, Z-Library | RESEARCH_ENABLE_SHADOW_LIBS=1 |
| Anna's Archive via browser | Same coverage, when the plain HTTP route is blocked | Above + Playwright + a display — see docs/ACQUISITION_HEADFUL.md |
Shadow-library activation is explicit and per-session. A
disclaimer prints to stderr on first use. The user is responsible
for legal compliance in their jurisdiction. See
DISCLAIMER.md.
Anna's Archive now answers the plain HTTP route with an anti-bot
challenge, and its file server rejects a headless browser. The browser
route drives a windowed Chromium instead — which runs fine in a
container with no screen, inside a virtual display. It adds itself to the
cascade only when Playwright and a display are both present, and says so
on stderr when they are not; everything else keeps working without it.
docs/ACQUISITION_HEADFUL.md has the
container recipe and the scheduled-job command.
| MCP | Coverage | Status |
|---|---|---|
| paper-search MCP | Unified API over 22 platforms above | Required for SOTA writing — install from git (see INSTALL.md) |
| NotebookLM MCP | Books corpus (Q&A with citations) | Optional — RESEARCH_ENABLE_NOTEBOOKLM=1 |
| RTFM MCP | Local indexed corpus (code, docs, research) | Optional — failure correlation only |
⚠️ Do not install
paper-search-mcpfrom PyPI — the published version (0.1.3) is severely outdated (13 / 63 tools, no OpenAlex, no Crossref, no Semantic Scholar). Use the git HEAD recipe inINSTALL.md.
In a Claude Code session:
/plugin install file:///path/to/paper-trail
Or via marketplace (when published):
/plugin marketplace add roomi-fields
/plugin install paper-trail
RESEARCH_VAULT_PATH is required — the plugin refuses to start
without it. Set it (and any reusable secret like S2_API_KEY) once
in ~/.config/paper-trail/env so every project picks them up
automatically :
mkdir -p ~/.config/paper-trail
cat > ~/.config/paper-trail/env <<'EOF'
RESEARCH_VAULT_PATH=~/Documents/MyResearch
RESEARCH_CONTACT_EMAIL=you@example.org
S2_API_KEY=s2k-...
EOF
chmod 600 ~/.config/paper-trail/env
Per-project shell overrides take priority. For complete configuration,
see INSTALL.md.
python3 -m pipeline preflight
Reports vault, Python deps, paper-search MCP registration, and any
missing optional secret — with a copy-pastable fix command for each
problem.
/paper-trail:status # overview of the registry
/paper-trail:new-sota "your research topic"
/paper-trail:audit-article path/to/your/paper.tex
Three primary workflows, all enforced by the plugin's state machine and pre-write hooks:
/paper-trail:new-sota "topic"
paper-search MCPpage1_validated state; rejected candidates are listed with
reasons/paper-trail:audit-sota path/to/SOTA.md [--purge]
/paper-trail:audit-article path/to/paper.tex [--warn]
Classifies each citation, optionally purges hallucinations from the
SOTA (with .bak backup), or inserts inline warnings adjacent to
problematic citations in the paper.
/paper-trail:cascade <slug> # acquire a specific reference
/paper-trail:doctor [--fix] # check and repair registry consistency
/paper-trail:reactivate-ocr # resume OCR-waiting refs
User → 9 slash commands → 6 skills → 4 sub-agents → Worker engine
↓
YAML registry
See docs/ARCHITECTURE.md for the full
diagram and pipeline/ARCHITECTURE.md
for the worker engine internals.
docs/USAGE.md — daily workflowsdocs/ARCHITECTURE.md — system overviewdocs/ACQUISITION_HEADFUL.md — running
browser-based acquisition in a headless container (virtual display,
scheduled job)docs/LEGAL.md — licensing and attributionDISCLAIMER.md — shadow libraries opt-in policyNOTICE.md — third-party attributionsCHANGELOG.md — version history| Variable | Default | Purpose |
|---|---|---|
RESEARCH_VAULT_PATH | — (required) | Vault root — plugin refuses to start without it |
RESEARCH_SOURCES_PATH | $VAULT/10_SOURCES | PDF directory |
RESEARCH_REGISTRY_PATH | $SOURCES/_registry | YAML registry |
RESEARCH_VAULT_LAYOUT | obsidian | Adapter (obsidian / flat / zotero) |
RESEARCH_RTFM_DB | unset | Optional RTFM SQLite DB for failure correlation |
RESEARCH_CONTACT_EMAIL | anonymous@example.org | Email sent to Crossref, Semantic Scholar (politeness) |
S2_API_KEY | unset | Optional Semantic Scholar API key (stricter rate limit without) |
RESEARCH_ENABLE_SHADOW_LIBS | unset | Enable Anna's Archive & Sci-Hub (opt-in, see DISCLAIMER) |
RESEARCH_ANNAS_HEADFUL_BUDGET_S | 600 | Per-reference time budget for the browser route, in seconds |
RESEARCH_BROWSER_COOKIES | unset | Your own session cookies, exported to a JSON file — enables the ResearchGate route |
RESEARCH_BROWSER_PROFILE | ~/.cache/paper-trail/browser-profile | Where the shared browser keeps its profile |
RESEARCH_LIBGEN_MIRRORS | built-in list | Comma-separated Library Genesis mirrors to try |
RESEARCH_MIN_BOOK_PAGES | 30 | Page floor below which a file is not the book it claims to be |
RESEARCH_ENABLE_NOTEBOOKLM | unset | Enable NotebookLM in sota-writer phase A |
RESEARCH_SKIP_END_DOCTOR | unset | Skip the SessionEnd consistency check |
The PROJECT_AUTHORS whitelist used by the Semantic Scholar resolver
(group names treated as anonymous in queries — e.g. "Anonymous", "Group")
is loaded from $XDG_CONFIG_HOME/paper-trail/project_authors.txt
(default ~/.config/paper-trail/project_authors.txt), one entry per line.
The file is optional; if absent the whitelist is empty.
MIT — see LICENSE.
This plugin builds on patterns and components from several open-source
projects in the Claude Code ecosystem. See NOTICE.md
for detailed attributions.
Issues and pull requests welcome at github.com/roomi-fields/paper-trail/issues. The plugin is in active development; structural changes may happen between minor versions before v1.0.
FAQ
paper-trail is a Claude Code plugin with 6 hand-picked skills for content work, indexed on Flowy. Install it with the command on its page. It includes citation-receipts, paper-writer, pdf-cascade. Its skills do not fire on their own yet. Request auto-invocation to have Flowy route them as you prompt. Free and open source.
Is this plugin yours?
Claim it with GitHubSubmit a pluginPromote it