Background agent completion notifications can be mistaken for user messages

Resolved 💬 3 comments Opened Mar 18, 2026 by rcorvus Closed Mar 21, 2026

Description

When using run_in_background: true on an Agent tool call, the system inserts a <task-notification> message into the conversation when the agent completes. This notification can be mistaken for a user message by Claude, causing it to treat the next conversation turn as if the user has responded — when in reality no user input has occurred.

Steps to Reproduce

  1. Dispatch a background agent with run_in_background: true
  2. While waiting for it to complete, the user sends a message and Claude responds
  3. The background agent completes and a <task-notification> appears in the conversation
  4. Claude may interpret this as a new user turn and take action (e.g., committing code) without actual user confirmation

Expected Behavior

Background agent completion notifications should be clearly distinguishable from user messages in a way that prevents Claude from treating them as user input. Ideally, they should not trigger a new conversation turn at all.

Actual Behavior

The <task-notification> appears as a conversation turn, and Claude may proceed with actions that require user confirmation (like git commits) without the user actually having responded.

Workaround

Added a note to CLAUDE.md instructing Claude to treat <task-notification> messages as system events, not user input.

View original on GitHub ↗

This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗