prior
AGENTS.md14 starsChanged 5 months agoApache-2.0View on GitHub
⚠️ BRANCHING — main is the Friday-demo snapshot. Do not commit to main. All subsequent work goes on a feature branch (name/feature, e.g. harit/local-graph, klara/merge), then opens a PR for a teammate to review and merge. One Claude Code session per branch. Prior turns primary literature into a queryable atlas of claims via three core agents: Reader (paper → claims), Cartographer (claims → graph), Navigator (question → grounded answer, forward & backward). A fourth, Contribution agent (contributor.py), extracts papers' self-declared,…
- Reads credentials
- Installs packages
Where files are headingNew AGENTS.md files have more rules about keeping secrets out of the code, and fewer about checking a change actually works.
Of the AGENTS.md files we read, the 11,773 first seen in the last six months, against the older ones: the kind of rule that gained most share, and the kind that lost most. About files like this in general, not this one, and an estimate, since a kind is a pattern in the words.
In this repositoryOne other file it gives its agents.
- priorSkill
The file
We split this AGENTS.md into the rules it gives an agent
5 rules. About 0 are common, 1 is distinctive, and 4 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈1
Distinctive · estimate
This author's own choices. Worth a look.
4
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- could be automatic: a setting could enforce it
- Very specific: line 22
Test: pytest -q (the whole suite runs without an API key — 20 tests, all backends mocked)
- Very specific: line 51
All LLM calls go through llm.py — don't call anthropic directly elsewhere.
- Very specific: line 57
Do not commit data/raw/ or data/atlas/ (regenerable.
- Distinctive: line 59
Do not push directly to main — open a PR.
- Very specific: line 60
Don't bypass structured() to hand-parse JSON out of prose responses.
≈ “Common” is an estimate: at least 1 in 5 of the 16,595 AGENTS.md files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
AGENTS.md — what Claude Code reads at session start
⚠️ BRANCHING —
mainis the Friday-demo snapshot. Do not commit tomain. All subsequent work goes on a feature branch (name/feature, e.g.harit/local-graph,klara/merge), then opens a PR for a teammate to review and merge. One Claude Code session per branch.
Prior turns primary literature into a queryable atlas of claims via three core
agents: Reader (paper → claims), Cartographer (claims → graph),
Navigator (question → grounded answer, forward & backward). A fourth,
Contribution agent (contributor.py), extracts papers' self-declared,
standalone contributions from full text. Sources are filtered to primary
literature (reviews/surveys excluded). Read README.md for the why.
How to run
- Install:
pip install -e .(orpip install -r requirements.txt) - Env:
export ANTHROPIC_API_KEY=...; optionallyPRIOR_CONTACT_EMAIL=... - Build:
prior build "<topic>" [--cite-hops N](ingest → read → map →data/atlas/atlas.json) - Query:
prior ask "<q>"/prior origin "<concept>"/prior info - Extras:
prior contributions(self-declared contributions, full text) ·prior view [--contributions] - Test:
pytest -q(the whole suite runs without an API key — 20 tests, all backends mocked) - Eval:
python evals/scifact/run.py --data data/scifact --mock(SciFact, zero credits)
Credits
prior.llmhas three backends viaPRIOR_LLM_BACKEND:api(metered),claude-code(Agent SDK), andclaude-cli. IMPORTANT:-p/--printand the Agent SDK now meter API credits even on a Max plan — onlyclaude-cli(drives the interactive Claude TUI through a PTY, seeclaude_cli.py) is truly credit-free. SetPRIOR_LLM_BACKEND=claude-clifor free runs on the subscription. Use--mock/ mockedask_fnto develop evals for free.
Architecture (one line each)
sources/openalex.py— search + citation edges + OA PDF urls; no key neededsources/arxiv.py— recent preprints; Atom XML via stdlibsources/_filters.py—looks_like_review(primary-lit only; reviews excluded)reader.py— forces JSON via a single tool; atomic, typed, evidence-bearing claimscartographer.py— BM25 proposes candidate claim pairs; LLM labels only those (avoids O(n²))navigator.py—ask(forward: verdict + supporting/contradicting/open) andorigin(backward)contributor.py— Contribution agent; standalone self-declared contributions (full text)fulltext.py— HTML-first full text (arxiv html → ar5iv → real-PDF); skip, never abstract-fallbackatlas.py— the graph + JSON persistence;atlas.jsonis the hand-off APIllm.py—structured()(forced tool-call JSON) andtext(); api / claude-code backends
Conventions
- Python 3.11+. Functions short; type-hint module boundaries.
- snake_case functions, PascalCase classes, ALL_CAPS constants.
- All LLM calls go through
llm.py— don't callanthropicdirectly elsewhere. - New structured outputs: define a JSON-Schema and use
llm.structured(...). - Claim ids:
"<paper_id>::cNN". Paper ids:"openalex:W…"/"arxiv:…".
What's off-limits
- Do not commit
data/raw/ordata/atlas/(regenerable; gitignored), nor any.env*,*.key, orsecrets/. - Do not push directly to
main— open a PR. - Don't bypass
structured()to hand-parse JSON out of prose responses.
Operating principles
- Ground everything — every Navigator statement cites a claim/paper id. No outside knowledge.
- Be a graceful "no" — when the atlas doesn't cover a question, say so + name the gap.
- Cheap by default — Sonnet for extraction/mapping, Opus only for the user-facing answer.
- Stages cache — re-run
read/mapwithout re-ingest-ing.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

