> ## Documentation Index
> Fetch the complete documentation index at: https://www.agent37.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Runtime Hooks

> Use runtime hook scripts to restore setup after OpenClaw restarts or runtime updates.

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:

```text theme={null}
/home/node/.agent37/hooks/
```

## Available hooks

<CardGroup cols={2}>
  <Card title="Post-image-update hook" icon="refresh" href="/docs/runtime/post-image-update-hook">
    Run setup after the runtime image changes.
  </Card>

  <Card title="Post-restart hook" icon="rotate-clockwise" href="/docs/runtime/post-restart-hook">
    Run setup every time the container starts.
  </Card>
</CardGroup>

## 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
