[BUG] Background task completion notification not appearing / activating Claude
Preflight Checklist
- [x] I have searched existing issues and this hasn't been reported yet
- [x] This is a single bug report (please file separate reports for different bugs)
- [x] I am using the latest version of Claude Code
What's Wrong?
Bug Report: Background task completion notification not appearing
Title
[BUG] Background task completion notification not appearing on Windows and not activating Claude from idle state
Environment
- OS: Windows 11
- Claude Code version: (check with
claude --version) - Terminal: VS Code integrated terminal / Windows Terminal
Description
When running commands with run_in_background: true, the automatic completion notification (⏺ Background command "..." completed (exit code 0)) does not appear in the conversation and, more importantly, does NOT activate claude from idle state.
I use backgrounding often and have Claude idle (no sleep, no monitoring) waiting for the completed code that will awaken Claude to continue. This saves tokens.
Without the Background notification, Claude is required to actively monitor or for me to alert Claude that the background has finished.
Steps to Reproduce
- Start a Claude Code session
- Run a background command:
````
Bash(command="ask-agent --CWD='.' --AGENTS=g25l 'Reply: TEST'", run_in_background=true)
- Wait for the task to complete (verify by checking the output file)
- Expected:
⏺ Background command "..." completed (exit code 0)appears - Actual: No notification appears; must manually check with TaskOutput
Expected Behavior
When a background task exits, Claude Code should automatically inject the completion notification into the conversation, allowing the assistant to respond without polling.
Actual Behavior
- Task completes successfully
- Output file shows
[DONE]message and exit code 0 - No automatic notification appears
- Must manually poll with
TaskOutputto detect completion
Additional Context
- This worked previously (the feature exists per #18544)
- Multiple background tasks tested, none trigger notification
- Both stdout and stderr are being written by the command
- Process exits cleanly with code 0
Workaround
Currently must use TaskOutput(task_id="...", block=true) to wait for completion, which defeats the purpose of background tasks for parallel work.
What Should Happen?
Expected Behavior
When a background task exits, Claude Code should automatically inject the completion notification into the conversation, allowing the assistant to respond without polling.
Error Messages/Logs
Steps to Reproduce
Steps to Reproduce
- Start a Claude Code session
- Run a background command:
````
Bash(command="ask-agent --CWD='.' --AGENTS=g25l 'Reply: TEST'", run_in_background=true)
- Wait for the task to complete (verify by checking the output file)
- Expected:
⏺ Background command "..." completed (exit code 0)appears - Actual: No notification appears; must manually check with TaskOutput
Claude Model
Opus
Is this a regression?
Yes, this worked in a previous version
Last Working Version
_No response_
Claude Code Version
2.1.19
Platform
Anthropic API
Operating System
Windows
Terminal/Shell
VS Code integrated terminal
Additional Information
_No response_
This issue has 6 comments on GitHub. Read the full discussion on GitHub ↗