Which OpenClaw Jobs Belong in Runtime Hooks?
Start process-scoped workers on restart, bake image-scoped dependencies into the image where possible, and validate both paths with a staged OpenClaw probe that reads persistent state.
Give each dependency an owner and a readiness check
Inventory what OpenClaw requires before it can accept work. Put binaries and libraries in the build, durable records on a verified persistent mount, and process supervision in startup wiring. For example, an auxiliary index worker might need its binary on the image and a fresh connection to its data directory each time the process starts. Have the worker verify that it can read a known record before the Gateway is marked ready. If your platform cannot bake an optional dependency into the image, make its repair conditional on the expected version and check the resulting version before releasing work. Claude Code’s hook reference describes parallel dispatch for its own matching hooks. Use that as a reason to verify ordering on your host. If two operations must run in order, coordinate them through one entry point or an explicit readiness dependency.
Hooks reference - Claude Code DocsDistinguish process recovery from state recovery
Run two rehearsals on staging with the same synthetic input. First restart the running process without changing the image. Then deploy a different image revision while retaining the intended persistent storage. Before each trial, write a harmless marker through the normal state path. After each event, capture the image revision, marker value, dependency check, active worker count, and elapsed time until a real fixture completes. Require exactly one active worker when the test request succeeds. A correct marker and zero workers points to startup wiring. A working request with a missing marker points to state placement or scope. Amazon Bedrock AgentCore documents resuming with the same session ID to verify managed session storage. Apply the same discipline to your own host by holding the intended storage identity constant and recording it alongside the image revision.
File system configurations for AgentCore Runtime - Amazon Bedrock AgentCore