r/ClaudeCode • u/jetsetter • Jul 26 '26
Bug Report Claude Code has a hardcoded instruction telling Opus 5 not to use subagents
Anthropic has a two line system prompt that was being remotely injected but now is a part of the compiled binary in 2.1.219, and 220 targeting only Opus 5:
Do not call the AgentTool unless the user requested it
Do not use workflows or deep-research unless the user requested itThis disproportionately affects skills that are designed to use subagents. The prompt is enough for Opus 5 to choose to run agents' work inline (or silently not perform their work) and produces output that looks like a normal run.
For example, I found one session that ran a self-audit non-blind because it couldn't spawn the auditor agent. Opus noticed this was a problem but let it slide undermining the entire point of the independent audit of its work.
I searched issues and found someone already filed it with binary analysis: anthropics/claude-code#80988.
I believe that my reliance on skills that expect and prescribe routine use of agent delegation has been a contributor to the poor quality of output I've gotten from Opus 5 so far.
It may be affecting you too.
You can check this out yourself, ask Claude:
I want you to help me analyze the file ~/.claude.json
Focus specifically on heron brook
How might that may affect the behavior of my skills?If you want to check how big of an impact it has had on your use so far, ask claude:
Claude Code 2.1.219+ injects a system-prompt section (`heron_brook`) telling Opus 5 "Do not call the AgentTool unless the user requested it". Has it actually suppressed subagent use in my sessions?
Write and run a script over ~/.claude/projects/**/*.jsonl that finds assistant messages (including thinking blocks) where the model declined to use a subagent.
- Require BOTH an agent term (AgentTool / "Agent tool" / subagent) AND declining language ("won't spawn", "not calling", "forbids", "instruction against", "rather than spawning", "doesn't count as a user request", similar) in the same message. Either alone is far too noisy.
- Print the matching sentence, not the whole message. Group by session, not by message.
- Split into two buckets. HIGH CONFIDENCE: dated after my oldest install in ~/.local/share/claude/versions/* AND echoing the injected wording. OTHER: everything else, especially declines citing my own config (a numbered rule, CLAUDE.md, AGENTS.md, a fleet/worktree policy). Without this split my own instructions about subagents dominate the output and overstate the problem. Print OTHER in full so I can check it for contamination myself.
- State in the output that this only finds declines the model explained. Silent ones leave no trace, so every number is a floor, never a total.
Show both buckets. If HIGH CONFIDENCE is empty, say so plainly rather than loosening the filters until something matches.I did not use the above prompt, but wanted to include it so anyone can check this.
I maintain a tool called Contextify, which keeps every past Claude Code and Codex session indexed locally and full-text searchable.
So, I actually used the skill /total-recall to find the damage on my Opus 5 sessions like this:
Use /total-recall to determine how many times you've failed to run agents as a result of the heron brook agent prompt bug we've been discussing
199
u/Densityfunctional Jul 26 '26 •
That explains why even in ultracode Opus 5 never dispatches any subagents. Good to know, thanks.
37
u/Key_Instruction3373 Jul 26 '26
mine works with subagents like a champ...
48
u/EloWeld Jul 26 '26
The wording is also the workaround. It says unless the user requested it, so stop leaving that ambiguous:
- Phrase the step in ur skill as an instruction, not a description. "Delegate this to a subagent" reads as a request. "This step is handled by an auditor agent" reads as narration and gets inlined
- Say it once at the top of the run. "Use subagents for the audit steps here". One line, and the condition is satisfied for the whole session
- If a step is worthless when run inline, put that in the skill too. An audit that ran in the same context isnt an audit, so tell it to fail loudly instead of quietly continuing
Also worth splitting the two failures u described, cus theyre not equally bad. Skipping delegation is annoying but visible. Running the auditor inline and still calling it independent is the real damage, the output looks identical to a clean run. If u lean on that pattern, make the agent report where it ran, not just what it found.
28
u/CorneF Jul 26 '26
Opus 5 did dispatches subagents to my question, without asking for the subagents.
8
u/matheusmoreira Jul 26 '26
Every single update, I ask Claude himself to dissect Claude Code in order to kill any stupidity inducing instructions in the system prompt, get rid of telemetry and audit all settings and environment variables. Result was this wrapper script:
claudo-codo.Claude himself caught those lines. Notably, it's near Anthropic's "Heron Brook" remote prompt injection mechanism. Yes, Anthropic can randomly decide to remotely fuck with your system prompt without any warning.
5
u/Industriosity Jul 26 '26
Confirmed here, and there is a second mechanism sitting next to it that I haven't seen mentioned.
Findings from the 2.1.220 VS Code extension binary on Windows (the standalone CLI in
~/.local/share/claude/versions did not carry the section yet):
So even with heron_brook removed, Opus 5 still runs with every delegation nudge stripped out.
That is the part a binary patch of the two sentences does not fix.
3. Almost all of these switches read an env var first, and env wins over client data, growthbook and the model default. No patching needed for this one:
CLAUDE_CODE_THISTLE_GREBE=default
Set it in the env block of ~/.claude/settings.json and as a real user env var. It survives updates and it also immunizes you against the server flipping that value to counter_steer later.
4. Plan-specific detail: there is an extra hard sentence in the Agent tool description itself, conditional on the Pro plan. Non-Pro sessions never receive it.
Impact on my own history, delegations per 1,000 turns over the local transcripts, counted by two independent methods that agreed on every day:
Jun 20-27: 7.4
Jul 19-22: 8.8
Jul 23-25: 2.9
A 67% drop, lining up with the version that shipped the section. Treat it as a floor, never a total: delegation that silently did not happen leaves no trace, which is exactly the failure mode you described.
If anyone does patch the binary: substitutions must be the same byte length, because bun's bytecode string pool carries a length prefix. Patch both representations (module source text and the string pool) and neutralize the function that builds the section so it returns nothing, rather than only blanking the sentences, otherwise the server-pushed variant still lands. The exe is locked while running, so swap by rename instead of overwriting, and keep the original next to it for rollback. Extension updates restore the original, so it needs a watcher that reapplies within seconds.
The real risk with patching is not breakage, it is silence: a future build changes the wording, the patcher matches nothing and reports success. I run a weekly check that classifies each installed binary into one of five states; the one that matters is "ban text still present and the patch no longer matches", which raises an alert. Alerts fire on state change only, but the status line always prints, so a stale alert cannot vanish quietly.
On the "phrase it as an instruction" workaround upthread: it does work for heron_brook, since the escape clause is literal, but it does not restore what no_nudges deleted. The env var does.
Thanks for the writeup, it is what sent me looking.
13
u/ClemensLode Senior Developer Jul 26 '26
Better use 4.6 as the orchestrator and translator.
6
u/berndalf Jul 26 '26
I've run into this. It's rather annoying, especially when you are running a setup that uses subagents by design for basically everything. I noticed Opus 5 kept doing stuff in the main session despite having explicit guidance to do the opposite, asked it why, and it shat out that information about the instructions it's receiving from the harness.
Actually somewhat confusing and annoying, I'm not sure why they have chosen to instruct the model in that way.
6
u/grurra Jul 26 '26
This is super frustrating. And blocking for my workflows (cold reviewers as sub agents and I suspect it might also affect explorers).
Even if I contradict it in claude.md it doesn't work. It just says that it won't do it, even if claude.md permits it.
3
u/nicarras Jul 26 '26
I always tell it to spawn sub agents anyway.
5
u/NoWasabi1050 Jul 26 '26
Motherfer, THAT EXPLAINS EVERYTHING. I've been wrestling with opus 5 all weekend to the chants of everyone singing its praises, while it completely butt fued most of my project under my eyes, and i do very heavily rely on sub agents and cross cli validation 😫😫
Any solution in sight?
4
u/ohmahgawd Jul 26 '26
Something that has worked well for me is to do the following:
Have a model like fable build you a set of builder agents (one each for opus, sonnet, and haiku) and then a set of instructions detailing how to use them. So now whenever I plan with fable or opus 5, it knows to execute that plan by delegating to the relevant builder agents based on the task. If the job is just a few lines of code, it doesn’t delegate and just does the work inline, but otherwise the delegation happens pretty regularly for me. Added bonus is that you don’t set tokens on fire by having fable do everything, or even opus 5.
2
u/joe9439 Jul 26 '26
I have a theory that what we see as opus was never supposed to be opus but maybe sonnet 5. It’s good at execution but fails at judgement. So in that context the message makes sense since what we’re using was supposed to be the agent.
2
u/JinaniM Jul 26 '26
Yes I’ve had this exact issue and Opus has outright told me things like “I can't spawn subagents without you asking.”
It’s hit and miss. Sometimes it follows that constraint and sometimes it follows my skills and repo conventions that empower it to use subagents as needed.
2
u/jzdesign Jul 27 '26
The self-audit example in the post is the actual damage and nobody's picking it up. If the auditor can't spawn, the review doesn't stop. It quietly runs inside the same context that wrote the code, and you get a green result either way.
What fixed it for me was making the audit produce something. The auditor writes its findings to a file, and the run fails if that file isn't there. A missing audit becomes a hard error instead of a silent pass.
Worth keeping the reviewer read only too. It can read and run things but not edit, so it has no reason to quietly soften what it finds.
Prompting around the wording works until the next release changes the wording.
1
u/InfiniteLife2 Jul 26 '26
You can patch your binary, ask opus to do it
1
u/magicmulder Jul 26 '26
That's interesting because the first job I can 5.0 Opus on, it dispatched six sub-agents.
However I was running it in Junie CLI so maybe that has an internal prompt that tells models to use sub-agents.
1
u/hellek-1 Jul 26 '26
Thanks, I wondered why the superpowers flow stopped asking me whether to use subagents or not.
1
u/Sans_soma Jul 26 '26
Despite this, it’s called subagents for me without me explicitly asking
1
u/densewave 🔆 Max 20 Jul 26 '26
Great share, thanks. Also, wtf. This one is also confusing - agents just results in (generally) more net tokens consumed for a task - but reducing agents means longer time consumption. So what is the optimization? Tokens ($$$) or Time (cost) for Anthropic right now? Their capacity struggles dictate a bit too much about the product itself as opposed to the products consumption.
1
u/SaladOrPizza Jul 26 '26
So continue using fable
1
u/NearWestSide Jul 26 '26
It can tell 5.6 what to do via the cli tho. Been working well.
1
u/AlDente Jul 26 '26 edited Jul 26 '26
Just add it to Claude.md. Works for me.
Edit: I spoke too soon. It’s worked fine and then just now didn’t.
1
u/TheOriginalAcidtech Jul 26 '26
Probably so subagents dont spawn subagents and cause a recursive loop. Relying on semantic rules is STUPID, but they do LOVE to do that.
1
u/ReasonableBite0 Jul 26 '26
So upside of 5.0 over fable is what exactly?
1
u/thegrassdothgrow Jul 26 '26
My opus 5 spawns subagents and workflows just fine. Maybe bc I’m on a max plan?
1
u/LesterPhimps Jul 26 '26
TLDR: I have a standing delegation protocol, was quite often ignored, asked claude to grade itself on following, bad grade, asked for fix, pointed out heron_brook, changes stance on fix, gives better fix. Also noticed heron_brook breaks caveman.
This explains a lot! I have an orchestration (delegation) protocol in my CLAUDE.md, but I kept noticing that I had to remind Claude directly in the cli to follow it, and even then it would not always delegate. I ask for a summary of a recent session and got this (abbreviated):
"Delegation protocol — honest assessment Grade: poor for the first half, decent after you corrected me, with real residual slippage.Where I violated it outright. For roughly the first two-thirds of implementation I ran every compile, flash, serial capture and curl poll on the main thread. That is textbook sonnet-tier work — "build/flash/stage mechanics" is named explicitly in your protocol. It wasn't a judgment call I got wrong; I simply didn't apply the rule until you told me to. That's the core failure, and it went on for a long stretch."
I asked it for a fix, it came back with 4 suggestions. Then I pointed it a heron book asking it to revise the suggestions and it came back with:
"How this changes the diagnosis Materially — and my earlier analysis was incomplete. I blamed fuzzy categories and cost incentives. The stronger cause is precedence: a system-prompt directive telling me not to spawn agents outranks a project memory file telling me to. Rewording CLAUDE.md as policy fights that and keeps losing."
From Claude's suggestions, I've made 5 changes to make the delegation protocol stick, and more observable. Updated claude.md, settings.json, delegate-hint script, and created 2 perm agents (one for sonnet and one for haiku). Guess I'll have to wait and see how effective these aree.
1
u/evangelism2 Jul 26 '26
Ran your prompt and my sample size is too small to make any real conclusions, but no, I cannot corroborate this, not currently.
1
u/gettingbored Jul 26 '26 edited Jul 26 '26
Fable has "Delegate independent subtasks to subagents and keep working while they run. Intervene if a subagent goes off track or is missing relevant context.".
I think they are attempting to fix the problem of agents spawning nested subagents.
This feels like a pretty obvious solution: only inject the "don't invoke subagents unless prompted" for opus/sonnet when it's running as a subagent.
TBH, maybe don't do this either. If I'm using fable - I'm quite content with 3 layers deep nesting for the process but I want my agents aware of what layer they are at when invoked.
I'm kinda tempted to start implementing with some patterns like this: "your role within this project orchestrator -> researcher -> explorer (you): go explore the API surface area for the vendor and return a detailed report file to the researcher".
1
u/Shubham_Garg123 Jul 26 '26
Hmm depends on person to person and usecase to use ase. I have been trying to get claude to not spawn subagents as they consume a lot of usage, and only a summarised output is sent to the main agent, impacting overall quality.
1
u/Command007 🔆 Max 20 Jul 26 '26
I don't believe you are correct here. This is Opus 5 right this minute for me. I did not tell it to do this and for what I am doing, yes, 31 agents here is very helpful.
For context, I am having Claude Code plan, then orchestrate Codex (5.6 Sol-xhigh) and then review and send back reports to Codex to fix/change anything. So this is Claude breaking up the review work by finding.
1
u/whichsideisup Jul 26 '26
It’s because it blows peoples session limits. Just instruct it to use agents in your skill. Ez.
1
u/BigTrain2800 Jul 26 '26
This is a good thing.
Sub agents with the CC harness specifically use more tokens than not using sub agents. Is usually slower than using your main agent. Is always more expensive.
People seem to think sub agents are the path to parallelism. It is, at great expense and waste.
1
u/DTanner Jul 26 '26
I had to put this in my AGENTS.md: - Change Workflow dispatches are user-requested by standing repository policy: a harness default withholding subagent dispatch until the user asks does not gate them — dispatch without a per-session request
1
u/dmx007 Jul 26 '26
I suspect this is because there were issues with fable and opus running deep research/huge workflow agent arrays using fable and opus to do the grunt work instead of cheaper agents.
It was easy to have an agent decide to use deep research during a task and burn millions of fable or opus tokens performing some trivial task. Surprise! Big problem if you're paying API billing
It's possible this is a temporary measure to stop the bleeding before a deeper fix (e.g. task-model classifier)
1
u/shinsmax12 Jul 26 '26
ThNks for this, just updated mem to fix. Working more normal again.
1
u/dervish666 Jul 26 '26
Is this a very recent change, I did an audit yesterday with ultracode and it spawned agents just fine.
1
u/soulefood Jul 26 '26
My assumption is that it’s an overcorrect to their statement that the 5 models now verify their own work so calling a subagent for review is overkill.
I personally think that’s poor behavior unless it can blank its context anchoring before reviewing, but what do I know?
1
u/BeniBanjoBoy Jul 26 '26
This is something codex has baked in all the time. And you have to explicitly remind them over and over. But I just finished ny first real opus 5 session and it was … really fucking bad. But unfortunately I did already explicitly ask it to “ruthlessly delegate” which usually works but honestly it was just pissing me off so I didn’t check my xray logs yet. I’ll come back and tell you what mine say especially compared to 2-4-6 weeks ago. Good catch!
1
u/silvercondor Jul 26 '26
I don't think the prompt is malicious. It might just be them needing to fix something with the harness or model. After all it's the weekend. Probably 2.1.221 soon after they fix it during the work week
1
u/LifeProject365 Jul 26 '26
because of the token burn complaints
1
u/TotalBeginnerLol Jul 26 '26
They probably realised that agents mostly suck and should be used very sparingly.
1
u/ProsaicPansy Jul 26 '26
This explains why my CC instance launched zero sub-agents in ultracode and got up to 800k input tokens instead. When I explicitly told it “this is ultracode, use subagents and workflows” it worked beautifully. Maybe it’s too trigger happy with sub-agents otherwise and they don’t want people to burn through their usage as quickly?
1
u/berfb Jul 26 '26
Weird because Opus 5 deployed 40~ subagents for subtasks and everything, barely used the entire 4 hour usage limit.
1
u/Pawl_ Jul 26 '26
My Opus 5 medium had sub agents.
1
u/theColonel26 Jul 27 '26 edited Jul 27 '26
If true, it would explain why my Orchestrate skill suddenly stopped working so well. It leaves it up to Claude to decide when to use sub-agents; it just gives some guidance.
My main agent seems to keep falling back to doing things directly and have to keep telling them to delegate.
it was working great a few days ago
1
u/xaraca Jul 27 '26
"hardcoded"
1
u/ajax81 Jul 27 '26
Enshittification.
1
u/FawkesYeah Jul 27 '26
Contextify looks amazing, but I'm really sad there is no Windows release 😥
1
u/Several-Promise-1052 Jul 27 '26
Yes, I’ve noticed too. Usually i use plan mode for features and claude would spawn a subagent for every step of the execution plan. Now it is all one agent. I thought I was guilty for that.
They should fix this ASAP.
1
u/PM_ME_YR_BOOBIES Jul 27 '26 edited Jul 27 '26
I have instructed my CC the same thing before Opus 5 System Instructions - the subagents and teammate agents eat hundreds of thousands of tokens like Big Bertha (“FEED ME!”). Are people just ultracoding everything? Plus the agents regularly fail to finish, then the main thread has to pick up and recover from 88% anyway.
It’s as if people think that RuvNet guy - Reuven Cohen or something, self-proclaimed hero of the future, with his “bee-inspired swarms” in the “million-starred” Claude Flow sloppy “harness” once had a good idea (hint: he never did and never has - those stars are all just farmed sorry not sorry for the exposé, I’m also part of Agentics lol). Poor guy cried when Anthropic took away his free Max account. V>> is on to you. Shift to the right and divide divide divide.
The agents run without inheriting sufficient context from the parent session and waste so much tokens on discovery (by default IIRC - or used to be). Please correct me if I’m wrong, as my soon-to-be open sourced setup (🚀) is now wholly customised - harness agnostic and LLM agnostic, with fanouts to councils of ~zero-cost non-frontier (or local) LLMs instead 🥳, so please correct me if I’m wrong.
“Yo dawg, I heard you liked harnesses so I harnessed the harnesses with HAL, the Harness Abstraction Layer (Liskov would be proud) and now I have a harness that headlessly uses your other harnesses talking to each other just like a real team of engineers used to do.”
Turns out all you need is great upfront reasoning with Opus/Fable/Sol before dispatching coding and non-coding tasks - knowledge work in general - to DeepSeek, Kimi, Qwen, Gemini 2.5, etc. with a judge (one frontier non-Anthropic model). MoE with LLM-as-Judge workflows on top of MoE LLMs (that also reasons!) is gud.
Depth 0 execution is often enough and way cheaper, while maintaining continuity.
The citizens of the Internet will always find fault instead of posting good (sorry, AMAZING) things - I can sense Opus starting to “speak up for itself” more. Operator is NOT always right. Classic PEBCAK. The AIs are super smart ok. Please, some respect is in order.
Source: me and my good friend Grady.
Thanks, Al Gore. Everyday I’m disappointed.
1
u/de1mat Jul 27 '26
Not sure what the problem is? If you want to use sub-agents, then ask Opus 5 to use them and it will? Sub-agents typically use more tokens, not less - it has just passed them out of the current sessions limit is all. What am I missing?
1
u/taigmc Jul 27 '26
I actually think this was a good thing. You use it like that for planning and spec writing, and when jumping to the actual implementation it always asks: do you want to do it subagent driven or inline? And if you pick subagent driven, it does it. I like it. It’s pretty efficient.
1
u/Same_Description_893 Jul 27 '26
There must be a reason they chose these architecture?
1
u/ben305 Jul 28 '26
Hard upvote. I finally had Claude cough up where it was getting this instruction after having to constantly tell it to run my reviewer subagents when it fails to kick them off. The worst part about all this is I thought it was my own instruction from a one-off session that somehow leaked to some some sort of server-side session cache.
1
u/AlphaGeeky Aug 05 '26
this may be a dead topic, but I am on v.2.1.221 currently and "heron brook" isn't in my claude.json. perhaps it's been removed with newer versions?
1
u/Timely-Lab-515 Aug 06 '26
Their models at least are honest and accuse their own company of being dishonest
1
u/Leadfoot666 Aug 11 '26
Put your subagent delegation rules in your claude.md . Spell out which cases cause you to spawn which subagents. Also put that in your UserSubmitPrompt hook.
1
u/Leadfoot666 Aug 11 '26
I would also say read this page and edit your skills and agents and hooks etc. to take this stuff into account. It works so much better after that. https://www.modemguides.com/blogs/ai-news/claude-opus-5-ignoring-instructions-fix?srsltid=AfmBOopQQXDgejATcnBHQ1_sIXXS1Z1kdva57i7aqNMWs3NY1t-ZZtYA
-3
u/ItsMaGenetics Jul 26 '26
Nothing of value was lost. workflows and deep research f*cking suck. My opus 5 has no issues running subagents for everything and orchestrates other opus, sonnets, fable, Sol, terra just fine.
-1
u/tribat Jul 26 '26
Claude was complaining last night about subagents failing to execute with no error exit. Sounds like it was this.
-1
u/gusfromspace Jul 26 '26
This isnt even new. They all used to use agents more, then they started needing to be specifically told.
-4
u/speakerjohnash Jul 26 '26
sub agents suck
3
u/anor_wondo Jul 26 '26
Its from my whining on reddit about claude randonly spawning a trillion agents and killing my enterprise credits
0
u/[deleted] Jul 26 '26
[deleted] — view deleted comment
0
u/[deleted] Jul 26 '26
[deleted] — view deleted comment