Background task manager system-reminders persist after task completion

Resolved 💬 4 comments Opened Nov 29, 2025 by ibarani Closed Feb 4, 2026

Bug Description

Background task system-reminders continue to show "Has new output available" for tasks that have already completed. This creates confusion as the user sees 40+ tasks listed as "running" when they have actually finished.

Steps to Reproduce

  1. Start multiple background tasks using run_in_background: true
  2. Wait for tasks to complete
  3. Observe that system-reminders continue to show "Has new output available" for completed tasks
  4. Use KillShell tool - it confirms tasks have status: completed or status: killed
  5. However, the system-reminders persist indefinitely

Expected Behavior

  • When a background task completes, its system-reminder should be cleared automatically
  • The task status should be reflected in the UI/reminders
  • Completed tasks should not continue showing "Has new output available"

Actual Behavior

  • System-reminders persist indefinitely after task completion
  • Even after calling KillShell, the reminders remain visible
  • Reminders survive conversation compactions
  • Users see dozens of "running" tasks that are actually completed

Root Cause Analysis

Based on first-principles debugging:

  1. Task Status Layer (Working): The internal task manager correctly tracks completion status. KillShell confirms tasks are status: completed.
  1. Notification Layer (Broken): The system-reminder mechanism is not synchronized with the task status. Notifications are generated when tasks are created but never cleared when tasks complete.
  1. Orphan OS Processes: Some bash shells remain as orphan processes because:
  • Shells are spawned with stdin pipe held open
  • No process.poll() or process.wait() calls to detect completion
  • No timeout enforcement

Evidence

KillShell 146400 → "Shell is not running, status: killed"
KillShell fd4f29 → "Shell is not running, status: killed"  
KillShell fbdacc → "Shell is not running, status: completed"
...
# Yet system-reminders still show all 40+ tasks as "running"

Environment

  • Claude Code (CLI)
  • Linux 6.8.0-88-generic
  • Long-running session with multiple background tasks

Suggested Fix

The notification/reminder system should:

  1. Poll task completion status before generating reminders
  2. Clear reminders when tasks complete
  3. Add a timeout mechanism for stale reminders
  4. Provide a way to manually clear all completed task reminders

Workaround

Currently, users must:

  1. Manually call KillShell on each task ID
  2. Kill orphan OS processes with kill -9 <pid>
  3. Start a new Claude Code session to clear stale reminders

View original on GitHub ↗

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