From c73c4d6bbdac5debb41284642c7c2a51f65991b6 Mon Sep 17 00:00:00 2001 From: "changsu.jin" Date: Tue, 5 May 2026 11:22:33 +0900 Subject: [PATCH] Detect Bun-bundled claude.exe (claude-code v2.x) claude-code v2.x ships a Bun-bundled native macOS binary named `claude.exe` under `/@anthropic-ai/claude-code/bin/`. The matcher in `liveClaudeCwdCounts()` only recognized `claude` / `/bin/claude`, so on machines using v2.x `liveCwdCounts` was always empty, the per-cwd capacity gate in `loadSessions` rejected every candidate, and the SESSIONS panel stayed empty even with multiple live `claude` processes writing to JSONL transcripts. Extend the matcher to also accept `claude.exe` proc names, the `/@anthropic-ai/claude-code/` package path, and `*/claude.exe` / `*/bin/claude.exe` exec paths. Existing matches are kept so older Node-shim installs still work. Co-Authored-By: Claude Opus 4.7 (1M context) --- Sources/NotchPilot/ClaudeMonitor.swift | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/Sources/NotchPilot/ClaudeMonitor.swift b/Sources/NotchPilot/ClaudeMonitor.swift index 6e1b1f1..52a63d0 100644 --- a/Sources/NotchPilot/ClaudeMonitor.swift +++ b/Sources/NotchPilot/ClaudeMonitor.swift @@ -530,13 +530,20 @@ final class ClaudeMonitor: ObservableObject { var counts: [String: Int] = [:] for pid in ProcessLookup.allPIDs() where pid > 0 { let name = ProcessLookup.name(of: pid) ?? "" - let nameMatches = name.lowercased() == "claude" + let lowerName = name.lowercased() + // claude-code v2.x ships a Bun-bundled native binary named + // `claude.exe` under `@anthropic-ai/claude-code/bin/`. Older + // installs use the Node shim named `claude`. + let nameMatches = lowerName == "claude" || lowerName == "claude.exe" var pathMatches = false if !nameMatches { if let exePath = ProcessLookup.path(of: pid)?.lowercased() { pathMatches = exePath.contains("/claude/versions/") + || exePath.contains("/@anthropic-ai/claude-code/") || exePath.hasSuffix("/claude") || exePath.hasSuffix("/bin/claude") + || exePath.hasSuffix("/claude.exe") + || exePath.hasSuffix("/bin/claude.exe") } } guard nameMatches || pathMatches else { continue }