Convert CLAUDE.md to AGENTS.md (and back)

Claude Code and most other coding agents can now share one file, but the rules for which file wins are easy to get wrong. Per the Claude Code docs, when a repository has both an AGENTS.md and a CLAUDE.md, Claude Code reads only CLAUDE.md, unless CLAUDE.md imports AGENTS.md.

The setup that avoids drift is a single AGENTS.md with your shared rules and a CLAUDE.md that contains @AGENTS.md plus anything Claude-specific. The converter produces exactly that when bridge files is on.

Input

    Everything runs in your browser. Files are never uploaded.

    Output

    Converted files appear here.

    Conversion report

      How each rule type converts

      In CLAUDE.md (Claude Code) Becomes Result
      Root CLAUDE.md AGENTS.md Kept
      Nested dir/CLAUDE.md Nested dir/AGENTS.md Kept
      .claude/rules/*.md with paths Section with an “applies to files matching …” note Adapted
      .claude/rules/*.md without paths Section in AGENTS.md Kept
      @path imports Kept as text and flagged; imported files are not inlined Adapted

      Steps

      1. Drop CLAUDE.md, any nested CLAUDE.md files and your .claude/rules folder into the converter.
      2. Leave bridge files on to get a CLAUDE.md and GEMINI.md that import AGENTS.md.
      3. Check the report for flagged @ imports. Either add the imported files as sources too or keep the import in CLAUDE.md.
      4. To go the other way, set From to AGENTS.md and To to Claude Code.

      Worked example

      This output is generated by the same converter you use above, from an illustrative rule set.

      Input

      CLAUDE.md

      # Acme monorepo
      
      @docs/architecture.md
      
      - Use pnpm workspaces. Run `pnpm -r test` before committing.
      - Keep pull requests under 400 changed lines.

      .claude/rules/api.md

      ---
      paths:
        - "apps/api/**/*.ts"
      ---
      
      - Every route handler validates input with zod.
      - Log with the shared logger, never console.log.

      apps/web/CLAUDE.md

      - This app uses Astro. Pages live in src/pages.

      Output

      AGENTS.md

      ## Acme monorepo
      
      @docs/architecture.md
      
      - Use pnpm workspaces. Run `pnpm -r test` before committing.
      - Keep pull requests under 400 changed lines.
      
      ## Api
      
      _Applies when working on files matching `apps/api/**/*.ts`._
      
      - Every route handler validates input with zod.
      - Log with the shared logger, never console.log.

      apps/web/AGENTS.md

      - This app uses Astro. Pages live in src/pages.

      CLAUDE.md

      @AGENTS.md

      GEMINI.md

      @AGENTS.md

      Report for this example

      Things to watch for

      FAQ

      Does Claude Code read AGENTS.md?

      Yes, recent versions read AGENTS.md when there is no CLAUDE.md in the working directory or above it. With a CLAUDE.md present, add @AGENTS.md to it to load both.

      Should I symlink CLAUDE.md to AGENTS.md instead?

      A symlink also works for many tools, but an import line is easier to review in pull requests and lets CLAUDE.md add Claude-specific instructions below it.

      Will GEMINI.md work the same way?

      Gemini CLI supports @file imports in GEMINI.md, and it can also be configured with context.fileName to read AGENTS.md directly.

      Sources

      Format details last checked against these docs on 2026-10-30.

      Related conversions