claude-code - 💡(How to fix) Fix Tasks sidebar: completed background bash tasks stay as "Running"; dismiss (X) button is unresponsive [5 comments, 4 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
anthropics/claude-code#48312Fetched 2026-04-16 07:03:20
View on GitHub
Comments
5
Participants
4
Timeline
11
Reactions
1
Author
Timeline (top)
commented ×5labeled ×4cross-referenced ×2

The Tasks sidebar keeps showing completed background Bash tasks (started via run_in_background: true) in the Running state long after their processes have exited. The dismiss (✕) button on those stale entries does not respond, so they accumulate with no way to clear them from the UI.

Root Cause

  • The Running badge in the sidebar is no longer trustworthy — you can't tell at a glance which tasks are actually live.
  • Because the dismiss button is unresponsive, the list just accumulates — currently ~15 stale entries across several sessions.

Code Example

mitiay  69148  ...  pnpm --filter owner dev --port 3000
mitiay  69147  ...  pnpm --filter admin dev --port 3001
mitiay  69138  ...  pnpm --filter owner dev --port 3000
mitiay  69137  ...  pnpm --filter admin dev --port 3001
RAW_BUFFERClick to expand / collapse

Summary

The Tasks sidebar keeps showing completed background Bash tasks (started via run_in_background: true) in the Running state long after their processes have exited. The dismiss (✕) button on those stale entries does not respond, so they accumulate with no way to clear them from the UI.

Environment

  • Claude Code version: 2.1.77
  • OS: macOS (Darwin 25.2.0)
  • Shell: zsh

What I observed

A session's Tasks sidebar shows ~15 entries marked as Running:

  • Build admin app (×3)
  • Build owner app (×2)
  • Watch CI checks / Watch CI checks to completion / Watch CI checks until complete / Watch CI checks on PR 148 — 5 total
  • Squash merge PR from main worktree
  • Squash merge PR 147 from main worktree
  • Squash merge PR 148 from main worktree
  • Install dependencies to wire api-client ...
  • Regenerate pnpm lockfile after removing ...

Cross-checking against actual live processes with ps aux | grep -E 'gh pr checks|pnpm|turbo':

mitiay  69148  ...  pnpm --filter owner dev --port 3000
mitiay  69147  ...  pnpm --filter admin dev --port 3001
mitiay  69138  ...  pnpm --filter owner dev --port 3000
mitiay  69137  ...  pnpm --filter admin dev --port 3001

Only 4 processes are alive — the pnpm --filter <app> dev instances behind the Build admin app / Build owner app entries. None of the Watch CI checks, Squash merge, Install dependencies, or Regenerate pnpm lockfile processes are still running.

So ~11 of the 15 "Running" entries are stale UI state.

Additional bug: ✕ button doesn't dismiss stale tasks

Clicking the ✕ icon on any of the stale "Running" entries has no effect — the entry stays. There is no way to clear the list from the UI, and it grows across sessions.

Expected behavior

  1. When a backgrounded Bash task exits, its Tasks sidebar entry should transition to its final state (completed / failed / killed) instead of staying Running indefinitely.
  2. The ✕ / dismiss button should always remove an entry from the sidebar, regardless of its reported status.

Impact

  • The Running badge in the sidebar is no longer trustworthy — you can't tell at a glance which tasks are actually live.
  • Because the dismiss button is unresponsive, the list just accumulates — currently ~15 stale entries across several sessions.

Screenshot

Will attach sidebar screenshot via the GitHub web UI after creation.

extent analysis

TL;DR

The Tasks sidebar shows stale background Bash tasks as "Running" and the dismiss button is unresponsive, likely due to incorrect state tracking or UI update issues.

Guidance

  • Investigate the state tracking mechanism for background tasks to ensure it correctly updates the task status when a process exits.
  • Verify that the UI is properly updated when a task's status changes, potentially involving a refresh or callback mechanism.
  • Check the event handling for the dismiss button to ensure it is correctly bound and triggers the expected removal action.
  • Consider implementing a periodic cleanup or garbage collection for stale task entries to prevent accumulation.

Example

No specific code snippet can be provided without more context, but ensuring that the task status is updated correctly upon process exit and that the UI reflects this change is crucial.

Notes

The issue seems to be related to the interaction between the task execution, state tracking, and UI updates. Without access to the specific codebase or more detailed logs, it's challenging to provide a precise fix. The suggestions are aimed at guiding the investigation towards the most likely causes.

Recommendation

Apply a workaround by implementing a periodic cleanup mechanism for stale task entries, as this can help mitigate the accumulation issue while the root cause is being investigated. This approach allows for a temporary solution to improve the user experience without waiting for a full fix.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

FAQ

Expected behavior

  1. When a backgrounded Bash task exits, its Tasks sidebar entry should transition to its final state (completed / failed / killed) instead of staying Running indefinitely.
  2. The ✕ / dismiss button should always remove an entry from the sidebar, regardless of its reported status.

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

claude-code - 💡(How to fix) Fix Tasks sidebar: completed background bash tasks stay as "Running"; dismiss (X) button is unresponsive [5 comments, 4 participants]