Skip to content

With a stop hook, most of the Assistant text is hidden inside "Worked for [time]" #1355

Closed

Description

@9amhealth-gregschwartz

When assistant turn contains multiple text blocks, e.g. using a stop hook, bb treats only the last one as the message, and collapses everything before it into a "Worked for..." section.

So the visible message is missing a lot, and is often just a reply to the hook failure.

The result is that the answer looks missing. I had to notice the little chevron and expand the 'worked for' section to read the rest.

Repro

  1. Configure a Stop hook that blocks — exit 2 with text on stderr, or print {"decision":"block","reason":"…"}
  2. Ensure its blocking condition is persistently true, so it fires on every turn
  3. Ask any question

Claude answers (text block 1) → the Stop hook vetoes the stop and its reason is injected as a user message → Claude emits a short acknowledgement (text block 2) → bb shows only block 2.

Stop hooks are the easiest trigger, but nothing here is hook-specific: any turn ending in text → tool_use → text has the same shape.

Screenshots

Collapsed

What I actually see. The visible text is the model answering the hook, not the user:

Image

Expanded

The looooong answer to my questions, which was hidden under "Worked for 45s":

Image

Another example, collapsed

Image

Expanded

Including explicit questions the user was being asked to decide on :(

Image

Transcript evidence

From ~/.claude/projects/<project>/<session>.jsonl, one turn:

row type content
692 assistant text — "Fair pushback. Taking these in order…" ← the answer
693 user (isMeta: true) Stop hook feedback: … no fresh fast-loop verdict for HEAD (5bec6068…)
695 assistant text — "The verify gate is still open. Nothing changed this turn…" ← the only part rendered

Rows 702/709 are the second screenshot, identical shape.

Expected

Every assistant text block in a turn should be visible at rest. Tool calls and their results are reasonable things to collapse; prose addressed to the user is not.

Possible suggestions to solve it:

  1. Render all text blocks in sequence; collapse only tool activity between them
  2. Keep the collapsible but leave text blocks outside it, in order
  3. If a heuristic must pick one block, pick the longest rather than the last — a 40-word acknowledgement after a 600-word answer is not the message

Notes

  • Claude Code's own REPL prints every text block in order, so the same session reads correctly there and wrong in bb. Same data, different grouping.
  • The failure is silent and worse the more the user relies on hooks. A user who doesn't know to expand the "Worked for" section just sees an assistant that stopped answering questions.
  • Labelling matters too: "Worked for 45s" reads as a duration stat, not as a container holding the reply. Even with the grouping unchanged, a label that hints at hidden prose would reduce the damage.

Environment: macOS 15 (Darwin 25.5.0), bb desktop, Claude Code via the Agent SDK.

Activity

  1. added theissue type on Aug 12, 2026
  2. added
    providers
    provider-claude-code
    on Aug 18, 2026
  3. SawyerHood commented on Aug 18, 2026

    @SawyerHood
    Collaborator

    Reproduction & root-cause report: https://get-bb.github.io/reports/issues/1355.html

    • Verdict: REPRODUCED · root-cause confidence: high
    • Root cause (short): Completed-turn grouping in @bb/thread-view keeps only the LAST assistant-text of a turn segment outside the collapsed "Worked for" summary (completed-turn-grouping.ts splitCompletedTurnMessages + findLastTerminalTimelineMessage), and provider-claude-code drops the SDK's synthetic Stop-hook-feedback user message (event-translation.ts case "user" breaks when there are no tool_results), so the real answer preceding the hook re-query is folded into the summary with no boundary to preserve it.
    • Proposed fix: Primary: in packages/thread-view/src/completed-turn-grouping.ts (groupCompletedTurnSummaryMessages), promote every top-level completed assistant-text message (no parentToolCallId, not legacy) to an ungrouped-message item in order and let each run of tool/work activity between them be its own summary group, so only activity is collapsed; update completed-turn-summary-rendering/CLI snapshot tests (app and bb thread log share the row builder). Secondary: in plugins/provider-claude-code/src/event-translation.ts case "user", stop discarding isSynthetic "Stop hook feedback" user messages (emit a s…
    • Caveats: Revision changes: (1) major finding fixed and re-verified live on a fresh instance at 16ceb3a — plain pnpm bb:dev machine list --json | jq really fails (header on stdout, HOST empty); report now uses pnpm --silent bb:dev machine list --json 2>/dev/null | jq -r '.[0].id' (prints host_w72av593zm) and captures PROJECT/THREAD into shell variables via jq instead of hardcoded ids; (2) whole 4a seq…

    The report has copy-paste repro steps, screenshots where the bug is visual, code permalinks at 16ceb3a54, and repro artifacts. It was independently re-run by a second agent (see its Verification section).

    AGENT GENERATED: by Claude Opus 5

  4. added
    confirmed-repro
    on Aug 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    confirmed-reproprovider-claude-codeproviders

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions