Knaph

Hook

A command an agent's harness runs automatically at a fixed moment - before a tool runs, after it runs, when the agent is about to stop - every time, whatever the model has in mind. Instructions are followed usually; hooks run always.

Depth 1 · Foundation

You can explain why a hook is more reliable than an instruction, name the main hook events, and choose which rules belong in a hook.

Sign in to prove what you know with a short quiz, see how deep you've gone, and earn XP for it.

Sign in with Google

Depths of understanding

  1. 1

    Foundation

    You can explain why a hook is more reliable than an instruction, name the main hook events, and choose which rules belong in a hook.

  2. 2

    Deeper

    You can build it: before-hooks that can block a tool call and after-hooks that can change its result, wired into the one function that runs every tool, plus a stop check that runs the tests before the agent's final answer is accepted.

    Master depth 1 first

Your path here

What's still between you and Hook, depth 1, in the order you can learn it.

  1. 1Language modelDepth 1 · Foundation · Language Models
  2. 2AI agentDepth 1 · Foundation · AI Agents
  3. 3TokenDepth 1 · Foundation · Language Models
  4. 4CountingDepth 1 · Foundation · Number Systems
  5. 5Comparing numbersDepth 1 · Foundation · Number Systems
  6. 6ProbabilityDepth 1 · Foundation · Probability
  7. 7Flat shapesDepth 1 · Foundation · Geometry
  8. 8Equal partsDepth 1 · Foundation · Fractions
  9. 9LengthDepth 1 · Foundation · Measurement
  10. 10LengthDepth 2 · Deeper · Measurement
  11. 11Equal partsDepth 2 · Deeper · Fractions
  12. 12FractionsDepth 1 · Foundation · Fractions
  13. 13ProbabilityDepth 2 · Deeper · Probability
  14. 14ProbabilityDepth 3 · Connected · Probability
  15. 15ProbabilityDepth 4 · Deeper still · Probability
  16. 16ProbabilityDepth 5 · Deeper still · Probability
  17. 17Next-token predictionDepth 1 · Foundation · Language Models
  18. 18Stateless modelDepth 1 · Foundation · Language Models
  19. 19Context windowDepth 1 · Foundation · Language Models
  20. 20System promptDepth 1 · Foundation · Language Models
  21. 21Tool useDepth 1 · Foundation · AI Agents
  22. 22Agent loopDepth 1 · Foundation · AI Agents
  23. 23Agent harnessDepth 1 · Foundation · AI Agents
  24. 24Agent permissionsDepth 1 · Foundation · AI Agents
  25. 25HookDepth 1 · Foundation · AI Agents

Where it fits

This concept