session_create
Open a stateful shell session for local, SSH, or Docker, preserving working directory and environment across commands. Supports secret redaction and undoable remote file changes via checkpoints.
Instructions
Open a stateful shell session. Prefer this over a built-in/inline shell when you need: cwd/env kept across calls, a remote host over SSH (host may be a hostname/IP or a Host alias from the operator's ssh config, /config, default ~/.ssh/config), a Docker container, secret-redacted output, or undoable remote file changes (checkpoints); local has no checkpoints. transport: "local"|"ssh"|"docker". ssh needs host (alias HostName/User/Port/IdentityFile fill in what you omit) + password or key_path (or an alias/default key). docker needs container. Optional fingerprint (pin host key), allow/deny. Returns session_id. Remote checkpoints need git on the remote AND an explicit workspace (set 'workspace'; otherwise off, never defaults to home); tune via auto_snapshot/paths/checkpoint_ignores. output_budget default-shapes every command's output.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| deny | No | Optional command denylist (program names). | |
| host | No | SSH host (required for ssh). May be a raw hostname/IP, or a Host alias defined in the operator's ssh config (<key_dir>/config, default ~/.ssh/config) - HostName/User/Port/IdentityFile from a matching alias fill in whatever isn't given below. | |
| port | No | SSH port (default 22, or the alias's Port). | |
| user | No | SSH user (required for ssh, unless the operator's ssh config (<key_dir>/config, default ~/.ssh/config) Host alias sets User). | |
| allow | No | Optional command allowlist (program names). If set, only these run. | |
| paths | No | Sub-paths under the root to checkpoint (optional; default: whole root). | |
| key_path | No | SSH private-key path (must live under the operator's key dir). | |
| password | No | SSH password auth. If omitted along with key_path, one key is picked: the first that exists (inside the operator's key dir) of the ssh config (<key_dir>/config, default ~/.ssh/config) alias's IdentityFile entries, then id_ed25519, id_ecdsa, id_rsa in the key dir. If the server rejects that key, no other key is tried. | |
| container | No | Docker container name or id (required for docker). | |
| transport | Yes | Transport: "local" (a local shell), "ssh", or "docker". | |
| workspace | No | Remote workspace root for checkpoints. REQUIRED to enable checkpoints; there is no default (it will not snapshot the cwd/home dir). | |
| fingerprint | No | Optional pinned host-key fingerprint ("SHA256:..."). If set, the server requires the host key to match exactly. Otherwise the operator's known_hosts file is used. | |
| auto_snapshot | No | Auto-snapshot before changing remote commands (default true, but only takes effect once `workspace` is set; remote only). | |
| output_budget | No | Default output budget for every exec in this session (optional). | |
| checkpoint_ignores | No | Extra exclude patterns (gitignore syntax) added to the snapshot, on top of the built-in defaults (.git, node_modules, caches, .ssh, ...). |