Skip to content

Add .claude/CLAUDE.md so Claude Code loads AGENTS.md - #461

Merged
jeremy merged 1 commit into
mainfrom
claude-code-bridge
Jul 30, 2026
Merged

Add .claude/CLAUDE.md so Claude Code loads AGENTS.md#461
jeremy merged 1 commit into
mainfrom
claude-code-bridge

Conversation

@jeremy

@jeremy jeremy commented Jul 30, 2026

Copy link
Copy Markdown
Member

What: adds a bridge at .claude/CLAUDE.md containing exactly @../AGENTS.md. All content
stays in AGENTS.md; this file only imports it. The hidden location is deliberate — it keeps the
repository root uncluttered — which is why the import path is ../AGENTS.md.

Why it's needed: Claude Code assembles its startup context from CLAUDE.md, not AGENTS.md
(docs). Only a column-zero @ import — or a
tracked CLAUDE.md symlink — expands AGENTS.md into that context. Codex and Cursor read
AGENTS.md directly, so today this repo's guidance reaches them and not Claude Code.

Verified after commit:

git cat-file -e HEAD:.claude/CLAUDE.md
test "$(git show HEAD:.claude/CLAUDE.md)" = '@../AGENTS.md'

Checked against main at ec5f320.

Claude Code reads CLAUDE.md, not AGENTS.md, so this repo's AGENTS.md
guidance was invisible to it while Codex and Cursor read it fine.

The bridge lives at .claude/CLAUDE.md and imports @../AGENTS.md, keeping
the repository root uncluttered. Content stays in AGENTS.md; this file
only points at it.
Copilot AI review requested due to automatic review settings July 30, 2026 01:51

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Adds a .claude/CLAUDE.md bridge file so Claude Code loads the repository’s existing agent guidance from AGENTS.md via a column-zero @ import, without introducing duplicate guidance content.

Tip

If you aren't ready for review, convert to a draft PR.
Click "Convert to draft" or run gh pr ready --undo.
Click "Ready for review" or run gh pr ready to reengage.

Changes:

  • Add .claude/CLAUDE.md containing @../AGENTS.md to import startup context for Claude Code.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@romansklenar

romansklenar commented Jul 30, 2026

Copy link
Copy Markdown

Q: Have you considered using symlink or hardlink? It'd work the same with improved semantics.

@jeremy

jeremy commented Jul 30, 2026

Copy link
Copy Markdown
Member Author

Symlinks do work — Claude Code follows a tracked CLAUDE.md symlink and expands the target, so that's a legitimate alternative form.

The import was chosen for two reasons. A root symlink puts a CLAUDE.md entry back at the top level, which the hidden path avoids; and symlinks degrade on checkouts where core.symlinks is off or the filesystem doesn't support them — git materialises the file as a one-line text blob containing the target path, which fails silently and looks exactly like a file whose contents are simply wrong. The @ import has no such failure mode, and it composes: a Claude-specific note can be added under the import line without touching AGENTS.md.

Hardlinks are the one option that genuinely doesn't work. Git doesn't record link structure, so it would store two independent blobs — on clone you'd get two separate files that drift apart the moment AGENTS.md is edited.

@jeremy
jeremy merged commit b1d0834 into main Jul 30, 2026
8 checks passed
@jeremy
jeremy deleted the claude-code-bridge branch July 30, 2026 21:21
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