Skip to main content Module process Copy item path Source ProcessIdentity Immutable OS-level process identity used to defend durable PID references
against PID reuse. A PID may be recycled for an unrelated process after its
original owner exits; the start marker makes that transition observable. find_killable_pids Returns PIDs that are safe to kill during lean-ctx stop: neither MCP stdio
servers nor in-flight command runners. find_pids_by_name Find all PIDs of processes whose executable name matches name.
Excludes the current process and its ancestor chain (#714). force_kill Unconditionally kill a process. identity Returns a PID-reuse-safe identity when the operating system exposes one. is_alive Check whether a process with the given PID is still running. kill_all_by_name Kill non-MCP processes matching name (SIGTERM then SIGKILL).
Returns count of killed processes. matches_identity True only when the live process still has the identity captured at
registration. This is intentionally stricter than is_alive(pid). run_with_timeout Run a command with a hard timeout, capturing its output. spawn_detached Spawn a long-lived background process (proxy, daemon) detached from the
current process so it survives the parent’s exit. terminate_gracefully Ask a process to terminate gracefully (SIGTERM on Unix, nothing on Windows
since we prefer HTTP shutdown; the caller should have already tried that).