Skip to content

repos_sync: retire the CLAUDE.md → AGENTS.md pointer files (#482) - #483

Merged
Jammy2211 merged 6 commits into
mainfrom
feature/retire-claude-md-pointers
Oct 7, 2026
Merged

Jammy2211 merged 6 commits into
mainfrom
feature/retire-claude-md-pointers

Conversation

@Jammy2211

Copy link
Copy Markdown
Collaborator

Closes #482.

Why

Claude Code ≥ 2.1.277 loads AGENTS.md natively (built-in plugin cc-plugin-agents-md, default mode claude-md-or-agents-md). Measured on 2.1.292 (2026-10-07): in that mode any CLAUDE.md in the cwd or an ancestor makes the engine ignore every AGENTS.md, so the 46 content-free CLAUDE.md → @AGENTS.md pointer files (and the unversioned workspace-root CLAUDE.md) must all be retired together. A file CLAUDE.md imports is never loaded twice, so this is hygiene, not a token saving. Codex, Cursor and other agents read AGENTS.md directly and never read CLAUDE.md, so nothing changes for them.

What

  • scripts/repos_sync.py: the "CLAUDE.md → AGENTS.md pointers" check leg (name byte-identical, so PyAutoHeart's manifest_drift parser needs no change) now reports a repo that has AGENTS.md and a CLAUDE.md. write_claude_md_pointers → remove_claude_md_pointers: deletes only content-free pointers; a CLAUDE.md with real content is reported (KEPT) and never deleted.
  • .github/workflows/session_hook_propagate.yml: carries the removal on workflow_dispatch only (never on push), honours dry_run, stages only git rm --cached CLAUDE.md.
  • .github/workflows/firewall_gate.yml: TEMPORARY skip of the pointer leg (organ mains keep their pointers until the wave runs) plus a replacement step asserting PyAutoMind carries no CLAUDE.md and running the retirement tests. Remove with the wave's close-out.
  • scripts/spawn.py / docs/pyautobrain/spawn_spec.md: templates no longer generate wiki/example/CLAUDE.md; new policy/hpc_ral.md is DROPped from the public template (names a user, hosts and SSH aliases).
  • policy/hpc_ral.md: the RAL/HPC rules moved verbatim out of the workspace-root AGENTS.md, which shrinks to a three-line pointer stanza (root files are unversioned; applied by hand after merge).
  • PyAutoMind's own CLAUDE.md removed here (the propagation job never targets Mind).
  • Tests: 11 new in test_repos_sync_structure_lint.py; updates in test_session_hook_sync.py, test_repos_sync_standards_block.py, test_spawn_template_contract.py, test_spawn_privacy.py. Mind suite 684 passed; PyAutoHeart/tests/test_manifest_drift.py 8 passed.

Follow-ups (after merge)

  1. Dispatch session_hook_propagate with dry_run: true, review the diff stat, then dispatch for real → removes the 44 reachable pointers.
  2. euclid_assistant (session_hook: false, personal namespace): delete its CLAUDE.md by hand.
  3. Re-spawn the Mind/Memory templates (spawn_drift flags wiki/example/CLAUDE.md until then).
  4. Remove the TEMPORARY firewall skip, its replacement step and the matching TEMPORARY tests.
  5. Nested pointers: 17 tracked CLAUDE.md pointers sit below repo roots (assistant scripts/ and wiki/*, PyAutoMemory wiki/*, workspace_test scripts/). Measured: a pointer below the cwd suppresses nothing and still loads lazily, so they are harmless for root-started sessions, but a session started inside such a folder would lose its ancestors' AGENTS.md. Extend the removal leg to nested pointers (or hand-clean) in a follow-up.
  6. Root workspace: apply the HPC stanza to AGENTS.md, delete root CLAUDE.md, re-run bin/install.sh (Brain#492 supplies the corrected model-delegation block).

API Changes

None for the published libraries (PyAutoNerves/Fit/Array/Galaxy/Lens are untouched). Internal PyAutoMind tooling only: scripts/repos_sync.py renames write_claude_md_pointers → remove_claude_md_pointers and inverts the "CLAUDE.md → AGENTS.md pointers" check leg (leg name unchanged). See full details below.

Test Plan

  • PyAutoMind python -m pytest tests/ — 684 passed (clean env; worktree branch head 9f39fb2)
  • PyAutoHeart tests/test_manifest_drift.py — 8 passed (leg name byte-identical, parser unchanged)
  • Note: under the worktree activate.sh env, tests/test_repos_sync_root_default.py::test_a_root_that_does_not_hold_this_checkout_is_refused fails — pre-existing env leak (PYAUTO_ROOT), reproduced identically on base c567af45; not touched by this PR
  • CI: firewall_gate (pointer leg TEMPORARILY skipped; replacement step asserts Mind has no CLAUDE.md)
  • After merge: session_hook_propagate dry_run: true dispatch, review diff stat, then real dispatch
Full API Changes (for automation & release notes)

Removed

  • scripts/repos_sync.write_claude_md_pointers — replaced by remove_claude_md_pointers
  • PyAutoMind/CLAUDE.md

Added

  • scripts/repos_sync.remove_claude_md_pointers — deletes content-free CLAUDE.md pointers; reports (KEPT) and never deletes a CLAUDE.md with real content
  • policy/hpc_ral.md — RAL HPC rules moved verbatim from the workspace-root AGENTS.md; DROPped from the spawned public template

Changed Behaviour

  • repos_sync.py --check leg "CLAUDE.md → AGENTS.md pointers" now flags a repo that has AGENTS.md and a CLAUDE.md (previously flagged a missing pointer)
  • session_hook_propagate.yml carries the CLAUDE.md removal on workflow_dispatch only, honouring dry_run
  • spawn.py no longer generates wiki/example/CLAUDE.md

Migration

  • Downstream: the 44 propagation-reachable repos lose their pointer via the human-dispatched wave; euclid_assistant by hand; workspace root by hand (see Follow-ups)

Downstream impact

  • PyAutoHeart manifest_drift: no change needed (leg name unchanged; 8 tests pass). Until the wave runs, Heart readiness reports manifest drift: CLAUDE.md → AGENTS.md pointers — 45 mismatch(es) (YELLOW) — expected.
  • Workspace scripts: none affected (no library symbol changed) → option (iii); no smoke test applies to Mind tooling.

🤖 Generated with Claude Code

https://claude.ai/code/session_01QmiavJnNzmKb6EJmgYATfx

Jammy2211 and others added 6 commits October 7, 2026 13:45
Claude Code now loads AGENTS.md natively, and any CLAUDE.md in the cwd or
an ancestor makes it ignore every AGENTS.md. The 'CLAUDE.md → AGENTS.md
pointers' leg (name kept byte-identical for PyAutoHeart's drift parser)
now requires a repo with AGENTS.md to have NO CLAUDE.md. --write's pointer
writer becomes remove_claude_md_pointers: it deletes only a content-free
pointer (the @AGENTS.md import plus comments, headings and the pointer's
own boilerplate) and reports, never deletes, a CLAUDE.md with content.
CLAUDE_MD_POINTER is dropped and CLAUDE.md leaves GENERATED_TOP_LEVEL.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QmiavJnNzmKb6EJmgYATfx
The propagation job calls remove_claude_md_pointers only on
workflow_dispatch (never on the push trigger, so the deletion wave stays
a human act), honours dry_run, and stages only a tracked CLAUDE.md the
function removed.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QmiavJnNzmKb6EJmgYATfx
…#482)

The template no longer writes the retired CLAUDE.md adapter; the CLAUDE.md
KEEP rules stay as tolerant leftovers. policy/hpc_ral.md is an instance
page (cluster, SSH aliases, user), so it is DROPped ahead of policy/*.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QmiavJnNzmKb6EJmgYATfx
The organ mains keep the retired pointer until the human-dispatched
propagation wave, so the inverted leg is unmeetable on PRs and on push.
Both drift checks drop it by its exact label with a loud TEMPORARY banner;
PyAutoMind's own absence of a CLAUDE.md and the retirement tests are
asserted instead. Remove when the CLAUDE.md retirement wave has run
(session_hook_propagate dispatch) — tracked on PyAutoMind#482.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QmiavJnNzmKb6EJmgYATfx
PyAutoMind is never a propagation target, so its retired pointer is
removed in-repo; Claude Code reads AGENTS.md natively.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QmiavJnNzmKb6EJmgYATfx
@Jammy2211
Jammy2211 merged commit 4d63b63 into main Oct 7, 2026
3 checks passed
@Jammy2211
Jammy2211 deleted the feature/retire-claude-md-pointers branch October 7, 2026 13:09
Jammy2211 added a commit that referenced this pull request Oct 29, 2026
…ped) close-out

/prm close-out 2026-10-29 for autolens_profiling #471, #481, #478, #484,
#477, #479, #480, #483 and PyAutoPulse#81 (all merged). Issues #469 and
#472–#476 closed.

- records: complete/2026/10/likelihood-lifecycle-p2{b-interferometer,
  c-point-source,d-galaxy-group,e-cluster,f-dataset-datacube,g-weak}.md
- re-filed: draft/research/autolens_profiling/likelihood_lifecycle_
  p2bc_quiet_rerun_ingest.md and p2{d,e,f,g}_*_runs.md
- epics.md + epic ledger phase-2 lines updated; epic stays open
- dashboard regenerated

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.

chore: retire CLAUDE.md → AGENTS.md pointer files (AGENTS.md is native)

1 participant