Skip to content

docs: add nested AGENTS.md/CLAUDE.md symlinks for AI docs - #22135

Open
claude[bot] wants to merge 2 commits into
developfrom
claude/ai-docs-symlinks
Open

docs: add nested AGENTS.md/CLAUDE.md symlinks for AI docs#22135
claude[bot] wants to merge 2 commits into
developfrom
claude/ai-docs-symlinks

Conversation

@claude

@claude claude Bot commented Jul 30, 2026

Copy link
Copy Markdown
Contributor

Requested by Sebastian Stammler · Slack thread

Before / After

Before: an agent editing files under e.g. rust/op-revm never sees docs/ai/rust-dev.md unless it happens to follow a link from the doc list in the root AGENTS.md. That's how we got a recent change to rust/op-revm made without knowing the crate is first-party (migrated, not vendored).

After: touching any file under a mapped directory auto-loads the relevant docs/ai doc via a nested CLAUDE.md symlink — the same mechanism the repo root already uses (CLAUDE.mdAGENTS.md). Non-Claude agents that look for AGENTS.md in the working directory get the same content.

How

For each mapped directory, a pair of relative symlinks:

  • <dir>/AGENTS.md → the relevant docs/ai/*.md
  • <dir>/CLAUDE.mdAGENTS.md (mirrors the root pattern)

Nested CLAUDE.md files stack, so rust/kona/CLAUDE.md (a real file) continues to apply on top of the new rust/ link.

Mapped

Directory Doc
rust/ docs/ai/rust-dev.md
packages/contracts-bedrock/ docs/ai/contract-dev.md
op-acceptance-tests/ docs/ai/acceptance-tests.md
.circleci/ docs/ai/ci-config-review.md
.github/ docs/ai/ci-config-review.md

The root AGENTS.md "Subdirectory Instructions" section now lists these nested files.

Deliberately left unmapped

  • writing-acceptance-tests.md — a directory can only symlink one doc; op-acceptance-tests/ points at acceptance-tests.md, which links to the writing guide in its first paragraph (and it stays in the root doc list).
  • ci-ops.md — about operating CI (diagnosing failures, reruns), not editing config in .circleci//.github/; ci-config-review.md is the one aimed at edits to those directories.
  • docker.md — Dockerfiles are scattered across the repo (cannon/, op-alt-da/, ops/docker/, rust/kona/docker/, ...), no single owning directory.
  • dev-workflow.md, flake-prevention.md — cross-cutting; already linked from the root doc list and from the mapped docs.
  • go-dev.md — Go services live in many top-level directories; no single subtree owns Go.
  • derivation.md, execution-layer.md, fault-proofs.md — each spans Go + Rust + contracts across multiple subtrees.
  • opgeth-decoupling.md, devfeatures.md, reth-update-review.md, dispute-game-investigation.md — task-specific playbooks/reference docs, not "you are editing files here" guidance.

Note on Windows

On checkouts without core.symlinks enabled, git degrades symlinks to one-line text files containing the target path — still readable as pointers, nothing breaks.


Generated by Claude Code

Create relative AGENTS.md symlinks to the relevant docs/ai guidance in
subtrees that clearly own a topic, plus CLAUDE.md -> AGENTS.md in each
(mirroring the root pattern), so agents working under those directories
automatically load the guidance:

- rust/ -> docs/ai/rust-dev.md
- packages/contracts-bedrock/ -> docs/ai/contract-dev.md
- op-acceptance-tests/ -> docs/ai/acceptance-tests.md
- .circleci/ -> docs/ai/ci-config-review.md
- .github/ -> docs/ai/ci-config-review.md

Also list the new nested files in the root AGENTS.md Subdirectory
Instructions section.

Co-Authored-By: Claude <noreply@anthropic.com>
Co-authored-by: Sebastian Stammler <seb@oplabs.co>
@sebastianst
sebastianst marked this pull request as ready for review July 30, 2026 20:26
@sebastianst
sebastianst requested review from a team as code owners July 30, 2026 20:26
@sebastianst
sebastianst requested a review from Ethnical July 30, 2026 20:26
Co-Authored-By: Claude <noreply@anthropic.com>
Co-authored-by: Sebastian Stammler <seb@oplabs.co>
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.

2 participants