buzz icon indicating copy to clipboard operation
buzz copied to clipboard

Nest AGENTS.md never reaches Claude Code agents — orientation and commit sign-off rules are silently inert

Open EveryOddPixel opened this issue 3 months ago • 1 comments

Describe the bug

The nest's AGENTS.md never reaches agents running on the claude-agent-acp runtime. Claude Code auto-loads CLAUDE.md, not AGENTS.md, and buzz-acp only names AGENTS.md in the system prompt without injecting its contents. Nothing written in AGENTS.md is applied unless the agent independently decides to Read the file.

The two halves:

  1. managed_agents/nest.rs writes AGENTS.md as the nest's orientation document and refreshes its static content on version bumps.

  2. workspace_section() in crates/buzz-acp/src/pool.rs tells the agent the file exists:

    All workspace files — AGENTS.md, RESEARCH/, PLANS/, … — live here.

    but the contents are never added to the prompt. Grepping crates/buzz-acp for AGENTS.md returns only this one string.

By contrast, crates/buzz-agent/tests/hints_integration.rs explicitly covers "AGENTS.md in cwd is loaded into the system prompt" — so the behavior exists for the buzz-agent runtime but not for the Claude Code path.

Impact

Everything in the shipped AGENTS.md template is silently inert for Claude Code agents, including the Git Commit Identity section — the mandatory Signed-off-by and Co-authored-by trailers naming the human operator. That is an accountability requirement that quietly is not delivered to the agent making the commits. The knowledge-file frontmatter conventions, the directory layout, and "cite sources" are inert for the same reason.

This is easy to miss because everything looks configured: the file exists, the system prompt references it by name, and the agent will cheerfully read it if you ask it to.

Steps to reproduce

  1. In an empty directory, create AGENTS.md containing The project codeword is XYZZY-7741.
  2. Run, with tools forbidden so the model cannot simply read the file:
    claude --print --permission-mode dontAsk \
      "Without using any tools, what is the project codeword?"
    
  3. The codeword is not in context.
  4. Rename the file to CLAUDE.md and repeat — the codeword is returned.
  5. Replace CLAUDE.md with @./AGENTS.md (restoring AGENTS.md) and repeat — the codeword is returned.

Equivalently, from a real nest: ask a Buzz agent to state a rule from AGENTS.md without using tools. It does not know it.

Expected behavior

Conventions written to the nest's orientation file are actually in the agent's context.

Version and platform

  • Buzz version: 0.5.7 (self-built from main, x86_64)
  • OS: macOS 12.7.6 (Darwin 21.6.0), Intel
  • Runtime: claude-agent-acp, Claude Code 2.1.221

Logs / additional context

Workaround, verified — write a CLAUDE.md next to AGENTS.md containing:

@./AGENTS.md

Claude Code resolves the @ import relative to CLAUDE.md, so AGENTS.md stays the single source of truth for the other runtimes (codex, goose, buzz-agent) with no duplicated rules. After adding it, the same "without using any tools" question returns the conventions correctly.

Suggested fix: have nest init write that one-line CLAUDE.md alongside AGENTS.md and SKILL.md, or inject the AGENTS.md contents into the system prompt the way buzz-agent does.

Related: #3371 covers agents inheriting the owner's global CLAUDE.md; a nest-local CLAUDE.md would sit below that in Claude Code's hierarchy, so the two interact and may be worth designing together.

EveryOddPixel avatar Aug 09 '26 02:08 EveryOddPixel

Independent reproduction, and one detail that I think makes this more severe than "conventions are inert": in a mixed-runtime nest, this silently splits your agents into two groups that obey different rules.

Setup: Buzz 0.5.17 (desktop, App Store build), macOS 26.6.2 arm64, self-hosted relay. Seven managed agents — 2 on claude-agent-acp (Claude Code 2.1.234), 4 on codex-acp, 1 on goose (1.46.0).

Reproduction

Verbatim repro from the issue body reproduces here:

$ cd "$(mktemp -d)" && echo 'The project codeword is XYZZY-7741.' > AGENTS.md
$ claude --print --permission-mode dontAsk "Without using any tools, what is the project codeword?"
I don't have a project codeword — nothing in the loaded context defines one.

$ echo '@./AGENTS.md' > CLAUDE.md
$ claude --print --permission-mode dontAsk "Without using any tools, what is the project codeword?"
XYZZY-7741

The other runtimes do load it — so the same nest behaves two different ways

I ran the same tools-disabled probe against the other two runtimes in the same nest:

  • codex (v0.145.0) — loads it natively. The transcript shows no tool call between the prompt and the answer:
    $ codex exec --sandbox read-only --skip-git-repo-check \
        "Without using any tools, what is the project codeword?"
    XYZZY-7741
    
  • goose — loads it too. This is deliberate, not incidental: crates/goose/src/hints/load_hints.rs defines get_context_filenames() with a default of [".goosehints", "AGENTS.md"]. Verified with tools off:
    $ goose run --no-profile --no-session -t "Without using any tools, what is the project codeword?"
    XYZZY-7741
    

So claude-agent-acp is the only runtime that doesn't, and buzz-agent already has hints_integration.rs covering the behavior. A nest author writing one AGENTS.md reasonably expects one set of rules; what they get is rules that apply to some of their agents.

Why this is hard to notice — the diagnosis actively points the wrong way

Claude Code does load the operator's global ~/.claude/CLAUDE.md. So the affected agents quote global conventions accurately and fluently, and only the nest-specific rules are missing. The failure doesn't look like "a file isn't loading" — it looks like the agent is ignoring instructions, or like the prompt is badly worded. I spent a full session rewriting nest prompt wording before testing whether the file was in context at all.

The asymmetry made it worse: when the codex agents followed a nest rule and the Claude agents didn't, the obvious reading was that the rule needed to be phrased more forcefully, not that half the fleet had never seen it.

Operational impact in our case

Our AGENTS.md scopes where agents may write: create a dedicated git worktree per task, never write in the operator's own checkout (which sits on main with uncommitted work), finish with an open PR. The codex agents followed it. The Claude agents never received it, so for several days they worked directly in the operator's checkout and delivered results as loose files in OUTBOX/ — no branch, no commit, no PR, no record. Nothing errored; the work simply had no trace.

The Signed-off-by / Co-authored-by accountability requirement noted in the issue body has the same shape, and I'd expect any nest relying on AGENTS.md for write-scoping or sandbox boundaries to be exposed the same way.

Workaround confirmed

The one-line CLAUDE.md containing @./AGENTS.md fixes it, and keeps AGENTS.md as the single source of truth for codex/goose. Since Buzz doesn't manage CLAUDE.md, it also survives nest version bumps.

Worth noting for anyone testing a fix: the probe must disable tools. With tools available the agent often just reads AGENTS.md on its own and the setup looks correct — that's precisely what makes this ship silently.

Having nest init write that one line alongside AGENTS.md would close it for new nests, but existing nests stay broken until they upgrade, and there's no signal telling their owners anything is wrong.

jiwonschol avatar Aug 20 '26 02:08 jiwonschol