Detect Bun-bundled claude.exe (claude-code v2.x)#4
Open
changsu-jin wants to merge 1 commit intodevmegablaster:mainfrom
Open
Detect Bun-bundled claude.exe (claude-code v2.x)#4changsu-jin wants to merge 1 commit intodevmegablaster:mainfrom
changsu-jin wants to merge 1 commit intodevmegablaster:mainfrom
Conversation
claude-code v2.x ships a Bun-bundled native macOS binary named `claude.exe` under `<node_modules>/@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) <noreply@anthropic.com>
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.
Problem
The Sessions panel shows "No active Claude sessions" even when multiple
claudeprocesses are running and writing to JSONL transcripts.Root cause
claude-code v2.x ships a Bun-bundled native macOS binary named
claude.exe(installed at<node_modules>/@anthropic-ai/claude-code/bin/claude.exe). The currentprocess matcher in
liveClaudeCwdCounts()checks forname == "claude"andexePath.hasSuffix("/claude")/"/bin/claude", none of which matchclaude.exe. Result:liveCwdCountsis always empty, the per-cwd capacity gate inloadSessionsrejects every candidate, and the SESSIONS panel staysempty.
You can reproduce by checking:
proc_name(pid)returnsclaude.exefor v2.x processesproc_pidpath(pid)resolves through the Node shim symlink to/.../@anthropic-ai/claude-code/bin/claude.exelsof -p <pid>shows the binary asclaude.ex(truncated 9-charCOMMAND) and txt mapped to
claude.exeFix
Extend the matcher in
Sources/NotchPilot/ClaudeMonitor.swifttorecognize:
name == "claude.exe"(proc_name returnsclaude.exefor the Bunbinary)
exePathcontaining/@anthropic-ai/claude-code/(most robust —package path)
exePathending in/claude.exeor/bin/claude.exeExisting string-based matches are retained for backward compatibility
with older Node-shim installs.
Verification
claudePIDs across multiple cwds../scripts/build.sh): live sessions appearcorrectly in the panel;
liveCwdCountspopulates with the rightcwd → PID mappings (verified by cross-checking
lsof -p <pid>cwdoutput against the panel).