[BUG] heron_brook prompt text names a nonexistent tool ("AgentTool") and contradicts the background-job subagent instruction in the same prompt
Preflight Checklist
- [x] I have searched existing issues and this hasn't been reported yet
- [x] This is a single bug report
- [x] I am using the latest version of Claude Code
What's Wrong?
The default text of the heron_brook dynamic system-prompt section is defective on its own terms, independent of the governance questions raised in #80988 and #80998. Two problems, both in the same two lines:
- It names a tool that does not exist. The text says
AgentTool. The tool actually exposed to the model is namedAgent. - It contradicts a sibling Anthropic-authored section in the same rendered prompt. The background-job section instructs the model to spawn subagents proactively;
heron_brookforbids it unless the user asks.
This is not the user-config-vs-harness precedence gap of #80998. Both conflicting texts here are Anthropic's own, so no precedence policy is needed to fix it — one of the two texts is simply wrong.
Evidence
Observed first-hand on 2.1.220 (Opus 5, background job). Both of the following were present in the same rendered system prompt:
For noisy investigation (grep sweeps, log trawls, broad search), spawn a subagent
when you have the Agent tool, and keep only the findings here.
Do not call the AgentTool unless the user requested it
Do not use workflows or deep-research unless the user requested it
The tool list in that same prompt registers the tool as Agent, and the tool's own description refers to "the Agent tool".
The cause of the name mismatch is visible in the shipped strings (~/.local/share/claude/versions/<version>, Mach-O arm64). The background-job line interpolates the tool name:
For noisy investigation (grep sweeps, log trawls, broad search), spawn a subagent when you have the ${Go} tool, and keep only the findings here.
heron_brook's text hardcodes it instead, and hardcodes a different spelling:
["Do not call the AgentTool unless the user requested it",
"Do not use workflows or deep-research unless the user requested it"]
So the same tool is referred to by two different names in one prompt, and the hardcoded one matches nothing in the tool surface.
For contrast, the second line is fine: deep-research is a real predefined workflow name, so "Do not use workflows or deep-research" binds correctly. Only the tool name is wrong.
Why it matters
- A directive that names a nonexistent tool has undefined binding. A model may reasonably read
AgentToolas not referring to theAgenttool it actually holds, in which case the guardrail silently does nothing — or it may generalize the name past its intended target. Neither outcome is the intended one, and which one occurs is left to inference. - The contradiction forces the model to adjudicate between two instructions that both carry harness authority, with nothing in the prompt indicating which governs. In my session the two co-occurred with no precedence signal.
- Both are cheap to fix and do not require resolving the opt-out or precedence debates in #80988 / #80998.
Precedent
- #80988 — asks for an opt-out for this section; documents the
heron_brookgate and blast radius. Does not note the tool-name mismatch. - #80998 — asks for a precedence rule between harness sections and
CLAUDE.md; explicitly scopes the section's wording out ("the content of that particular section is beside the point here"). - #38183 — prior instance of shipped prompt text referencing a tool that is not available.
Proposed shape
Smallest viable change, in two parts:
- Interpolate the tool-name constant in
heron_brook's default text rather than hardcodingAgentTool, so it renders as the same name every sibling section uses. - Reconcile the two texts. Either scope the background-job spawn instruction so it does not fire while
heron_brookis active, or narrowheron_brookso it does not countermand a sibling section that is also on by default.
Acceptance criteria
- [ ] No rendered system prompt refers to the subagent tool by a name absent from that prompt's tool list.
- [ ] The background-job "spawn a subagent" instruction and the
heron_brook"do not call" instruction are not both present in a single rendered prompt, or one is explicitly scoped so their overlap is not contradictory. - [ ] A regression check asserting that tool names appearing in dynamic prompt-section text resolve against the registered tool set.
This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗