TuttiDocumentation
StarES

Hooks

Hooks automate something when an event happens, for example when a file is saved: they run a command or notify the agent.

Where they live .tutti/hooks/<name>.json
Format Kiro’s: version and a hooks list
Fields of each hook trigger, matcher, action, timeout, enabled

The + opens a dialog with two options, like Kiro’s: Create a hook (a guided form, in an editor tab, with name, event, filter and action) or Ask the agent (you describe the hook in your own words and an agent writes the JSON: it shows it to you and saves it switched off until you approve). The pencil on each hook opens it in the same form so you can edit it without touching the JSON; the other hooks in the file and its switch are kept.

A hook is a .tutti/hooks/<name>.json file in Kiro’s format: version, a hooks list and, in each one, name, description, trigger, matcher (a regular expression on the path), action (command or agent), timeout (seconds, 60 by default) and enabled. One file can hold several.

{ "version": "v1", "hooks": [{
    "name": "Lint on save", "trigger": "PostFileSave", "matcher": "\\.(ts|tsx)$",
    "action": { "type": "command", "command": "npx eslint --fix $TUTTI_HOOK_FILE" }
}] }
  • PostFileSave fires when a project file is saved (by you or by an agent). With command, Tutti runs the command at the root with the context as JSON on stdin and the file in $TUTTI_HOOK_FILE; with agent, it types the prompt into the open agent. The result shows as a notice.
  • PreToolUse, PostToolUse and Stop are read and shown (in amber), but Tutti does not run them: they are events of each agent’s internal session.
  • Because a hook runs commands from the repository, it does not run until you allow it: when you press a hook’s switch, Tutti asks you to allow hooks in this project; until then they are only listed, with the switch off. Each hook has its own switch, and a hook that rewrites the file does not fire again in a loop.