A Claude Code skill that enforces fetch-and-verify before any URL reference is written into a file. Before inserting a citation, preprint link, repo link, or any URL that comes with descriptive text (author, year, title, venue), the skill fetches the target and checks that every descriptor matches.
Built after a real incident where a research report named the wrong first author for a paper cited by URL. The model can remember a URL incorrectly; the fetched page is authoritative.
Two Python scripts (stdlib-only, no pip install) do the heavy lifting:
scripts/verify_reference.py— verify one reference. Takes a URL plus any of--author,--year,--title,--venue. Emits a JSON report with averdictofmatch,mismatch, orunverified.scripts/batch_verify.py— verify many references in parallel. Takes a JSON array from stdin or a file.
Target types supported:
| URL pattern | Metadata source |
|---|---|
arxiv.org/abs/* |
arXiv API (export.arxiv.org/api/query) |
DOI / doi.org/* |
Crossref (api.crossref.org/works/<DOI>) |
pubmed.ncbi... |
NCBI E-utilities (esummary.fcgi) |
| bioRxiv / medRxiv | api.biorxiv.org/details/<server>/<doi> |
github.com/o/r |
GitHub API (api.github.com/repos/o/r) |
| any other URL | HTML <meta name="citation_*"> + <title> scrape |
Clone or symlink into your Claude Code user skills directory:
git clone git@github.com:steverozen/insert-reference-skill.git ~/github/insert-reference-skill
ln -s ~/github/insert-reference-skill ~/.claude/skills/insert-reference-skillskill.md is the entry point Claude Code reads.
# single reference
python3 scripts/verify_reference.py https://arxiv.org/abs/2402.03776 \
--author Pancotti --year 2024 --title MUSE-XAE
# batch
python3 scripts/batch_verify.py <<'EOF'
[
{"url": "https://arxiv.org/abs/2402.03776",
"first_author": "Pancotti", "year": "2024"},
{"url": "https://doi.org/10.1038/s41586-020-1943-3",
"first_author": "Alexandrov", "year": "2020"}
]
EOFExit codes: 0 match (or unverified with no expected fields), 1 mismatch,
2 fetch failed.
MIT. See LICENSE.