Continuity hooks are an optional extension layer that lets you react to state file changes without modifying the core templates. When a state file changes, a hook can fire a webhook, append an event to a log, move completed tasks to an archive directory, or call a notification endpoint — all without the agent itself needing to orchestrate it. The hook layer sits outside the agent’s reasoning loop and supplements it with automation.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/bitwikiorg/continuity/llms.txt
Use this file to discover all available pages before exploring further.
What hooks can do
Hooks watch specific state files and execute configured actions when those files change:- Watch state files — monitor
STATE.md,TODO.md,SNAPSHOT.md, or any file in your workspace - Trigger webhooks — send a JSON event payload to an HTTP endpoint when a file updates
- Move completed tasks — automatically relocate finished
TODO.mdentries tocompleted/without agent involvement - Append to event logs — maintain a
logs/events.jsonlaudit trail of every state transition
Setup
Copy and customize the example config
Copy
hooks.example.yaml into your workspace and edit it to match your environment. The file uses environment variables for sensitive endpoints — set CONTINUITY_STATE_WEBHOOK and CONTINUITY_NOTIFY_ENDPOINT in your shell before running the watcher.hooks.example.yaml
rules block is informational — it documents the safety constraints in force for this workspace and can be read by the agent alongside WARNING.md. Rules are not enforced by the hook runner itself; they are declarations the agent loads and self-applies.
webhook-on-state-change.py
logs/events.jsonl first — so the local log is always updated even if the HTTP call fails — then POSTs to the configured URL. Failures are printed to stderr and do not terminate the watcher process.
Common hook triggers
| File watched | Trigger condition | Example action |
|---|---|---|
STATE.md | Any change | POST event to webhook, append to logs/events.jsonl |
TODO.md | Task marked done | Move entry to completed/, append to event log |
SNAPSHOT.md | Any change | Notify endpoint, append to event log |
Use cases
CI-like validation
Run
check-placeholders.sh or state-file-audit.sh automatically when state files change — the same validation you’d run in a CI pipeline, triggered locally by the file watcher.Auto-embed for vector stores
Hook into
STATE.md and SNAPSHOT.md changes to trigger re-embedding. Keeps your vector store in sync with the agent’s current cognitive state without manual reruns.Notification on state change
POST to a Slack webhook, PagerDuty endpoint, or any HTTP target when the agent updates its state. Useful for monitoring long-running autonomous sessions.
Completed task archival
Automatically move finished tasks out of
TODO.md and into completed/ using on_done — prevents accumulation of done items in the active task list.Hooks are optional. Most agents do not need them. The core feedback loop — agent reads state, acts, writes state — works without any hook configuration. Hooks add automation for teams that want CI-like validation, notification pipelines, or automatic archival of completed work.