bibtidy

A tool for checking and correcting BibTeX reference files. BibTeX is a text format commonly used to store sources for academic papers, including authors, titles, and publication details.

In plain words
What is it for?
Use it to validate a .bib file, look up missing bibliographic information, find duplicates, and apply supported corrections while preserving special BibTeX blocks.
Why use it?
It helps catch incorrect or outdated citation details, duplicate sources, formatting problems, and unreliable preprint metadata.

Skill for Claude CodeCodex

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.

agentmods
npx agentmods add skills/mathpluscode/bibtools/bibtidy
Any agent
npx skills add mathpluscode/bibtools --skill bibtidy
Clone the repo
git clone --depth 1 https://github.com/mathpluscode/bibtools

Made for: Claude Code, Codex.

Per session 44 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,625 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
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 $0.00044 $0.01625
Opus 5 $0.00022 $0.00813
Sonnet 5 $0.00009 $0.00325
Haiku 4.5 $0.00004 $0.00162

Measured yesterday against content hash faeddf0c125c, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

bibtidy 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 yesterday.

The scan reads SKILL.md. This mod also ships 6 executable files (tools/compare.py, tools/crossref.py, tools/duplicates.py, …), listed below but not scanned — reading those needs a real analyzer, not pattern matching.

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.

skills/bibtidy/SKILL.md · 124 lines

How it starts

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

Use this skill for any request to validate, check, clean up, or fix a BibTeX .bib file.

If the request includes a .bib path, operate on it. If the path is missing or does not exist, ask for it.

Assumptions:

  • Process entries one by one.
  • Only brace-style BibTeX like @article{...} is supported; reject parenthesized @article(...).
  • Preserve @string, @preamble, and @comment blocks verbatim.

Resolve Tools

All bundled scripts live in tools/ next to this file. Resolve TOOLS_DIR once:

for d in \
  "${CODEX_HOME:-$HOME/.codex}/skills/bibtidy/tools" \
  "$HOME/.claude/skills/bibtidy/tools" \
  "${CLAUDE_PLUGIN_ROOT:-/dev/null}/skills/bibtidy/tools"; do
  [ -f "$d/crossref.py" ] && TOOLS_DIR="$d" && break
done

Useful commands:

  • python3 $TOOLS_DIR/compare.py <file.bib> [--key KEY]
  • python3 $TOOLS_DIR/crossref.py doi <DOI>
  • python3 $TOOLS_DIR/crossref.py search "<title>"
  • python3 $TOOLS_DIR/crossref.py bibliographic "<query>"
  • python3 $TOOLS_DIR/duplicates.py <file.bib>
  • python3 $TOOLS_DIR/edit.py <file.bib> <patches.json>

Patch Rules

Use edit.py for all actual .bib changes. Do not edit the file directly with agent editing tools and do not rewrite the whole file.

  • fix patch: include key, action, urls, explanation, and fields; entry_type is optional.
  • In fields, set a field to null to remove it; omit a field to leave it unchanged.
  • not_found: comment out the original entry; do not add URL lines.
  • duplicate: add % bibtidy: DUPLICATE of <other_key> — consider removing above the original entry; no URL lines.
  • review: add one or more % bibtidy: <URL> lines plus % bibtidy: REVIEW, <reason> above the unchanged entry.
  • Clean entries get no comments.

For fix patches, edit.py should produce:

  • fully commented original entry
  • one % bibtidy: <URL> line per source
  • one % bibtidy: <explanation> line
  • corrected entry

Use source values verbatim. If the bib entry uses and others and a verified source provides the full author list, replace it with the full list.

Read the full file on GitHub · 124 lines

Files

What ships with it

6 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

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. yesterday First seen · 124 lines · 44 tokens per session scan A faeddf0c125c

Subscribe to this mod's changes

bibtidy is a skill published in the GitHub repository mathpluscode/bibtools (5 stars, last pushed 4mo ago), licensed MIT. It adds 44 tokens to every session and 1,625 once invoked, about $0.0002 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.

Related

Other skills, from other repositories

google-scholar-bibtex-mcp

Install and use the bibtex-mcp Google Scholar citation server. Use when an agent needs Scholar-sourced BibTeX for paper titles, wants multiple citation options, must prefer archival conference/journal/proceedings records over preprints, or needs add-mcp setup commands for Codex, Claude Code, Cursor, VS Code, OpenCode…

aryankeluskar/bibtex-mcp · 83 tokens

latex-posters

Create professional research posters in LaTeX using beamerposter, tikzposter, or baposter. Support for conference presentations, academic posters, and scientific communication. Includes layout design, color schemes, multi-column formats, figure integration, and poster-specific best practices for visual communication.

LeonChaoX/qinyan-academic-skills · 60 tokens

scientific-slides

Build slide decks and presentations for research talks. Use this for making PowerPoint slides, conference presentations, seminar talks, research presentations, thesis defense slides, or any scientific talk. Provides slide structure, design templates, timing guidance, and visual validation. Works with PowerPoint and…

LeonChaoX/qinyan-academic-skills · 65 tokens

research-grants

Write competitive research proposals for NSF, NIH, DOE, DARPA, and Taiwan NSTC. Agency-specific formatting, review criteria, budget preparation, broader impacts, significance statements, innovation narratives, and compliance with submission requirements.

LeonChaoX/qinyan-academic-skills · 48 tokens

scientific-writing

Core skill for the deep research and writing tool. Write scientific manuscripts in full paragraphs (never bullet points). Use two-stage process with (1) section outlines with key points using research-lookup then (2) convert to flowing prose. IMRAD structure, citations (APA/AMA/Vancouver), figures/tables, reporting…

LeonChaoX/qinyan-academic-skills · 87 tokens

venue-templates

Access comprehensive LaTeX templates, formatting requirements, and submission guidelines for major scientific publication venues (Nature, Science, PLOS, IEEE, ACM), academic conferences (NeurIPS, ICML, CVPR, CHI), research posters, and grant proposals (NSF, NIH, DOE, DARPA). This skill should be used when preparing…

LeonChaoX/qinyan-academic-skills · 97 tokens