Concept icon
Concept

StateM Stop Hook Integration and Execution Continuation

StateM supports host-level stop-hook integration for CLI agents (such as Codex and Claude Code) to prevent premature termination during long unattended tasks. When the host environment receives an instruction to stop, the stop hook intercepts the request and inspects the current StateM status:

  • If the run is in a designated terminal state or is explicitly blocked on an external dependency, the stop is permitted to proceed.
  • Otherwise, the stop hook halts termination, returns the current execution phase along with outstanding unmet obligations to the agent, and requests continued work.

While this mechanism provides greater execution persistence and establishes explicit stopping criteria, it does not provide an absolute correctness guarantee and must remain bounded by time, token, and retry budgets.

0

1

Concept icon
Updated 2026-09-23

Tags

Prep Sessions

Engineering Deterministic Runtimes and Verification for Autonomous Agents @ University of Michigan - Ann Arbor

Ch.2 Runtime Lifecycle and State Management - Engineering Deterministic Runtimes and Verification for Autonomous Agents @ University of Michigan - Ann Arbor

Per-Run State Persistence, Recovery, and Stop Hooks - Engineering Deterministic Runtimes and Verification for Autonomous Agents @ University of Michigan - Ann Arbor