ghost_shell
Run shell commands and manage persistent shell sessions for builds, git, CLIs, scripts, or opening apps. Control sessions, retrieve output, handle timeouts, and edit files via command execution.
Instructions
Run shell commands and drive persistent shells. THE way to run builds, git, CLIs, scripts, or open apps from a command line, and to edit files on machines with no file tools. op=run (default): one-shot - spawn shell, run 'cmd', return {output, exit_code, timed_out}. shell=bash (default) | sh | zsh | pwsh. op=open: start a persistent bash whose variables/cwd/env survive across commands (returns an 'id'). op=send: run 'cmd' in session 'id' (state persists). op=read: drain the rest of a command that hit its timeout (busy=true). op=list: show sessions. op=kill: end a session. Output is merged stdout+stderr, tail-capped at 24000 chars. Emergency-stop (ghost_stop) kills a runaway command. To START A NEW CLAUDE CODE SESSION: op=run cmd='gnome-terminal -- claude' (or your terminal of choice), then drive the terminal window with ghost_see / ghost_act / ghost_key. Disabled entirely when GHOST_SHELL=off.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | No | Session id (op=send|read|kill required; op=open optional custom name, else auto s1,s2,...) | |
| op | No | Operation (default run) | |
| cmd | No | Command text (op=run|send) | |
| cwd | No | Working directory (op=run|open) | |
| shell | No | op=run shell (default bash). Persistent sessions are bash only. | |
| timeout_ms | No | Per-command timeout, default 30000, max 600000. On timeout op=run kills the process; op=send leaves it running (drain via op=read). |