Skip to main content
Runtime hooks let your OpenClaw instance run small setup scripts automatically during startup. Use them when you want to:
  • reinstall packages after a runtime update
  • restart background services
  • recreate temporary runtime state
  • restore tools or files your app depends on
Hook files live in:

Available hooks

Post-image-update hook

Run setup after the runtime image changes.

Post-restart hook

Run setup every time the container starts.

Which hook should you use

  • Use post-image-update.sh for things that should run only after a runtime update
  • Use post-restart.sh for things that should run on every start

Tips

  • Keep each hook focused on one job
  • Test the commands manually in Terminal first
  • Keep the script short enough to finish within its timeout