Haruno Knowledge base

Hooks

A hook tells Haruno what to do when something arrives in a connected account, such as a new email. This page shows how to create one and what it is allowed to do.

  • Mac appIn developmentSwitched off for every customer. On the Mac it is called automation triggers, and comes with a gallery of ready-made automations and automations Haruno drafts in a chat. The Scheduled screen stays time-based only.
  • Windows appAvailableRules that start a hook are edited in the advanced view.
In development in the Mac app. It is not available to customers yet. Do not promise it.

A hook is a saved instruction for something that happens while you are not looking. "When a new email comes in, tell me if it needs an answer today" is a hook. When the event arrives, Haruno reads it, does what the hook says, and replies in a sentence or two.

A hook has two halves. This page is the first half: what Haruno should do. The second half is which events start it.

Open Hooks in the navigation pane.

The Hooks page lists your hooks. Each has Edit and Delete.
The Hooks page. A New hook button is at the top right, a line explains that integration rules are set up in the advanced view, and one hook called Format changed files is listed with Edit and Delete buttons.The Hooks page. A New hook button is at the top right, a line explains that integration rules are set up in the advanced view, and one hook called Format changed files is listed with Edit and Delete buttons.

The page says No hooks yet until you make one. A line under the title tells you where the rules live. In the normal view it says that integration rules are set up in the advanced view, and how to turn that on in Settings ▸ General. In the advanced view it offers Manage integration rules.

Create a hook

Press New hook.

A new hook. Leave Allow powerful tools off unless you trust everyone who can trigger it.
The New hook window with the name New message summary, a message template, an instruction, an empty working directory with a Browse button, and the switch Allow powerful tools turned off.The New hook window with the name New message summary, a message template, an instruction, an empty working directory with a Browse button, and the switch Allow powerful tools turned off.
FieldWhat it is
NameHow you will recognise the hook. A name is required.
Message templateHow the incoming event is handed to Haruno. The first template is {message}. Words in curly braces, such as {from} or {subject}, are filled in from the event.
Instruction (system prompt)What Haruno should do with the event.
Working directory (optional)A folder for the hook to work in. Press Browse….
Allow powerful toolsOff by default. See below.

AI Optimize beside the template and the instruction turns a short note into a full one. It keeps placeholders such as {from} exactly as you wrote them.

Press Save. To change a hook later, press Edit. Delete removes it.

A hook does nothing yet. It starts to work when a rule connects it to an event. See Connect a hook to events.

What a hook may do

A hook runs by itself, so nobody is there to answer a question or press Allow.

  • With Allow powerful tools off, a hook can reply through the connector and read files. It cannot run shell commands or change files.
  • With it on, it can do both.
  • A tool that you set to Confirm is refused, because nobody can approve it. A tool set to Off stays off.
Powerful tools: anyone who can message you can trigger it

A hook is started by something that arrives from outside, such as a message from another person. With Allow powerful tools on, that person's message could cause Haruno to run commands or change files. The window warns: Only enable for hooks you trust — anyone who can message the chat can trigger it. Keep it off for any hook that reads mail or chat messages.

Good to know

  • Hooks run inside Haruno, so Haruno has to be running. Turn on Launch at startup in Settings ▸ General to start it in the system tray when you sign in to Windows.
  • An event that Haruno could not get to within ten minutes is skipped. A long gap, such as a PC that was off, does not turn into a burst of old work.
  • What a hook did is not in History. You open it from the rule that started it.

Last updated · PR #2944 · View this version on GitHub

History (1 version)
  1. Internal knowledge base for staff: site, reader keys, assistant, 197 pages and the PR rule (#2944)
    What changed
    @@ -0,0 +1,59 @@
    +---
    +title: Hooks
    +summary: A hook tells Haruno what to do when something arrives in a connected account, such as a new email. This page shows how to create one and what it is allowed to do.
    +feature: hooks
    +covers:
    +  - windows-client/haruno-webview/web/src/pages/HooksPage.tsx
    +  - windows-client/haruno-webview/Host/Contracts/WebHooksContracts.cs
    +  - windows-client/Haruno.Desktop.ViewModels/Hooks/HooksViewModel.cs
    +  - windows-client/Haruno.Desktop.Services/Hooks/HookExecutor.cs
    +  - windows-client/Haruno.Desktop.Core/Models/Hooks/**
    +---
    +
    +A **hook** is a saved instruction for something that happens while you are not looking. "When a new email comes in, tell me if it needs an answer today" is a hook. When the event arrives, Haruno reads it, does what the hook says, and replies in a sentence or two.
    +
    +A hook has two halves. This page is the first half: what Haruno should do. The second half is [which events start it](/windows/automation/hook-rules/).
    +
    +Open **Hooks** in the navigation pane.
    +
    +<Shot src="/m/ca2862ef238b-windows-automation-hooks-list-light.png" dark="/m/2c91c0c9a452-windows-automation-hooks-list-dark.png" alt="The Hooks page. A New hook button is at the top right, a line explains that integration rules are set up in the advanced view, and one hook called Format changed files is listed with Edit and Delete buttons." caption="The Hooks page lists your hooks. Each has Edit and Delete." />
    +
    +The page says **No hooks yet** until you make one. A line under the title tells you where the rules live. In the normal view it says that integration rules are set up in the advanced view, and how to turn that on in **Settings ▸ General**. In the advanced view it offers **Manage integration rules**.
    +
    +## Create a hook
    +
    +Press **New hook**.
    +
    +<Shot src="/m/35bda8a3cc2e-windows-automation-hooks-editor-light.png" dark="/m/824a4d7855c3-windows-automation-hooks-editor-dark.png" alt="The New hook window with the name New message summary, a message template, an instruction, an empty working directory with a Browse button, and the switch Allow powerful tools turned off." caption="A new hook. Leave Allow powerful tools off unless you trust everyone who can trigger it." />
    +
    +| Field | What it is |
    +|---|---|
    +| **Name** | How you will recognise the hook. A name is required. |
    +| **Message template** | How the incoming event is handed to Haruno. The first template is `{message}`. Words in curly braces, such as `{from}` or `{subject}`, are filled in from the event. |
    +| **Instruction (system prompt)** | What Haruno should do with the event. |
    +| **Working directory (optional)** | A folder for the hook to work in. Press **Browse…**. |
    +| **Allow powerful tools** | Off by default. See below. |
    +
    +**AI Optimize** beside the template and the instruction turns a short note into a full one. It keeps placeholders such as `{from}` exactly as you wrote them.
    +
    +Press **Save**. To change a hook later, press **Edit**. **Delete** removes it.
    +
    +A hook does nothing yet. It starts to work when a rule connects it to an event. See [Connect a hook to events](/windows/automation/hook-rules/).
    +
    +## What a hook may do
    +
    +A hook runs by itself, so nobody is there to answer a question or press **Allow**.
    +
    +- With **Allow powerful tools** off, a hook can reply through the connector and read files. It cannot run shell commands or change files.
    +- With it on, it can do both.
    +- A tool that you set to **Confirm** is refused, because nobody can approve it. A tool set to **Off** stays off.
    +
    +<Callout variant="warning" title="Powerful tools: anyone who can message you can trigger it">
    +A hook is started by something that arrives from outside, such as a message from another person. With **Allow powerful tools** on, that person's message could cause Haruno to run commands or change files. The window warns: *Only enable for hooks you trust — anyone who can message the chat can trigger it.* Keep it off for any hook that reads mail or chat messages.
    +</Callout>
    +
    +## Good to know
    +
    +- Hooks run inside Haruno, so Haruno has to be running. Turn on **Launch at startup** in **Settings ▸ General** to start it in the system tray when you sign in to Windows.
    +- An event that Haruno could not get to within ten minutes is skipped. A long gap, such as a PC that was off, does not turn into a burst of old work.
    +- What a hook did is not in [History](/windows/chat/history/). You open it from the rule that started it.