Claude Code AGENTS.md CLAUDE.md GitHub AI coding

Claude Code's Most-Upvoted Issue Hit 5,146 👍 for AGENTS.md Support. Anthropic Closed It as 'Completed' Anyway (2026)

The Prompt Shelf ·

anthropics/claude-code#6235 is the single most-upvoted issue in the Claude Code repository — 5,146 👍, 394 comments, open for 13 months. On August 17, 2026, it was closed with the label stateReason: COMPLETED. Claude Code still does not read AGENTS.md natively. This article covers what the auto-close actually means, what shipped between May and September 2026 that’s genuinely new, and the one gap (@import vs. enforcement) that none of the workarounds close.

The Issue: 5,146 👍 and Thirteen Months of Silence

Issue #6235, “Feature Request: Support AGENTS.md,” was opened on 2026-08-21 (per GitHub’s issue metadata the underlying discussion predates that, tracked back to community requests from August 2025). The ask was simple: when Claude Code launches in a directory with AGENTS.md but no CLAUDE.md, load AGENTS.md as a fallback instead of ignoring it.

By the numbers, pulled directly from the GitHub API:

MetricValue
👍 reactions5,146
Comments394
Time open~13 months
Final stateCLOSED, stateReason: COMPLETED
Closed2026-08-17

It is, per multiple community trackers, the largest single feature request by reaction count in the repo’s history — roughly double the second-place issue. A near-duplicate, #31005 (“Support for AGENTS.md and .agents/skills/, the community has been asking since August 2025”), remains open with 358 👍 as of this writing, meaning Anthropic now has two open-then-closed threads asking for the same thing.

What “Closed as Completed” Actually Means

Here’s the part that triggered the second wave of comments (several as recent as September 9–12, 2026, just days before this article): #6235 was not closed by a maintainer confirming the feature shipped. It was closed by an automated Issue Sweep GitHub Action that auto-closes issues after a period of inactivity.

A separate meta-issue, #87647, documents the scale of this: over 6,000 issues labeled has repro have been auto-closed by the sweep bot since March 2026, which the repo’s own maintainers have said contradicts their stated policy that “issues are auto-closed
 when they’ve had no activity for a while and are missing information needed to reproduce” — a policy that doesn’t obviously apply to a 5,146-reaction feature request with a fully-specified proposal.

The practical effect: stateReason: COMPLETED reads, to anyone filtering issues or checking status via gh issue view, as “this was resolved.” It wasn’t. Native AGENTS.md fallback loading — the actual ask — never shipped. One comment from September 9 captured the community’s read on it: “It’s wild that this is the most upvoted claude code issue by over 2x. It’s almost like the maintainers and the community don’t agree.”

If you’re scripting around issue status (e.g., a dependency-tracking dashboard that treats COMPLETED as “safe to build on”), this is a concrete case where that heuristic fails.

What Actually Shipped, May → September 2026

Native fallback loading didn’t ship. But three adjacent things did, and conflating them with “AGENTS.md support” is the most common mistake in threads discussing this:

FeatureStatusWhat it doesWhat it doesn’t do
@AGENTS.md importExisted pre-May 2026One-line import in CLAUDE.md re-reads AGENTS.md at every launchRequires you to author a CLAUDE.md yourself
Symlink (ln -s AGENTS.md CLAUDE.md)Existed pre-May 2026Same effect, zero-maintenance on UnixBreaks on Windows without admin/Developer Mode
/import commandNew, requires v2.1.213+One-time copy of AGENTS.md content into CLAUDE.md, plus carries over MCP servers, commands, subagents, and skills from the source tool’s configProduces a static snapshot — edit AGENTS.md later and CLAUDE.md silently drifts out of sync
/init with CLAUDE_CODE_NEW_INIT=1ExpandedInteractive flow reads AGENTS.md, .devin/rules/, .windsurf/rules/, .windsurfrules, and .clinerules during setupOne-time generation, not continuous sync

The distinction between @import and /import is the one most guides on this topic get wrong, because the two commands are one character apart and do opposite things:

<!-- @import: put this line in CLAUDE.md. Re-reads AGENTS.md every launch. -->
@AGENTS.md
# /import: run this once in a session. Copies AGENTS.md content into
# CLAUDE.md as a one-time snapshot, and also pulls in MCP servers,
# slash commands, subagents, and skills if the source config has them.
/import

If you want a single source of truth that never drifts, use @AGENTS.md. If you’re migrating off another tool entirely and want a one-time absorption of its whole config (not just the rules file), /import is the better fit — but you own keeping it updated afterward.

One more thing that changed since spring: the current docs state @import chains cap at 4 hops, down from the 5-hop limit documented in earlier guides circulating this year. If you have a nested import chain (AGENTS.md → shared-rules.md → team-conventions.md → org-standards.md → 
), verify against the live docs rather than an older cached guide — including our own earlier reference on this exact topic, linked below.

The Catch Nobody Mentions: Import ≠ Enforcement

Even a perfectly wired @AGENTS.md import doesn’t guarantee Claude follows it. Anthropic’s own memory docs are explicit about this: “Claude treats them as context, not enforced configuration
 To block an action regardless of what Claude decides, use a PreToolUse hook instead.”

This isn’t hypothetical. Issue #22022 (“Claude Code ignores AGENTS.md rules and doesn’t act as gatekeeper”) documented Claude modifying files it was explicitly told not to touch, despite the rule being present in a loaded file. The rule was in context. Claude didn’t follow it anyway.

The practical takeaway: @AGENTS.md, /import, and /init all solve loading — getting the text into context. None of them solve compliance — Claude actually behaving according to that text. If a rule is load-bearing (security boundaries, “never touch this directory,” compliance requirements), it belongs in a PreToolUse hook with permissions.deny, not in prose inside a markdown file, imported or not.

A Hook-Based Workaround That Closes the Loading Gap

For teams that want AGENTS.md picked up automatically — no manual @import line, no per-repo setup — a SessionStart hook can do the detection at launch. The idea, credited to a pattern shared in the #6235 comment thread: check for AGENTS.md in the project root, and if there’s no CLAUDE.md sitting next to it, inject the content as additional context for that session only.

{
  "hooks": {
    "SessionStart": [
      {
        "matcher": "startup|resume|clear|compact",
        "hooks": [
          {
            "type": "command",
            "command": "f=\"${CLAUDE_PROJECT_DIR:-$PWD}/AGENTS.md\"; c=\"${CLAUDE_PROJECT_DIR:-$PWD}/CLAUDE.md\"; if [ -f \"$f\" ] && [ ! -f \"$c\" ]; then printf '=== AGENTS.md (no CLAUDE.md present) ===\\n'; cat \"$f\"; fi"
          }
        ]
      }
    ]
  }
}

Add this to ~/.claude/settings.json and it applies across every repo you open — repos with AGENTS.md and no CLAUDE.md get it loaded automatically; repos that already have CLAUDE.md are untouched (which also means an explicit @AGENTS.md import still takes priority where it exists). It’s a genuine fallback, closer to what #6235 originally asked for than either @import or /import — but it’s a personal machine-level setting, not something you can commit for a team the way a CLAUDE.md file is. Anyone on the team without this hook configured gets nothing.

What This Means If You Maintain Both Files

  • Solo repo, already have AGENTS.md, want it to just work in Claude Code too: add one line, @AGENTS.md, to a new CLAUDE.md. Five minutes, done, stays in sync forever.
  • Cross-platform team (some Windows devs): use @import, not the symlink. The symlink pattern silently fails to check out correctly on Windows without admin rights.
  • Migrating away from another tool entirely: /import (v2.1.213+) is worth it for the one-time absorption of MCP servers and subagents, not just the rules text — but budget time to re-sync manually if the source file keeps changing.
  • You have a rule that must never be violated: don’t rely on any of the above. Write a PreToolUse hook with permissions.deny. Context can be ignored; hooks cannot.
  • You manage machine-wide defaults across many repos, some without CLAUDE.md: the SessionStart hook pattern above is the closest thing to the native fallback #6235 asked for, with the caveat that it’s per-machine, not per-repo.

Keeping settings like this straight across a team is its own maintenance burden — the same discipline that applies to hook commands applies to anything else you’d otherwise hardcode into a shared settings.json. If your hooks ever need to reach an authenticated service (a private registry, an internal API for policy checks), 1Password’s CLI lets op run inject that secret at execution time instead of sitting in the JSON file itself — useful the moment a “just load this file” hook grows into “also ping this internal service.”

Browse the full collection of AI coding rule files and templates in our gallery.

FAQ

Did Claude Code add native AGENTS.md support?

No. Issue #6235, the feature request asking for this, was closed on 2026-08-17 by an automated inactivity-sweep bot with stateReason: COMPLETED, not by a maintainer confirming the feature shipped. Claude Code still requires a CLAUDE.md file as the entrypoint; AGENTS.md is not read as a fallback.

What’s the difference between @import and /import for AGENTS.md?

@AGENTS.md is a line you put inside CLAUDE.md that re-reads the current AGENTS.md at every session launch — one edit reaches both files. /import is a command you run once (requires Claude Code v2.1.213+) that copies AGENTS.md content into CLAUDE.md as a static snapshot, plus carries over MCP servers, commands, subagents, and skills. Editing AGENTS.md after running /import does not update CLAUDE.md.

Why was the most-upvoted Claude Code issue closed as “completed”?

It wasn’t closed by a maintainer decision that the feature shipped. A GitHub Actions “Issue Sweep” workflow auto-closes issues after inactivity; a separate meta-issue (#87647) documents over 6,000 issues closed this way since March 2026, which several maintainers have acknowledged doesn’t match their stated auto-close policy for issues with full reproduction detail.

If I import AGENTS.md, will Claude Code always follow its rules?

Not guaranteed. Anthropic’s own documentation states CLAUDE.md and AGENTS.md content is “context, not enforced configuration” — Claude reads it and tries to comply, but there’s no hard guarantee, especially for vague or conflicting instructions. Issue #22022 documented Claude ignoring a loaded “do not modify this file” rule. For anything that must never be violated, use a PreToolUse hook with permissions.deny instead of relying on markdown instructions.

What is the maximum @import chain depth in Claude Code?

Four hops, per the current official documentation. Earlier guides circulating in 2026 cited a five-hop limit; verify against live docs if you have a long import chain, since this value has changed.

Is there a way to make Claude Code read AGENTS.md automatically without editing every repo?

A SessionStart hook in ~/.claude/settings.json can check for AGENTS.md with no adjacent CLAUDE.md and inject its content at launch, machine-wide, without touching each repo. It’s a personal/machine-level setting, though — it doesn’t help teammates who haven’t configured the same hook.

Related Articles

Explore the collection

Browse all AI coding rules — CLAUDE.md, .cursorrules, AGENTS.md, and more.

Browse Rules