Skip to content

Rename the agent guidance to AGENTS.md and explain the Babel domain it assumes - #31

Merged
gaurav merged 5 commits into
mainfrom
improve-claude-md
Sep 1, 2026
Merged

Rename the agent guidance to AGENTS.md and explain the Babel domain it assumes#31
gaurav merged 5 commits into
mainfrom
improve-claude-md

Conversation

@gaurav

@gaurav gaurav commented Sep 1, 2026

Copy link
Copy Markdown
Collaborator

CLAUDE.md had grown to 396 lines by accretion — each hard-won rule from a review round appended wherever it fit. It was accurate about this repository's internals and silent about the system those internals exist to read: it never said what Babel is, what a clique or a concord is, or why NodeNorm's version matters. An agent arriving at the Concord.parquet query code had no model of the data.

This renames the file to AGENTS.md, gives it that missing context, moves the deep caching invariants to docs/, and removes what was being said twice. Documentation only — no change to src/.

What's here

Renamed to AGENTS.md, the filename coding agents other than Claude Code look for; the guidance was never Claude-specific. CLAUDE.md remains as a four-line pointer, so Claude Code still finds it. Four test docstrings that referenced the old name are updated. The rename is the first commit, so the substantive edits that follow read as edits rather than as a delete plus an add.

A Domain context section covering only the terms this codebase actually uses — clique, preferred identifier, concord, conflation, Biolink type — and NodeNorm's relationship to a specific Babel release. It is a summary with links rather than copied upstream prose, so it cannot drift from upstream unnoticed.

The part that earns the most space is the boundary between concords and cliques. Babel's own AGENTS.md says to answer clique-membership questions from a finished build "never from the concords that fed it" — and concords are exactly what this tool reads. That is not a defect, it is the purpose: xrefs reports the evidence Babel read, which is what you want when a merge looks wrong, while NodeNorm reports the verdict. Written down explicitly so that nobody later "improves" xrefs into a clique oracle.

The caching invariants moved to docs/Downloading.md — near-verbatim, because the wording is hard-won and each rule records a specific failure that actually happened. AGENTS.md keeps a four-sentence summary and a pointer. That is ~90 lines an agent needs rarely, which had been sitting above the orientation it needs every session.

Deduplication. The DuckDB spill directory was described in three places, the caching model in three, and the never-commit-the-internal-URL rule in three. Each is now stated once, where it belongs. ## Important Notes is deleted outright — all three of its bullets restated earlier sections. The command examples now point at README.md, which documents every flag and is the user-facing reference.

Four factual corrections:

What upstream does not document

Worth recording, because it shaped what could honestly be written. Neither Babel's README.md nor its releases/ARTIFACTS.md describes Concord.parquet, Identifiers.parquet or Metadata.parquet. conflate / drug_chemical_conflate and the /status babel_version field are absent from NodeNormalization's README.

So the file schema in the new section is what this repository's code assumes, verified against real files — and it is labelled that way rather than presented as a published contract. Release naming, latest and VERSION.txt are undocumented upstream too. Filed upstream as NCATSTranslator/Babel#1077, which links back to the Domain context section as the shortest statement of what is missing.

What it deliberately does not do

Verification

272 unit tests pass and ruff is clean (no source changes, so both should be unchanged). Every relative link and intra-file anchor in AGENTS.md, docs/Downloading.md and CLAUDE.md resolves, no .py file still references CLAUDE.md, and the symbols the reworked text names were re-checked against the code.

Nothing is blocking this merge.

One thing to judge: AGENTS.md is 370 lines, down from 396, with a further 84 in docs/. Total documentation went up, because the Domain context section came out at 61 lines rather than the ~25 originally scoped. The extra went on the concord/clique boundary above. If that reads as too much for an agent file, the obvious trim is ## Testing (73 lines, now the largest section).

gaurav and others added 3 commits September 1, 2026 14:30
AGENTS.md is the filename coding agents other than Claude Code look for, and the
guidance in it was never Claude-specific. CLAUDE.md stays as a two-line pointer so
Claude Code still finds it.

Renamed first, before the rework that follows, so the substantive edits land in the
final filename and read as edits rather than as a delete plus an add.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
AGENTS.md had grown to 396 lines by accretion, and ~90 of those were downloader
invariants that an agent needs rarely but that sat above the orientation it needs
every session. They move near-verbatim to docs/downloading.md — the wording is
hard-won and each rule records a specific failure — with a four-sentence summary and
a pointer left behind.

Deduplicated the rest. The DuckDB spill was described in three places, the caching
model in three, and the never-commit-the-internal-URL rule in three; each is now
stated once, where it belongs, and referenced from elsewhere. "Important Notes" is
deleted outright: all three bullets restated earlier sections. The command examples
now point at README.md, which documents every flag and is the user-facing reference.

Three factual corrections along the way:

- MissingBabelFileError is raised on *any* 404, not only for `duckdb/` paths, as the
  file claimed in two places. downloader.py:546 has no path condition.
- CI budgeting pointed only at #18; #28 now covers the same ground more precisely.
- "recreated as #20-#24" predates #20 merging.

README.md's configuration table was missing BABEL_ALLOW_VERSION_MISMATCH, which
env.default has carried since #27.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
AGENTS.md described this repository's internals well and the system it belongs to
not at all, so an agent reading the Concord.parquet query code had no model of the
data. Add a Domain context section covering only the terms the code actually uses:
clique, preferred identifier, concord, conflation, Biolink type, and NodeNorm's
relationship to a specific Babel release.

The section it earns most is the boundary between concords and cliques. Babel's own
AGENTS.md says to answer clique-membership questions from a finished build "never
from the concords that fed it" — and concords are exactly what this tool reads. That
is not a bug: `xrefs` reports the evidence Babel read, which is what you want when a
merge looks wrong, while NodeNorm reports the verdict. Written down so nobody
"improves" xrefs into a clique oracle.

Summarised with links rather than copied, so it cannot drift from upstream unnoticed
— and the parts upstream does not document are marked as such. Neither Babel's
README nor its releases/ARTIFACTS.md describes Concord.parquet, Identifiers.parquet
or Metadata.parquet; the schema given here is what this repository's code assumes,
verified against real files, and is labelled that way rather than presented as a
published contract. Release naming, `latest` and VERSION.txt are undocumented
upstream too.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
gaurav and others added 2 commits September 1, 2026 14:51
Capitalised filename, to match how documentation files are named here.

Renamed in two steps because macOS is case-insensitive by default, so a direct
`git mv` between names differing only in case is a no-op on the working tree.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
CLAUDE.md pointed at AGENTS.md with a Markdown link, which Claude Code does not
follow — it would have to decide to go and read the file. A bare `@AGENTS.md` line
is an import directive, so the content arrives without that step.

The explanatory sentence says the line is a directive and must stay unquoted and
outside any code span, since an import inside backticks or a fenced block is ignored
and "tidying" it into a code span would silently stop the import working.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@gaurav
gaurav merged commit cad0b25 into main Sep 1, 2026
3 checks passed
@gaurav
gaurav deleted the improve-claude-md branch September 1, 2026 18:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant