Skip to content

feat: render task notifications as styled cards instead of raw XML #121

@Psypeal

Description

@Psypeal

Problem

When Claude Code runs background tasks (run_in_background), completion notifications are injected as <task-notification> XML blocks in user messages. These display as raw XML in the chat view, which is confusing and hard to read.

Example of what users currently see:

<task-notification><task-id>bc8lpoiyk</task-id><tool-use-id>toolu_01FY9VUcR6...</tool-use-id>
<output-file>/tmp/claude-1000/.../bc8lpoiyk.output</output-file>
<status>completed</status><summary>Background command "Run mediation analyses" completed (exit code 0)</summary></task-notification>
Read the output file to retrieve the result: /tmp/claude-1000/.../bc8lpoiyk.output

Proposed Solution

  1. Parse <task-notification> XML blocks from user message content
  2. Strip the raw XML and trailing "Read the output file..." instruction from display text
  3. Render as compact styled cards showing: status icon (check/x), command name, exit code, output filename

Files affected

  • src/shared/utils/contentSanitizer.ts — add parser + strip pattern
  • src/renderer/components/chat/UserChatGroup.tsx — render parsed notifications as cards

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