pub struct HookInput {
pub command: String,
pub cwd: Option<String>,
pub cwd_declared: bool,
pub root: Option<String>,
pub session_id: Option<String>,
pub permission_mode: Option<String>,
}Fields§
§command: String§cwd: Option<String>§cwd_declared: boolTrue when cwd is an absolute directory the model named in place of the folder the harness
reported. That directory is where the command runs and never becomes the project root.
root: Option<String>The project root, when the harness supplies one (HP-19) — a *_PROJECT_DIR env var
for most, workspace_roots in the payload for cursor. Absent for codex/copilot.
session_id: Option<String>The harness’s session/conversation id, when it supplies one (session_id for
Claude/Gemini/Qwen/Droid, sessionId for grok, conversation_id for cursor). It comes from
the harness’s own envelope, so the agent cannot forge it — which is what makes it usable as
the anchor for recognizing the session’s scratchpad (see pathctx::session_scratchpad).
permission_mode: Option<String>The harness’s permission mode as its envelope names it (Grok’s permissionMode). Only a
target whose gated_policy_for depends on it reads it; the rest leave it None.