Repository navigation
fix: only count subagents that are really running - #160
Merged
Merged
Conversation
Older Claude Code wrote no finished flag, so every old subagent counted as running: 32 on ccs-improvements, 119 on dual-accept-key-rotation. A subagent now counts only if its session's current claude process started it (a resume or exit ends them without a word) and it has written to its transcript in the last 10 minutes; one alive but quiet longer is idle, like a teammate waiting to be shut down. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QUnP8jVL2NG9cWmohJTyun
brtkwr
enabled auto-merge
October 28, 2026 10:45
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
ccs said `ccs-improvements` had 32 running subagents and `dual-accept-key-rotation` 119. Neither was true.
Why:
Now a subagent counts as running only if all of these hold:
One that's alive but quiet for longer shows as idle. The preview's grey line now counts idle, finished and ended with the session. A start time comes from the first of a transcript's first lines that has a timestamp, or from the file's date.
Checked on real sessions:
Test: `TestSubagentsInThePreviewAndTheList` now covers an idle teammate and a subagent from before a resume.
🤖 Generated with Claude Code
https://claude.ai/code/session_01QUnP8jVL2NG9cWmohJTyun