{"version":"2.1.334","anchor":"send-task-message-control-request-for-sending-a-message-to-a","canonical_anchor":"send-task-message-control-request-for-sending-a-message-to-a","heading":"Sending messages to running background agents, with a notice when delivery fails","tier":"use","area":"SDK","scope":"individual","heads_up":false,"url":"https:\/\/changelogs.core-directive.com\/v\/2.1.334\/e\/send-task-message-control-request-for-sending-a-message-to-a","release_url":"https:\/\/changelogs.core-directive.com\/v\/2.1.334","markdown":"### Sending messages to running background agents, with a notice when delivery fails\n\nsend_task_message now delivers a message to a running background agent, and an error notice can appear when a message is not delivered\n\n**Unclear.** It is not clear what session condition or setting must hold before Claude Code accepts this request.\n\n**What**\n\nA background agent is a helper Claude starts to work on a task while the main session continues. Messaging one gains real handling:\n\n- `send_task_message` now works as a control request (an instruction a program sends to Claude Code while it runs). It sends a message to a running background agent, picked by `task_id`.\n\n- The request is refused when a hook screens prompts (a hook is a script you set up to run at certain moments), when the task is not running, or when the arguments are invalid. One refusal reads \"no running agent with that task_id in this session\".\n\n- A new watcher can raise a high-priority error notice reading \"Your message to the agent was not delivered\" when a message you sent is stranded or fails. It is only installed when a gate allows it; otherwise it does nothing.\n\n**Why**\n\nPrograms and remote tools can now steer an agent that is already working, not just stop it. Where the notice is active, a lost message is reported instead of disappearing silently.\n\n- Area: SDK\n- Names: `send_task_message`\n- Tier: Use it now\n- Useful: 4\/5\n- Signal: 3\/5\n- Scope: individual\n- Heads-up: no"}