AGENTS.md structure and what happens to CLAUDE.md's content #101
Notifications
Due Date
No due date set.
Depends on
#91 Guiding principles for agents and humans
Mortis/Kamino
Reference: Mortis/Kamino#101
Reference in new issue
Block a user
Part of #87
Question
What goes in the root
AGENTS.md, which directories get a nestedAGENTS.mdand what does each hold, and what moves to documents read on demand, now thatCLAUDE.mdis removed?Also decide the repository-structure guidance: what lives where, and where a new thing goes (a short tree with one line per directory).
And establish the oldest Claude Code version that reads
AGENTS.mdwithout aCLAUDE.md, so the contributor setup can state it.Context
CLAUDE.md. Tested on Claude Code 2.1.323: a rootCLAUDE.mdimportingAGENTS.mdstops nestedAGENTS.mdfrom loading; with noCLAUDE.md, root and nested both load.AGENTS.mdholds the seven principles and five code-style rules at one line each, the commands to verify a change, and pointers. Pointers carry a trigger ("before changing X, read<file>").AGENTS.mdcandidates:roles/,scripts/,.gitea/workflows/,images/..claude/rules, no hook injection for guidance; a skill never carries a rule.CLAUDE.mdis 129 lines today; its Images and Renovate sections are maintainer runbook material more than every-session rules.agentsmd-authorandagentsmd-auditskills exist for the implementation.AGENTS.md structure and what leaves CLAUDE.mdto AGENTS.md structure and what happens to CLAUDE.md's contentInput from Resolve stale and contradictory claims:
CLAUDE.md" was reaffirmed. ACLAUDE.mdthat only importsAGENTS.mdwas considered and rejected on the recorded test (it stops nestedAGENTS.mdloading). If a newer Claude Code behaves differently, re-test here alongside the oldest-version question.CLAUDE.md:78(as of967fb34) says every scenario runs "for every push tomain", but thepushtrigger inmolecule.ymlhas apaths:filter. Whatever replaces that text must say so.CLAUDE.md:11-19(the Roadmap paragraph added in #162) describes the private environment and its epic. The README Roadmap keeps such references until the migration is done (maintainer's exception); whether any of it belongs in always-loaded agent context is this ticket's call.Resolution
1. Nested
AGENTS.md: five directoriesroles/,scripts/,.gitea/workflows/,images/,docs/adr/. Each one holds that directory's rules in full (rule, one-sentence reason, how it is held). The contributor docs point to them and do not repeat them: the guidance is written once, for humans and agents.roles/AGENTS.md: the rules from Role standard, plus "the pull request that adds a role removes it from the README Roadmap".scripts/AGENTS.md: script rules; a script change comes with its test intests/scripts/; a line intests/sanity/ignore-common.txtis a last resort and carries its reason..gitea/workflows/AGENTS.md: today's "Workflows" section ofCLAUDE.md, describingmolecule.ymlas it stands when written (including that pushes tomainare path-filtered or diff-selected, whichever is true by then).images/AGENTS.md: the image rules (a published version is never moved, bumpversion:in the PR that changes an image,job_imagerelease equalsFROM, the label block, the 100 MB layer cap, the two-PR loop), the "bake in" and "recorded speed" rules from CI image pipeline: keep, simplify or replace; coversextensions/molecule/(the image-smoke scenarios).docs/adr/AGENTS.md: the ADR rules from Public design contract replacing the ADR 0004 references.changelogs/(fragments are written without reading the directory; the format is held by the changelog-lint hook),docs/agents/(skill configuration),docs/images/(moving next to the images),tests/(covered byscripts/),LICENSES/andmeta/(held by hooks),.claude/(gitignored, deployed by apm)..gitea/beyondworkflows/is open until the templates from Contributor doc set exist.2. Root
AGENTS.mddev-setup.shrunspre-commit install --install-hooks); feature branch, never push tomain(branch protection); don't change settings, protection or tags (principle 2); Conventional Commits and REUSE (hooks).pre-commit run --all-files;python -m pytest tests/scriptswhen a script changed;git pushrunsansible-test sanity; Molecule runs only in CI.roles/<role>/with its molecule scenario; a new script goes inscripts/with its test; a new file outsideroles/runs every Molecule scenario until it is added to the selector's IGNORED list, and it belongs there only if no scenario reads it. It is not repeated inCONTRIBUTING.md.dev-setup.sh,apm installmove there);docs/agents/issue-tracker.mdanddocs/agents/triage-labels.md;docs/agents/domain.md;renovate.json: read its rule descriptions and test withrenovate --platform=local.3. What leaves agent context
renovate.jsondescription (already in the Renovate push-trigger issue); the bot-diff gate is explained in its script header.prHourlyLimitaccount and the--newline=LFnote.4. Controls
--offlineon*.md, as a hook and in CI, so a pointer to a moved or deleted file fails.roles/,meta/orgalaxy.ymlwithout a changelog fragment, unless askip-changeloglabel is set. No standard tool fits, so it is a small script. The root line stays either way.5. Claude Code version
Not stated anywhere: a contributor's tool is their own business. For the record, the facts found: per the Claude Code memory docs and changelog, 2.1.277 is the first version that reads
AGENTS.mdwithout aCLAUDE.md, and nested loading is shown working by 2.1.290; any rootCLAUDE.mdsuppresses allAGENTS.mdloading, which is consistent with the 2.1.323 test.6. No ADR, no glossary terms
Easy to reverse and not surprising given Guiding principles for agents and humans; the
AGENTS.mdfiles are the record.Still waiting on Contributor doc set
The full code-style document, the threat-model rules, the AI-assistance rules, the Renovate, release and fork rules: their home in the contributor docs is that ticket's call. Rules tied to one directory follow the pattern above (full text in that directory's
AGENTS.md).Amendment to section 4, agreed with the maintainer after closing: the fragment-presence check has no
skip-changeloglabel. A change consumers cannot see adds atrivial:fragment instead, the mechanismCONTRIBUTING.mdalready uses; the check then needs no API call and works the same on fork runs. Updated in the fragment check issue.Review of the map (2026-11-15): corrections to this issue.
.claude/, is superseded by Shared agent primitives through apm. Section 1 lists.claude/as "gitignored, deployed by apm". The later decision commits the deployed.claude/skills/and.claude/agents/.python -m pytest tests/scripts.pytestis not installed (requirements-dev.txt), and the later decision runspython -m unittest discover -s tests/scripts, as Lint does today (.gitea/workflows/lint.yml:124).version:in the PR that changes an image" and the two-PR loop intoimages/AGENTS.md. Section 3 of that earlier resolution removes the manual bump: CI assigns image versions. The earlier decision stands; the rule lasts only until ci(images): assign image versions in CI and open the pin PR right after a push lands..claude/rules/are open again in Making sure an agent actually loads the guidance.Partly superseded by Making sure an agent actually loads the guidance: the contributor docs now state Claude Code v2.1.281 or later (aspirational), and "no
CLAUDE.md" is held by a pre-commitfailhook instead of a one-time check.