Skip to content

Stage 2's main agent reads the sub-agent's own system prompt, and nothing uses it #654

Description

@johanzander

Problem

Stage 2's main agent reads .claude/agents/bess-analyst.md (25,681 B) as
REQUIRED READING item 3. That file is the bess-analyst sub-agent's own
system prompt, and no step in the workflow prompt tells the main agent to use
it for anything.

Follow-up to #650, which cut CLAUDE.md from the same floor. This is the
second-largest item left.

Measured

It is the sub-agent's system prompt. Frontmatter: name: bess-analyst,
tools: Read, Grep, Glob, Bash, WebFetch. So the main agent's read is a second
copy in a different context window, not a shared one.

No instruction consumes it. The six PROCESS steps are: get issue context →
identify the current problem → delegate to bess-analyst → verify the cited
file:line → publish → label. Item 3 is described as a "domain expertise
checklist", but nothing directs the main agent to apply it. Its one distinctive
task — step 4, "reading the file:line locations it cited … quote the actual
code" — needs the code, not a triage checklist.

The prompt already inlines the critical content. The task the prompt passes
to the sub-agent is a near-verbatim restatement of the file's
## CRITICAL: Separate Evidence from Claims — the section most plausibly
serving as a judging standard:

bess-analyst.md already inline in the prompt
"The reporter's description is a hypothesis, not a diagnosis" "The reporter's explanation is a HYPOTHESIS — do not assume it is correct"
"Never start from 'where in the code could this bug be?' … Start from what the debug bundle shows" Step 2 "Triage the LATEST debug bundle FIRST"; Step 3 "Only after triage, read the design docs"
"verify that BESS Manager actually uses code path Y for this user's setup (inverter type, integration…)" Step 2 "whether the reporter's HA integration matches the code path BESS Manager uses. Check inverter type (MIN vs SPH vs SolaX)"
"If the debug bundle shows fundamental issues … flag those FIRST" Step 2 "If sensors are unavailable … that is likely the real problem"
"A design choice that is intentional and documented is not a bug" Step 4(b) "the behavior isn't intentional per the design docs"

That content is currently loaded three times: sub-agent system prompt,
main-agent file read, and paraphrased inline.

The artifacts agree. All four landed Stage 2 analyses (#118, #252, #624,
#627) use the workflow's four headings — ## Root cause / ## Evidence /
## Proposed fix / ## Risks / open questions. None uses bess-analyst.md's
seven-item Output Format or its six-item type-B shape. #118's Evidence section
is exactly what step 4 asks for: quoted code at cited lines.

What is NOT duplicated

## Root-Cause Decomposition — the P-optimality / forecast-error /
control-noise split, with "do not average them into one blended verdict … that
has repeatedly produced wrong conclusions on this repo." That is a real
standard and it is not in the prompt. But it is a standard for the
investigator, which the sub-agent already has; the main agent holding an
unread copy changes nothing while no step asks it to audit against it.

Proposal

  1. Drop item 3 from Stage 2's REQUIRED READING.
  2. Because the decomposition standard is worth holding at the main-agent level,
    turn it into an instruction that actually fires — extend step 4 to reject a
    sub-agent report that blends the three categories into one verdict, or that
    cites no file:line.

Net: dead weight becomes a check. Saving is up to 25,681 B off the main agent
per turn
(floor 92,438 → 66,757 B, −28%). "Up to", because whether a given
run complied with the read instruction is not observable — #646 showed
non-compliance happens.

Limits of this evidence

Inspection plus artifacts, not a controlled experiment. What is shown is that
nothing consumes the read and its critical content is already inline — not
that behaviour is provably identical without it. That is also the argument for
adding the step-4 check rather than only deleting: it leaves the main agent
with a stated standard instead of an unread file.

Explicitly out of scope

  • Editing .claude/agents/bess-analyst.md itself. The sub-agent needs it whole.
  • The other floor items (rules.md, architecture.md, the inline prompt) —
    all three are consumed by named steps.

Acceptance

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions