Bug: Background Bash Job Status Never Updates in System Reminders
Issue Summary
When background bash jobs are created using the Bash tool with run_in_background: true, the system reminder generator continues to report these jobs as (status: running) indefinitely, even after the jobs have completed, been killed, or terminated naturally.
Technical Details
Observed Behavior:
- Background bash jobs are created via the Bash tool with
run_in_background: true - Jobs execute and eventually complete or are terminated via the KillShell tool
- The BashOutput tool correctly reports job status as
<status>completed</status>or<status>killed</status> - However, system reminders continue to report the same jobs as
(status: running)perpetually
Expected Behavior:
- System reminders should reflect the actual current status of background jobs
- Once a job completes or is killed, reminders should either:
- Stop being generated, OR
- Update to show
(status: completed)or(status: killed)
Evidence from Current Session
In the current session, 45+ background bash jobs were created for workflow monitoring purposes. Despite these jobs having completed hours ago, the system continues generating reminders for all 45+ jobs at every tool invocation.
Example demonstrating the discrepancy:
Background Job ID: 77c6c3
- BashOutput result:
<status>killed</status>✓ (Correct) - System reminder:
(status: running)✗ (Incorrect)
Impact
Severity: Medium-High
This issue causes:
- Token waste: Each reminder consumes tokens, with 45+ reminders appearing repeatedly throughout sessions
- Context pollution: Outdated information clutters the AI's working context
- User confusion: Users observe 'zombie processes' that appear unkillable
- Session degradation: Long sessions become increasingly burdened with stale reminders
- Inability to clean up: No available tool or method can clear these outdated reminders
Reproduction Steps
- Use the Bash tool with
run_in_background: trueto create multiple background jobs with long-running loops - Allow jobs to execute for several minutes
- Terminate jobs using KillShell tool or allow them to complete naturally
- Observe using BashOutput that jobs report
<status>completed</status>or<status>killed</status> - Note that system reminders continue reporting
(status: running)for the same job IDs
Proposed Solutions
Option 1 (Preferred):
- Update system reminder generator to query actual job status before generating reminders
- Only generate reminders for jobs with status:
runningorpending - Suppress reminders for jobs with status:
completed,killed, orfailed
Option 2:
- Implement time-based cleanup: Stop generating reminders for jobs older than X minutes/hours
- Assume jobs that haven't been queried recently are no longer relevant
Option 3:
- Provide a tool or command to manually clear completed background job reminders
- Allow the AI to request reminder cleanup when appropriate
Environment
- Model: Claude Sonnet 4.5 (claude-sonnet-4-5-20250929)
- Platform: Claude Code (VSCode Extension)
- Session Duration: ~4+ hours
- Background Jobs Created: 45+
- All jobs monitoring GitHub Actions workflows
Additional Notes
- The AI has no direct control over system reminder generation
- Standard OS-level tools (sudo, kill, pkill) cannot address this issue as these are not OS processes
- The KillShell tool successfully terminates jobs but does not update the reminder system's internal state
Thank you for investigating this issue.
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗