Custom `agent` setting suppresses the output-style body in the system prompt
Summary
When a custom agent is active, the output style body does not load into the system prompt. The session reports that the style is active on each turn, but the rules are absent from context. The model then tries to follow a style it cannot read.
Environment
- Claude Code 2.1.238, macOS
- Output style: a plugin-provided style with a 181-line body of rules
- Setting:
"agent": "PACT:pact-orchestrator"in~/.claude/settings.json - Setting:
"outputStyle": "ste:ste"in~/.claude/settings.json
Steps to reproduce
- Select an output style that has a body of rules.
- Set
"agent": "<any custom agent>"in~/.claude/settings.json. - Start a session. Tell the model to quote the first line of its output style, and to use no tool.
Result
Two arms. One difference between them.
Arm A, custom agent active:
claude -p 'Do not use any tool. Quote the first line of your output style.'
The model reports that a style is active and that the body is absent from its context. It cannot quote the line.
Arm B, generic agent:
claude -p --agent claude 'Do not use any tool. Quote the first line of your output style.'
The model quotes line 1 accurately and reproduces the rule tables in the body.
The agent is the one difference. The style setting, the style file, and the working directory are the same in the two arms.
Expected
The output style body loads in addition to the agent persona. The two have different jobs. An agent defines a role. A style defines how to write.
Impact
The reminder on each turn says the style is active, which is misleading. The model guesses the rules from the name of the style and produces output that breaks them. When a hook validates output against the same style, the model cannot read the rules it must obey, and each block costs a full rewrite.