upvote
Sounds like something that can grow unwieldy.
reply
Such is the joy of trying to get determinism out of a non-deterministic system…
reply
How does it generally work? Does it run a smaller model on a small set of tool calls/previous thinking block?
reply
Hooks should (in my opinion) be deterministic. As an example I’ve also noticed Claude writing Python scripts to extract fields from JSON when jq is available to it. They almost always contain the same patterns, and having seen this I’m going to write a hook which triggers on those and fails the turn telling it to use jq instead.
reply
Why do people care how it reads json?
reply
Because custom Python scripts means burning more tokens which costs more money. Reaching for an existing tool like `jq` means burning a LOT fewer tokens.
reply
Imagine you have application code with a function to parse some json. But every time you decide to use it, you re-implement the entire function. This is despite it working the same way every time.

It's not like it's being rewritten for efficiency. "Just because".

reply
I've written a lot of custom hooks this way. It's an amazing feature.
reply