Skip to content

Conversation

@gabadi
Copy link
Contributor

@gabadi gabadi commented Jan 18, 2026

Summary

Extends the existing [BG] indicator to show [BG:N] when 2+ background tasks are running in a Claude session.

  • Single task: ○ Idle [BG] (unchanged)
  • Multiple tasks: ○ Idle [BG:3] (new)
  • Project aggregate: Shows sum across all sessions


Screenshot 2026-01-18 at 2 12 39 PM

Changes

  • Change detectBackgroundTask() return type from boolean to number across all state detectors
  • ClaudeStateDetector extracts count from "N background task(s)" pattern
  • Non-Claude detectors return 0 (no background task visibility)
  • Display logic: count === 0 → no tag, count === 1[BG], count >= 2[BG:N]
  • formatSessionCounts() sums counts across sessions in project view

Related

Builds on #166 which added the [BG] indicator.

Test plan

  • npm run typecheck passes
  • npm run test passes (1138 tests)
  • npm run lint passes
  • Manual: Start Claude session with no background tasks → no [BG] tag
  • Manual: Run 1 background command → [BG] appears
  • Manual: Run 2+ background commands → [BG:N] shows correct count
  • Manual: Multi-project view shows aggregate count

🤖 Generated with Claude Code

Extends the existing [BG] indicator to show [BG:N] when 2+ background
tasks are running in a Claude session.

Changes:
- Change `detectBackgroundTask()` return type from boolean to number
- ClaudeStateDetector extracts count from "N background task(s)" pattern
- Non-Claude detectors return 0 (no background task visibility)
- Display logic: 0=no tag, 1=[BG], 2+=[BG:N]
- Aggregate counts sum across sessions in project view

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@gabadi gabadi force-pushed the feat/background-task-count branch from 5a297a1 to facbb79 Compare January 19, 2026 17:22
Copy link
Owner

@kbwo kbwo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great work! LGTM

@kbwo kbwo merged commit 482fb8b into kbwo:main Jan 20, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants