Problem/Motivation

Back in #3585894: LLM harm reduction in Drupal core contribution, AGENTS.md guidelines, we added a CLAUDE.md file that was a pointer over to our AGENTS.md file because at the time a) #6235: Feature Request: Support AGENTS.md in Claude Code was still open, b) Claude Code was the coding agent in widest use in the Drupal community (I believe still is), and so c) despite not wanting to put vendor-specific stuff in core, our hand felt forced.

However, AGENTS.md is now supported as of 2.1.277 (September 18, 2026) so we should be able to just blow the file away.

Steps to reproduce

1. Grab a fresh clone of https://git.drupalcode.org/project/drupal from the main branch
2. Delete CLAUDE.md
3. Start a Claude Code instance from within the "/core/" directory.
4. See that you get a message along the lines of the following:

```
agents-md: no CLAUDE.md found; AGENTS.md loaded: /
/AGENTS.md
```
5. Ask it something to prove that it's finding it, for example:

"Can you help me evaluate contributors for this issue?"

Proposed resolution

Delete CLAUDE.md; fallback to AGENTS.md.

Remaining tasks

^ Do those things.

Release notes snippet

- CLAUDE.md removed in favour of AGENTS.md

CommentFileSizeAuthor
#7 ACTION_LOG.redacted.txt25.94 KBwebchick

Issue fork drupal-3636154

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

webchick created an issue. See original summary.

webchick’s picture

Issue summary: View changes

Fixing my artisanally crafted human typos :P and adding a bit more detail.

webchick’s picture

I find it very poetic to make Claude remove its own proprietary crap, and I'm also curious to dig into claims that our AGENTS.md file is "doing nothing" so here's my prompt:

Hi, I would like you to fix https://www.drupal.org/project/drupal/issues/3636154                                                 
                                                                                                                                   
  I would also like you to keep track of all of the actions you took in a markdown file so that we can go back and look at it      
  later. This includes URLs you fetched, skills you loaded, decisions you made, etc.     

webchick’s picture

Status: Active » Needs review
webchick’s picture

Generated by Claude Code 2.1.319 (Claude Opus 5.5)

The MR at https://git.drupalcode.org/project/drupal/-/merge_requests/17729 deletes core/CLAUDE.md. No other file in core references it.

Testing: Claude Code 2.1.319, run from core/ with CLAUDE.md removed. Asked for the first heading of the loaded project instructions. It answered "# Operator Rules for LLM Tools" from core/AGENTS.md.

The fallback depends on a Claude Code setting in /config. The default is claude-md-or-agents-md. Users who set it to claude-md will no longer load core/AGENTS.md. The change record could mention this.

Generated with the help of an LLM.

webchick’s picture

StatusFileSize
new25.94 KB

Generated by Claude Code 2.1.319 (Claude Opus 5.5)

Attached is the action log from the Claude Code session that worked on this issue. It lists URLs fetched, skills and tools loaded, commands run, and decisions made, including where core/AGENTS.md changed the agent's behavior. Personal details are redacted.

Change record (draft): https://www.drupal.org/node/3636155

Generated with the help of an LLM.

webchick’s picture

Cool, cool, cool. Welp, as expected, doing this uncovered a big, huge mess. :D Two follow-up issues:

1) Fixing this from a core maintainer's POV: #3636156: Rework core/AGENTS.md: move to repo root, add contribution workflow, align with AI policy

2) Fixing this from an AI native developer's POV: https://git.drupalcode.org/project/drupalorg/-/work_items/3607086

Based on the testing done underneath this banner, I'm on the fence now as to whether we want to remove CLAUDE.md or not. From How Claude remembers your project: When Claude Code reads AGENTS.md (confirmed with local testing):

▎ By default, Claude reads AGENTS.md only when you have no CLAUDE.md in your working directory or above it. Here's which of your
▎ files count for that check:
▎
▎ - Count, so Claude reads them instead of AGENTS.md: a CLAUDE.md, .claude/CLAUDE.md, or CLAUDE.local.md in your working
▎ directory or any directory above it

...

▎ Because CLAUDE.local.md counts, adding one to keep your own uncommitted instructions in a project that relies on AGENTS.md
▎ stops Claude from reading AGENTS.md for you. To keep your CLAUDE.local.md and still have Claude read AGENTS.md, set Project
▎ instructions to claude-md-and-agents-md.

In other words, CLAUDE.md is only part of the battle; if a user has CLAUDE.local.md or a .claude/CLAUDE.md file, then it'll take precedence over AGENTS.md and so they'll never get the instruction. :\

What Claude recommended about this conundrum though FWIW:

Root AGENTS.md only. This reaches everyone except people with a CLAUDE.local.md who haven't changed the setting. Document that edge case in the change record. This is the cleanest option, and it keeps the spirit.

webchick’s picture

cainaru’s picture

smustgrave’s picture

Status: Needs review » Reviewed & tested by the community
Issue tags: +Needs Review Queue Initiative

Didn't read every comment but am aware CLAUDE.md isn't needed anymore so +1 for that.

webchick’s picture

Just make sure to read this:

In other words, CLAUDE.md is only part of the battle; if a user has CLAUDE.local.md or a .claude/CLAUDE.md file, then it'll take precedence over AGENTS.md and so they'll never get the instruction. :\

...as long as you're cool with that, +1 to RTBC.