Hooks and mods run whether the agent agrees or not
Why don't agents listen to what I'm saying? I've tried many different ways, including writing to the CLAUDE.md and AGENTS.md files, which are supposed to instruct agents on how to behave. It always feels like they roll the dice every time to decide whether to follow those instructions or ignore them. It's been really unreliable.
- That's why I'm quite optimistic about mods and hooks. They feel like pieces of code that Claude runs at specific moments, which means it doesn't get to decide whether to read them.
- The way I see it, a prompt hook (or a mod) could be the trigger, so Claude can't forget to run the search in QMD (a local search tool for markdown notes).
- Sometimes, as an extra layer of reliability, you can also add a stop hook that stops the agent from sending an answer if a specific condition wasn't met. For example, it never used the search, or the search returned no results and it was left to hallucinate.
- With 20,000 notes, the query is also quite important. Run some tests to see how to configure the prompt hook that works with QMD, so the search queries are optimised before they're sent to the database.
- With a lot of entries, fuzzy wording could return a lot of irrelevant results.
In that sense, the query becomes even more important than whether the search ran at all.
Sent from a working setup,
Zhenia