Skip to main content

Module host

Module host 

Source
Expand description

Which agent process a lean-ctx session serves.

Several agents can run lean-ctx in one project at once (two Claude windows, a Codex task). Each starts its own MCP server, and the project snapshot only names whichever wrote last. The server records its parent, the agent host; a status line or hook the same host started finds that pid among its own ancestors and so reads its own session, not a neighbour’s.

Functions§

ancestors
This process’s ancestors, nearest first, stopping before init.
host_pid
The process that started this one: for an MCP server, the agent host. None when orphaned (re-parented to init) or the platform cannot tell.