# ghost Background Pi agent overlay for quick side-channel prompts. ## Install / load Loaded through the root pi-ext package. See [root README](../../README.md). ## Commands / tools / settings Commands: - `/ghost` opens the ghost overlay. If it is already open, it focuses it. - `/ghost ` opens the overlay if needed and sends `` to the ghost session. If the overlay is already open, it sends the prompt to the existing session. - `/ghost` requires interactive mode. Shortcuts: - `alt+g` opens the ghost overlay in interactive mode. Tools: - none Hooks: - `session_start` loads ghost config. - `session_shutdown` disposes the ghost session and clears its widget. Settings: - global: `ghost` object in Pi agent `settings.json` - project: `.pi/ghost.json` - project config overrides global config field by field - invalid project JSON or non-object project config is reported as a warning and ignored - invalid global JSON is ignored Supported config fields: - `model.provider` - `model.id` - `overlay.anchor`: `center`, `top-left`, `top-center`, `top-right`, `right-center`, `bottom-right`, `bottom-center`, `bottom-left`, `left-center` - `overlay.width`: positive number or positive percent string - `overlay.maxHeight`: positive number or positive percent string - `overlay.margin.top`: non-negative number - `overlay.margin.bottom`: non-negative number - `overlay.margin.left`: non-negative number - `overlay.margin.right`: non-negative number Default config: ```json { "overlay": { "anchor": "bottom-center", "width": "100%", "maxHeight": "55%", "margin": { "top": 0, "bottom": 1, "left": 0, "right": 0 } } } ``` ## Behavior Ghost starts a secondary in-memory Pi agent session in the current cwd. It uses the active model unless both `model.provider` and `model.id` match a model in the registry. If the configured model is missing, it falls back to the active model. The overlay renders user messages, assistant streaming updates, and tool execution output from that secondary session. It keeps an event log so hidden overlays can reopen with current session state. Input behavior: - Enter submits trimmed input. - empty input is ignored. - `ctrl+s` hides the overlay and keeps the ghost session running. - `esc` closes the overlay and disposes the ghost session. - Up/down/page-up/page-down/home/end scroll transcript history. When hidden, ghost shows a small widget above the editor: `/ghost is running • run /ghost to bring it back`. Closing the overlay or Pi session shutdown cleans up the overlay, widget, event log, subscription, and ghost session. Overlay failure also cleans up that state.