Skip to content

Fix native Claude Code binary IDE detection#9

Open
weytani wants to merge 1 commit into
tjp2021:mainfrom
weytani:fix/native-claude-binary-detection
Open

Fix native Claude Code binary IDE detection#9
weytani wants to merge 1 commit into
tjp2021:mainfrom
weytani:fix/native-claude-binary-detection

Conversation

@weytani

@weytani weytani commented Mar 13, 2026

Copy link
Copy Markdown

Summary

  • Add Exe field to ProcessInfo (resolved binary path via gopsutil p.Exe()) and check it in IDE signature matching alongside Cmdline
  • Add /.local/share/claude/ path signature for native Claude Code binary detection

Problem

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 just claude (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_dead fires on all MCP servers even when Claude Code is actively running. Any MCP server that also has has_listener scores 0.65 (above the 0.60 threshold) and gets killed every 30 seconds.

Fix

gopsutil's p.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_tty only), system clean

Test plan

  • New test: native Claude Code binary detected via Exe path
  • Existing Claude Code node_modules test still passes
  • All 35 scanner tests pass
  • Live verification: devreap scan -v shows "No orphan candidates found"

Closes #8

🤖 Generated with Claude Code

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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Native Claude Code binary not detected as IDE

1 participant