Add setting to collapse/hide harness blocks (<task-notification>, <system-reminder>) in chat UI

Resolved 💬 1 comment Opened May 1, 2026 by svassaux Closed Jun 1, 2026

Summary

The Claude Code chat UI renders raw <task-notification> and <system-reminder> XML blocks as visible message bubbles in the conversation stream. For sessions that use Monitor and run_in_background: true heavily (long-running browser automations, multi-agent supervision, log tailing, OTP waits), the chat becomes dominated by these blocks and actual conversation content is pushed off-screen.

There is currently no opt-out: I checked the extension settings, ~/.claude/settings.json schema, and CLI environment variables — nothing exposes a render toggle.

What the user sees

A real example from a session with one active Monitor stream:

<task-notification>
<task-id>bm2tiedq5</task-id>
<summary>Monitor event: "Watch amazon login flow live"</summary>
<event>==AMAZON LOGIN==
==QUEUE==
2aa19e5d explore-pennylane running</event>
</task-notification>

The block renders as a chat bubble with a Show less affordance. From the user's POV it's noise: the user already knows about the background task they spawned, and the model has its own private signal channel to act on the event.

Where the blocks come from (verified in cli.js v2.1.126)

  • The CLI emits each block via uA({value, mode: \"task-notification\"}) — once per Monitor event, once per run_in_background Bash completion. The mode is registered in f7z = new Set([\"task-notification\"]), but only used for internal queue dispatch (Z7z, rw6), not as a render-suppression flag.
  • The message itself is pushed via lo({type: \"system\", subtype: \"task_notification\", ...}).
  • Webview (webview/index.js) has a handleTaskNotification that consumes the event for subagent task tracking, but does not suppress rendering of the underlying message.

What I checked for an existing toggle (none found)

| Source | Result |
|---|---|
| Extension package.json (claudeCode.* settings) | 13 settings exposed (env vars, terminal, autosave, permissions, etc.) — none related |
| ~/.claude/settings.json schema (claude-code-settings.schema.json) | notifications_disabled exists only as an enum value for terminal-type detection, not a render toggle |
| cli.js env vars (process.env.CLAUDE_*) | ~50 env vars (OAuth, Bedrock, Vertex, fast-mode, plan mode, …) — none for harness rendering |

Why behavioral rules don't fix this

A common workaround is a CLAUDE.md rule telling the model to \"never echo harness blocks\". That only prevents the model from quoting them in its own output — but the visible bubbles are injected by the harness itself, independent of model output, so model-side rules do nothing about the actual rendering.

Proposed solution

Add a setting (extension config or ~/.claude/settings.json) to control rendering:

  • claudeCode.harnessEventDisplay: \"full\" | \"collapsed\" | \"hidden\" (default \"full\" preserves current behavior)
  • \"collapsed\": render as a single one-liner like ▸ task abc completed (expandable on click)
  • \"hidden\": don't render at all in the UI — the model still receives the message in its context, only the visible bubble is suppressed
  • Apply to both <task-notification> and <system-reminder> (same rationale: useful to the model, noisy to the user)

If a global toggle is too coarse, a per-event-type allow/deny list would also work:
claudeCode.hiddenHarnessEvents: [\"task-notification\", \"system-reminder\"].

Why not a workaround

  • Patching cli.js locally: fragile, breaks on every npm update -g @anthropic-ai/claude-code.
  • Avoiding Monitor / run_in_background entirely: removes legitimate functionality (real-time reactivity to async events that synchronous Bash can't provide without blocking the conversation).
  • CLAUDE.md / skills rules: only address model-emitted text, not harness-injected UI bubbles.

Related but distinct issues

  • #40573 — TodoWrite reminders, focuses on context bloat (model-side, not UI rendering)
  • #46465 — <system-reminder> \"NEVER mention\" phrasing (prompt-injection ambiguity)
  • #48112 — task notifications leaking between concurrent sessions
  • #16021, #17601 (closed) — older context-bloat reports about <system-reminder> injection

None of the above target chat-UI rendering of <task-notification> specifically.

Environment

  • Claude Code CLI: @anthropic-ai/claude-code (Node, current)
  • VSCode extension: Anthropic.claude-code v2.1.126 (linux-x64)
  • WSL2 Ubuntu 22.04, Node 22.21.1

View original on GitHub ↗

This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗