How I Stopped Claude Code from Inventing DOIs and Misquoting PDFs

When you use AI coding agents (Claude Code, Cursor, Codex) heavily for technical literature surveys and debugging notes, two failure modes show up almost immediately:
- Fabricated or mismatched DOIs: The model writes a clean summary table with plausible-looking DOIs that either don't exist (
404) or point to a completely different paper. - Subtle number & quote drift: The original PDF says
"five datasets", and the summary becomes"5 datasets". Or a component part number likeSM15T30Agets misread as a current rating"30 A". Worse, dumping multi-column raw PDFs into context burns tokens and scrambles reading order.
So I built Paper Library Kit (plk) — an MIT-licensed, Git-native literature knowledge graph and deterministic verification CLI (with an optional stdio MCP server) designed for AI coding agents.
Try It in 10 Seconds (Zero PDFs Needed)
In v0.2.0, plk bundles a 15-paper real AI-Agent & RAG demo library (Attention Is All You Need, RAG, Chain-of-Thought, ReAct, Toolformer, Self-RAG, GraphRAG, etc.) so you can test search and evolution graph traversal without preparing local PDFs:
pip install paper-library-kit plk --lang en demo Or launch the stdio MCP server directly on the bundled demo library via uvx:
uvx --from "paper-library-kit[mcp]" plk mcp --demo - GitHub: https://github.com/Debiddo0506/paper-library-kit
- Live 16-paper interactive evolution graph: https://debiddo0506.github.io/paper-library-kit/
- Glama MCP Listing & Inspector: https://glama.ai/mcp/servers/Debiddo0506/paper-library-kit
1. Catching Fake DOIs Live (plk verify)
Instead of trusting DOIs generated in Markdown research notes, plk verify extracts every DOI in a document, queries Crossref, and checks normalized title similarity between the claimed title in your note and Crossref's actual record:
| Verdict | Sim | DOI | Crossref Actual Title | In Lib | |----------------------|------|----------------------------|-------------------------------------------|--------| | OK | 1.00 | 10.48550/arxiv.2210.03629 | ReAct: Synergizing Reasoning and Acting | M01 | | MISMATCH (wrong ref) | 0.14 | 10.1109/jssc.2020.9999999 | Unrelated Journal Article | — | Even a single command against your survey Markdown catches swapped or hallucinated references before they enter your repo.
2. Deterministic Quote + Unit-Adjacency Gate (plk cards / plk check)
Rather than using fuzzy matching (which silently accepts subtle number changes), plk enforces strict substring verification against the extracted Markdown (=== p.N ===) after normalizing deterministic PDF extraction artifacts:
- Unicode NFKC normalization for ligatures (
fi/fl→fi/fl) and full-width characters - Soft hyphen / zero-width character stripping (
\u00ad,\u200b,\ufeff) - Line-break hyphen rejoining (
exam- ple→example) only between lowercase letters - Adjacency regex check ensuring the claimed number and unit appear next to each other inside the cited
«quote»
If the paper says "five datasets" and an agent summarizes "5 datasets", the entry is rejected immediately:
✗ [number not found] M05: 5 datasets @ plug-and-play retrieval correction evaluation ✗ [value not in quote] M05: 5 «Experiments on five datasets demonstrate that CRAG» 3. Low-Friction Importers & Git-Native Architecture
Everything lives in plain text (triage.tsv, core_tags.tsv, cite_audit.tsv, meta.yaml) while raw copyrighted PDFs remain in a local archive excluded from Git.
To make onboarding from existing workflows fast, v0.2.0 ships with:
-
plk import-bib refs.bib: Pure-Python BibTeX parser that cleans LaTeX accents, maps arXiveprintfields to DOIs, deduplicates against existing papers, and scaffoldsingest_bib.tsv+meta.yaml. -
plk ingest --arxiv 2310.06770: Fetches arXiv Atom metadata + PDF and converts multi-column pages into paged Markdown (=== p.N ===) + cropped figures. -
plk graph build: Compiles semantic relations (builds_on,improves,tradeoff) and 4-source citation audits into a single zero-backend interactive HTML timeline. - Claude Code Hook + MCP Server:
.claude/hooks/paper_hint.pyproactively surfaces top relevant papers when recurring issues show up, whileplk mcp(contributed in our first external PR by@Boulea7, now on PyPI & Official MCP Registryio.github.Debiddo0506/paper-library-kit) exposessearch,show,neighbors, andpath.
{ "mcpServers": { "paper-library": { "command": "uvx", "args": [ "--from", "paper-library-kit[mcp]", "plk", "mcp", "--demo" ] } } } What's Next & Contributing
Core CLI only requires pyyaml (PyMuPDF and mcp are optional extras), and CI runs on Linux, Windows, and macOS across Python 3.10–3.13.
If you build research workflows or agent tooling, we have open good first issue tickets (Marker/Docling backend, Obsidian Vault exporter, BM25 full-text ranking fallback, Cursor/Windsurf adapters, and domain presets). Check out the repo and let me know what PDF/citation failure mode bites your workflow most!