claude-code icon indicating copy to clipboard operation
claude-code copied to clipboard

Choose other name for "CLAUDE.md"?

Open divan opened this issue 6 months ago • 7 comments

Is it possible to change name for the rules/instruction file used by Claude-code?

Like .ai/README.md or even docs/project_overview.md instead of Claude.md.

divan avatar May 07 '25 20:05 divan

I would love to see this to avoid the proliferation of agent specific files in each of my projects. It would be awesome to see some cross-agent agreement on files that are read.

dave-shawley avatar May 09 '25 15:05 dave-shawley

This doesn't directly address your issue's title, but as of v0.2.107, "CLAUDE.md files can now import other files. Add @path/to/file.md to ./CLAUDE.md to load additional files on launch". Does this feature address your needs?

dicksontsai avatar May 14 '25 13:05 dicksontsai

@dicksontsai thank you, but not really. The idea is that in this fast-changing AI landscape we're constantly trying different AI coding tools. General sense is to start treating AI agents as humans that need clear explanation of the design choices, etc. So making design documents / style guidelines / instructions makes sense in general, regardless of what tool is used. And idea is to work on these documents that can be used by any of the AI coding tools. Being forced to include file CLAUDE.md into the codebase just feels very wrong and if this behaviour will be picked up by other agents, then codebase will quickly be filled with <YET_ANOTHER_AI_AGENT.md> files.

It would be great if Anthropic leads here with some standards for AI-oriented project documentation, but ultimately the choice of the filename should be in the developers' hands.

divan avatar May 23 '25 14:05 divan

I regularly use both Claude and Cursor. A standardized agent documentation format/structure would be nice to avoid CLAUDE.md vs cursor rules duplication

fitz-vivodyne avatar May 23 '25 16:05 fitz-vivodyne

This doesn't directly address your issue's title, but as of v0.2.107, "CLAUDE.md files can now import other files. Add @path/to/file.md to ./CLAUDE.md to load additional files on launch". Does this feature address your needs?

but at least it would limit the Claude.md file to @ai.md

StevenTCramer avatar Jun 26 '25 00:06 StevenTCramer

One thing to consider is that there isn't necessarily a single CLAUDE.md in a repo.

As noted in the best practices doc you can have hierarchical CLAUDE.md files:

Image

fitz-vivodyne avatar Jun 26 '25 00:06 fitz-vivodyne

One thing to consider is that there isn't necessarily a single CLAUDE.md in a repo.

Sure but they all could be configurable as to what name you use. agent.md ai.md bobsyouruncle.stuff

StevenTCramer avatar Jun 27 '25 02:06 StevenTCramer

I'm trying claude code today, but for me that's already a reason to no keep using it. No way I'm going to add files with different names with the same content for each AI tool I want to use. That should be configurable and not trying to vendor lock people. We already know where this kind of things leads, and it's never in customer interest.

Gog0 avatar Jul 07 '25 21:07 Gog0

As a work-around, it seems that e.g. this works ok:

ln -s .rules CLAUDE.md

akaihola avatar Jul 11 '25 16:07 akaihola

As a work-around, it seems that e.g. this works ok:

ln -s .rules CLAUDE.md

Then CLAUDE.md needs to be added to .gitignore, and this is not always possible as it must pass code review. Imagine I work on any big open source project, and I want to modify .gitignore because of this. Imagine I work on Gnome, and I ask them to place CLAUDE.md or to add it to gitignore in this repo https://github.com/GNOME/gnome-desktop. I see 0% chance they agree.

The more feasible workaround is to have a parent directory for each repo just to keep CLAUDE.md there, and this is soooo inconvenient to dig through additional directories just to keep one file there.

If README file is well written, it might be a good case to point claude to use it instead of CLAUDE.md, and README does not need to be gitignored.

There are often files like CODE-STYLE.md which also could serve the needed role.

kneczaj avatar Jul 29 '25 13:07 kneczaj

@kneczaj you could use .git/info/exclude instead of .gitignore. See https://git-scm.com/docs/gitignore

akaihola avatar Jul 29 '25 20:07 akaihola

This is how the new Gemini CLI solved this issue, just by adding this key to .gemimi/settings.local to give any name to the context file:

{
"contextFileName": "MY_NAME.md"
}

It's elegant, it's simple, it just works. In my case, hironically, I actually gave Gemini CLI my CLAUDE.md as context file, because Claude Code cannot accept any other filename, and I wanted to have a unified context file for my repo.

vzegna avatar Aug 07 '25 00:08 vzegna

AGENTS.md would be perfect and is what Codex CLI uses.

matssk avatar Aug 09 '25 18:08 matssk

AGENTS.md would be perfect and is what Codex CLI uses.

It's also becoming a standard as per #1091 and https://agent-rules.org/

But yes, we should have both:

  • a standardized default which all agents use, and
  • the ability to configure it.

aspiers avatar Aug 18 '25 17:08 aspiers

Better, abide by https://agents.md

matthewadams avatar Aug 20 '25 12:08 matthewadams

Our recommendation for this is to use imports to configure Claude Code memory. You can put "Read @AGENTS.md for more info" in the CLAUDE.md to configure Claude Code.

rboyce-ant avatar Aug 22 '25 19:08 rboyce-ant

@rboyce-ant The problem for our team is that we're forced to create a Claude-specific CLAUDE.md all over the place. It would be one thing if this was a dotfile, but it's an uppercased, non-dot file that appears all over the place.

This becomes more problematic because different people use different agents/editors, each with their own configuration file, meaning many of our directories are now filled with CLAUDE.md, AGENTS.md, .cursorrules, etc.

We're using the import mechanism to consolidate the underlying definitions but the file pollution is the concern here. I hope that makes sense!

philip-updoc avatar Aug 22 '25 19:08 philip-updoc

@rboyce-ant Imports seem to be problematic, see https://github.com/anthropics/claude-code/issues/3377

What is the rrationale behind not allowing to make this configurable? Related: https://github.com/anthropics/claude-code/issues/1091#issuecomment-3215229395

schmunk42 avatar Aug 25 '25 15:08 schmunk42

This issue has been automatically locked since it was closed and has not had any activity for 7 days. If you're experiencing a similar issue, please file a new issue and reference this one if it's relevant.

github-actions[bot] avatar Sep 02 '25 14:09 github-actions[bot]