Term

Hook

Info

Originally written in French. Translated by AI — the meaning has been preserved, not the prose.

Short definition

A command run automatically by an agent tool on a given event (before or after a tool call, at the end of a task) and able to filter, complete or block the action.

Full definition

In programming, a hook is an attachment point where you insert your own code into a program's flow. In an agentic system, it serves to keep outside the model what you do not want to leave to its judgment: refusing writes to a protected file, blocking progress until the tests have passed, filtering an overly large technical output before it enters the context.

In the articles on this blog, the hook is what converts a written rule into an effective constraint.

Usage in the field

Used in discussions of the reliability and cost of coding agents.

Synonyms and variants

Attachment point, extension point.

Not to be confused with

  • instruction — a directive written into the model's context, which it weighs and may break.
  • Harness — the tool that triggers the hooks.

Examples

A hook that refuses any change to a database migration file, whatever the agent has decided.

Ambiguities / debates

In React, the same word designates a component state function: a meaning unrelated to this one.