You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Nov 17, 2025. It is now read-only.
Filter out child Claude processes to show only root instances
- Add parent PID (ppid) tracking to process info
- Collect all Claude processes in first pass
- Filter out any Claude whose parent is also a Claude process
- Only show root Claude instances (not MCP services or sub-processes)
This fixes the issue where multiple child processes spawned by Claude
(like MCP services) were being shown as separate instances. Now only
the main Claude processes are displayed.
logger.debug("Filtering out child Claude process PID=\(item.instance.pid) (parent PID=\(item.ppid) is also Claude)")
119
+
returnnil
120
+
}else{
121
+
logger.info("Detected root Claude instance: PID=\(item.instance.pid), folder=\(item.instance.folderName), status=\(item.instance.status.displayName)")
122
+
return item.instance
123
+
}
124
+
}
125
+
126
+
logger.info("Detection complete: found \(nodeProcessCount) Node processes, \(allClaudes.count) total Claude processes, \(rootClaudes.count) root Claude instances")
127
+
return rootClaudes
112
128
}
113
129
114
130
// MARK: - Helper Functions
@@ -123,7 +139,7 @@ final class ClaudeProcessDetector: Loggable, @unchecked Sendable {
0 commit comments