Fix native Claude Code binary IDE detection#9
Open
weytani wants to merge 1 commit into
Open
Conversation
The native Claude Code binary installs to ~/.local/share/claude/versions/<ver> and is symlinked from ~/.local/bin/claude. On macOS, gopsutil reports the cmdline as just "claude" (the symlink name) without the full path, so the existing node_modules-based IDE signatures don't match. Add Exe field to ProcessInfo (resolved binary path from gopsutil p.Exe()) and check it alongside Cmdline in IDE signature matching. Add a /.local/share/claude/ path signature for the native install. Without this fix, parent_ide_dead (0.30) fires on all MCP servers even when Claude Code is running, pushing servers with has_listener above the kill threshold. Closes tjp2021#8 Co-Authored-By: Claude Opus 4.6 <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.
Summary
Exefield toProcessInfo(resolved binary path via gopsutilp.Exe()) and check it in IDE signature matching alongsideCmdline/.local/share/claude/path signature for native Claude Code binary detectionProblem
The native Claude Code binary installs to
~/.local/share/claude/versions/<ver>and is symlinked from~/.local/bin/claude. On macOS, gopsutil reports the process cmdline as justclaude(the symlink name) without the full path. The existing IDE signatures only match node_modules paths:{pathContains: "/node_modules/.bin/claude"}, {pathContains: "/@anthropic-ai/claude-code"},Neither matches, so
parent_ide_deadfires on all MCP servers even when Claude Code is actively running. Any MCP server that also hashas_listenerscores 0.65 (above the 0.60 threshold) and gets killed every 30 seconds.Fix
gopsutil'sp.Exe()resolves symlinks and returns the actual binary path (e.g./Users/x/.local/share/claude/versions/2.1.74), which matches the new signature.Before: All MCP servers score 0.45+ (
no_tty+parent_ide_dead), one at 0.65 (KILL)After: All MCP servers score 0.15 (
no_ttyonly), system cleanTest plan
Exepathdevreap scan -vshows "No orphan candidates found"Closes #8
🤖 Generated with Claude Code