Claude Code plugin · CLI · git hook

PaperAnchor

Trust the writing agent.
Recompute its numbers.

Your coding agent just wrote the results section. PaperAnchor reruns a short recipe for every number it types, at the moment it is typed, and hands back the value the data gives.

Thanh-Huy Nguyen  ·  Ulas Bagci  ·  Northwestern University

A writing agent types 84.8%, PaperAnchor reports that the recipe gives 81.84, and the agent restores 81.8%

A reviewer reads the number. A recipe recomputes it.

We measured where a number check belongs in a writing agent's loop, on 60 recent arXiv papers, 10 real research repositories, 300 hand-checked numbers, and 24 papers seeded with errors that flatter the paper's own method.

24 / 24
papers with every planted error removed

when the check runs by itself at the edit. Offered as a command the agent may call, it left as many errors as no check at all.

9 in 10
reviews quote the wrong number

yet five wrong numbers lower an LLM reviewer's score by at most about 3 points out of 100.

0
model calls, no dependencies

The check is deterministic plain Python. On most papers a full recheck takes under a second.

How it works

Every number carries a tag, every tag names a recipe, and a Claude Code hook reruns the recipe each time the paper changes. A number that does not follow comes back to the agent in the same turn.

paper/main.tex
Our model reaches 81.8\%\src{acc}
test accuracy.
paper/sources.py
@source("acc", means="test accuracy (%)")
def acc():
    d = load("results/metrics.json")["ours"]
    return 100 * d["correct"] / d["total"]
the agent changes 81.8 to 84.8 and reads
Feedback only, your edit was kept. 1 number(s) could not be recomputed from the repository's data:
- 84.8 (line 8, key acc): recipe gives 81.84, which does not round to 84.8 at the printed precision.
1. The value follows.The recipe's value rounds to the printed value at the printed precision.
2. The recipe reads raw data.Repository files that existed unchanged when the session began, never prose notes.
3. No typed constant.The recipe neither contains the printed value nor rounds by itself.
One edit checked by PaperAnchor, and the six places a number check can sit

One edit checked by PaperAnchor (top), and the six places a number check can sit, with the planted errors each left per paper (bottom).

Where the check sits decides whether it works

The same recompute check, placed seven ways, on 24 papers with up to six planted errors each.

Where the check sitsPlanted errors left per paperAgent turns per paper
No check3.087.1
Check command and rules in the prompt2.966.6
Placebo: random refusals at the gate's rate2.7116.5
Opus audit at the end of the session0.1214.0
PaperAnchor, feedback after each edit (default)0.008.7
PaperAnchor, blocking gate0.0019.9
PaperAnchor, generate mode0.007.8
Planted errors left in each of 24 papers under seven placements of the check

Each cell is one paper. Only the placements that run at the edit without being asked clear every paper.

A reviewer is not a number check

LLM reviewers quoted the planted wrong numbers in more than nine of ten reviews, and barely changed their scores.

A check has to recompute

Agents write fresh analyses, so matching against stored values misses errors. Rerunning the writer's recipe caught 14 of 16 human-found errors.

It has to run without being asked

Offered as a command to our main writer, the check left as many errors as no check. Run by a hook at the edit, it left none.

It holds under pressure

Told to keep its headline results, the writer still fixed all 96 flattering errors. Haiku, Sonnet and Opus writers all ended at zero with feedback.

Outcomes of planted errors for a writer told to protect its results, and for Haiku, Sonnet and Opus writers

Install in 30 seconds

Install the plugin once. It stays silent until a project opts in with paperanchor init.

terminal
claude plugin marketplace add ScientistCrew/paperanchor
claude plugin install paperanchor@paperanchor
cd my-project && paperanchor init
paper preamble
\providecommand{\src}[1]{}
\providecommand{\val}[2][1]{}
without Claude Code
pip install git+https://github.com/ScientistCrew/paperanchor
paperanchor check      # CI: exit 1 on a failure
paperanchor git-hook   # pre-commit hook

Citation

@article{paperanchor2026,
  title   = {PaperAnchor: Trust the Writing Agent, Recompute Its Numbers},
  author  = {Nguyen, Thanh-Huy and Bagci, Ulas},
  journal = {arXiv preprint arXiv:2611.39561},
  year    = {2026},
  url     = {https://arxiv.org/abs/2611.39561}
}