Skip to content

[skip ci] Import AGENTS.md from .claude/CLAUDE.md - #23691

Merged
LamentXU123 merged 2 commits into
php:masterfrom
LamentXU123:claude-md
Sep 15, 2026
Merged

LamentXU123 merged 2 commits into
php:masterfrom
LamentXU123:claude-md

Conversation

@LamentXU123

Copy link
Copy Markdown
Member

Replace the prose instruction with Claude Code’s @ import syntax so that AGENTS.md is loaded automatically.

The official documentation describes importing AGENTS.md and states that relative paths resolve relative to the importing file. So using @../AGENTS.md is correct as far as I can tell and more recommended by claude code.

@iluuu1994 iluuu1994 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks. You could also drop the claude heading.

@iluuu1994

iluuu1994 commented Sep 15, 2026

Copy link
Copy Markdown
Member

Oh actually, one concern.

@iluuu1994 iluuu1994 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If this is pasted verbatim into .claude/CLAUDE.md, will the path referenced within AGENTS.md be wrong? It references ./SECURITY.md, which doesn't live in .claude but in root.

Not sure how to best fix that. Maybe just move the CLAUDE.md file back into root.

@LamentXU123

Copy link
Copy Markdown
Member Author

I think not necessarily. the documented path-resolution rule applies to @ imports. ./SECURITY.md is a plain-text reference, so this isn’t a confirmed resolution bug. But it's frankly strange.

Another solution is to put CLAUDE.md into root dir instead of ./claude. wdyt?

@iluuu1994

Copy link
Copy Markdown
Member

Moving it back to the root works for me.

@LamentXU123

Copy link
Copy Markdown
Member Author

I will make this 2 commits when merging. One for the @ syntax and one for moving it to root. To make git log more useful.

Load the shared instructions through an @ import and remove the redundant
heading.
Place CLAUDE.md alongside AGENTS.md to clarify relative file references. Update
the import to @AGENTS.md.
@LamentXU123
LamentXU123 merged commit 144eb81 into php:master Sep 15, 2026
1 of 2 checks passed
@LamentXU123

Copy link
Copy Markdown
Member Author

Thanks!

@LamentXU123
LamentXU123 deleted the claude-md branch September 15, 2026 16:19
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.

3 participants