A configured MCP server distilled to what the process matcher needs:
the configured name plus the stdio launch command + args used to
match it against a live process cmdline.
One descendant process the scanner found alive. Field shape is
driven by what a view’s process row builder needs (PID + cmdline +
memory for the metadata line) + the cmdline-matching needed for
wire-tracked overlay (process_cmdline_matches_tool_input).
Snapshot of claude’s descendant processes at one point in time.
Always succeeds - failures (sysinfo errors, process gone) collapse
to an empty processes vec.
Strip the executable’s directory from a cmdline headline so the row
reads cargo nextest run, not /opt/homebrew/bin/cargo nextest run.
Only the FIRST token (the executable) is basenamed; args are kept
verbatim (they carry the distinguishing detail). A first token with
no / (e.g. a postgres: walwriter process title) is unchanged.
The normalized command text a wire-tracked tool call is matched on.
normalize_ws already trims, so a whitespace-only command yields the
empty string and the caller can treat that as “no needle”.
Extract the stdio-launched configured MCP servers from an mcp-status
snapshot. A server contributes (name, command, args) only when its
config blob carries a string command (the stdio shape); url-only
(http/sse) servers have no local process, so they’re skipped.
The configured server whose command + args uniquely text-match
cmdline. None when none matches or several do - the ambiguous case
declines rather than guesses.
Unwrap a shell-wrapper cmdline to the user command inside it.
Recognizes the shape claude wraps Bash tool calls in (captured via
ps -axww): /bin/zsh -c source <snapshot> ... && eval '<CMD>' < /dev/null && pwd -P >| /tmp/claude-<hash>-cwd. The inner command is
single-quoted between eval ' and ' < /dev/null. Returns None
when cmdline is not a recognized wrapper (non-shell processes pass
through unchanged at the call site).
True when process_cmd plausibly matches the shell command
captured in a wire-tracked tool’s raw_input.command. Used by
a view’s process row builder (path A+) to overlay wire-tracked
task descriptions onto OS-detected processes when both refer to
the same work.
Friendly label for a known-infra process: the CONFIGURED MCP server name
when the process’s command + args uniquely match one of configured,
else the package-derived name from classify_known_infra. None when
neither produces a name - the process isn’t a recognized MCP server.
Walk claude_pid’s descendant tree plus any command-matched
backgrounded local_bash and build a sorted snapshot. Always
returns successfully - sysinfo failures, missing processes, or empty
trees all collapse to an empty snapshot with a fresh scanned_at.
The bare server name inside a plugin-namespaced configured name. The CLI
exposes a plugin-provided MCP server as plugin:<plugin>:<server>, which
reads worse than the package-derived name; anything else (including a
plain name that merely contains a colon) is returned verbatim.