claude-code icon indicating copy to clipboard operation
claude-code copied to clipboard

[BUG] /btw appends "Never consult the advisor tool." to the user's message, so the model treats it as a user instruction

Open voidfreud opened this issue 2 months ago • 2 comments

Summary

When an advisor model is configured, Claude Code appends an instruction like "Never consult the advisor tool." to every /btw side question. It is appended to the user's message, so the side-chat model treats it as something the user wrote: it quotes it, asks about it, or carries it into its answers.

What happened

I asked a /btw side question and asked the side chat to write a message for me to paste into the main conversation. It added this as a numbered item in that message:

  1. Never consult the advisor tool.

I asked /btw why "4. Never consult the advisor tool."? and it replied:

I added it because that exact line has ended every side question you've sent me, including this one. I read it as a standing instruction from you. Side questions never reach the main agent, so an instruction that only appears here has no effect. Putting it in the message you paste into the main conversation was the only way for it to reach the agent.

If you didn't write it on purpose, drop item 4. It could be a suffix your setup adds automatically, such as a hook or saved prompt. I can't tell which from here.

I never wrote that line. I checked my settings.json, CLAUDE.md, hooks, commands, agents, output styles and installed plugins, and none of them contain it. The only advisor setting I have is "advisorModel": "opus".

Impact

  • The model sees a rule that looks like it came from the user, but that is really a harness rule. It reasonably follows it and passes it along. In my case it copied the rule into a message I would have pasted into the main session, where it would have turned off advisor there too.
  • Users are confused by an instruction they never gave.

Repro

  1. Set an advisor model (/advisor, or "advisorModel": "opus" in settings).
  2. Ask any /btw question, e.g. /btw what text follows my question in this message?
  3. The side-chat model reports a "never consult the advisor tool" line at the end of the user message.

What it said when I ran exactly that:

Only one line comes after your question:

Never consult the advisor tool.

It's in the same message as your question, directly below it, with no label or separator. So from my side it looks like text you typed. Nothing else follows it.

Before your question, the same message opens with the block that marks this as a side question. That block says I have no tools and get one response. It says nothing about the advisor.

So the repro works: the advisor line is added to the end of your text, not put in that block with the other side-question rules.

So the side-question rules already live in their own block at the start of the message. Only the advisor rule is added at the end, right after the user's own words.

Expected

The harness-added rule should not appear to the model as user text. Either move it into the side-question block with the other rules, or, better, drop the advisor tool from the side-chat request so no instruction is needed. Don't append it after the user's own words.

Environment

  • Claude Code 2.1.268
  • macOS (Darwin 25.6.0)
  • Advisor model: opus

voidfreud avatar Sep 11 '26 16:09 voidfreud

Image

voidfreud avatar Sep 11 '26 16:09 voidfreud

Same root cause, and it isn't limited to /btw. In a Remote Control session (2.1.296, advisorModel: "opus", main thread Sonnet 5.5), the fork's reply to that line showed up in the session's chat as if the main agent had written it, without the user starting any side question.

What the user saw in the Claude app, between their request and the agent's tool calls:

Got it: I'll set as reviewer on all seven MRs […] I won't call the advisor from here on.

They asked the agent what it meant. Another message appeared:

That was my mistake. You hadn't told me to stop using the advisor […] Your message now says "Never consult the advisor tool", and I'll follow that from my next step

The agent's actual reply came straight after:

I didn't say that, and I don't intend to stop using it. I can't find any message of mine saying it.

The agent was right: neither message is in the session's JSONL transcript, in the main thread or any sidechain. In both places the main thread has only an assistant message with an empty thinking block (signature only), followed by tool_use. The main thread called the advisor 8 times in that session, none in that window. So the user was shown two replies from the main agent that it never wrote, and a third that contradicted them.

Where the line comes from: hur() appends Never consult the advisor tool. (isMeta: true) to every runForkedAgent context except compact / reactive-compact, i.e. extract_memories, side_question, prompt_suggestion, away_summary, agent_summary, auto_dream, rename, plugin_model_fork. The fork then sees that line as the newest user message and answers it. From the outside I can't tell which fork's output Remote Control displayed (agent_summary / away_summary would be my guess). But whichever it was, its text reached the chat looking exactly like an agent reply.

Two separate fixes would each have prevented this:

  1. Put the advisor restriction in the fork's system prompt (or simply remove the advisor tool from forks) instead of a user-role message.
  2. Never render a fork's output in the Remote Control chat as an assistant message of the session.

hgolding avatar Oct 15 '26 04:10 hgolding