A hook is a command DataMind Oda runs automatically when something happens in a chat, for example after a step of the work or when you send a message. You do not have to write the hooks file by hand: ask Oda for the hook in a chat, check the card it shows you, and allow the change. This page covers the chat side; Hooks covers what hooks are, the events they answer to, and the Settings page where you manage them.
Created the hook and It runs from the next matching event.The session has Full access, so it was written without an approval prompt.Describe the hook to Oda in your own words; the card then shows exactly what will be written. These are the values behind it, with their limits:
| Value | What it sets |
|---|---|
| Scope | user keeps the hook in your own hooks file and runs it in your chats; project writes it into this workspace's folder, so it stays with the project. |
| Event | The point the hook answers to, for example before or after a step, when you send a message, or the end of a turn. Hooks lists the events. |
| Matcher | Narrows the hook to matching calls. Leave it out to answer every call of the event; there is no matcher on the message-submit or stop events. |
| Command | The command to run: 1 to 4096 characters. |
| Arguments | Up to 64 arguments, each at most 4096 characters. |
| Timeout | A whole number of seconds, 1 to 3600. Without one, the default for hooks applies. |
| Status message | A short line, at most 200 characters, that names the run in the chat and in Settings > Hooks. |
Ask Oda to change a hook or to delete it. The card is titled Change this hook? or Delete this hook?, with the same Before:, After: and File: detail, so you can check exactly what will change.
That hook no longer exists. Ask Oda to look at the hooks again, then repeat the change.Changed the hook or Deleted the hook. Deleting removes the entry from its file.The previous version of the file is kept; the user can restore it in Settings > Hooks.A project hook belongs to its folder, and Oda runs it only when that folder is trusted for exactly those hooks, or in a Full access session. Until you trust the folder, a new project hook stays inactive in ordinary sessions, and Oda reports The folder's hooks are not trusted, so it runs only in Full access sessions until the user trusts them. Hooks covers the trust review.
When a hook runs, the chat shows a row labelled with the hook's status message. Expand it to see the event and matcher, how long the run took, its exit code, the message, any reminder it added, its reason, and its error output. A run that adds a reminder, shows a message, blocks, asks for approval or fails keeps its row; a run that did nothing leaves no row.
A hook can also block a step:
blocked by PreToolUse hook.blocked by PostToolUse hook.Stop hook can block the stop, the chat shows blocked by Stop hook, and Oda continues the turn.Sub-agents cannot create, change, or delete hooks. Report the hook that is needed to the main agent, which can ask the user.user hook can be added.No. Ask Oda for the hook in a chat, and it writes it into the right file after you allow the card. The files and the Settings page are described in Hooks.
Before: and After: show the exact change to the hooks file, and File: names the file it will be written to, so you can check everything before you allow it.
Nothing is written. Ask Oda to change the hook, and it shows a new card.
No. In a Full access session there is no card, and the hook is written directly; Oda reports The session has Full access, so it was written without an approval prompt. The modes are described in Workspaces, files and permissions.
Each value has a limit: the command holds 1 to 4096 characters, up to 64 arguments of 4096 characters, the timeout is a whole number from 1 to 3600 seconds, and the status message holds at most 200 characters. A refused value reads The command must hold 1 to 4096 characters. or The timeout must be a whole number of seconds from 1 to 3600. Correct your request, and Oda tries again.
Because it was edited or deleted after Oda last saw it, and an edited hook counts as a new entry; Oda refuses with That hook no longer exists. Ask Oda to look at the hooks again, then repeat the change.
A hook cannot halt the run: when a hook asks the run to stop, Oda records it as a stop decision and the turn continues. At the end of a turn, a Stop hook can block the stop instead, which keeps Oda going (blocked by Stop hook). To stop a run yourself, use Stop generating in the message box.
No. Only the main chat can create, change or delete hooks; a subagent reports the hook it needs there, and the main chat asks you. The refusal reads Sub-agents cannot create, change, or delete hooks.
Each hook run leaves a row labelled with the hook's status message. Expand it for the event and matcher, the duration, the exit code, the message, any reminder, the reason and the error output; a run that did nothing leaves no row. Recent runs are also listed under Settings > Hooks, described in Hooks.
Yes. Every write keeps the previous version of the file, and you can restore it in Settings > Hooks: The previous version of the file is kept; the user can restore it in Settings > Hooks. Hooks covers the versions and how to restore one.