Hacker News new | ask | show | jobs
by classicpsy 80 days ago
Mate I still didn't understand that.

stop hook forces the claude to run the existing tests. Fine if claude added a new feature but didn't created a test for it. It will wait for it to perform that action. Fine. We can adjust the complexitiy of hook scripts. That's ok.

Tell me if I'm wrong, I am understanding it more like a compiler like if the syntax is ok, just pass. Similarly here, if the test were ran, it will look for a marker file in /tmp, it found it, and pass.

I did not understood the part of tests. Maybe my question is more clear now.

1 comments

This is one of the simplest and most fundamental ways to manage Claude’s behavior. I genuinely can’t make it clearer. The issue you’re describing seems to center on situations where Claude becomes “stubborn” and doesn’t follow instructions.

When that happens, the solution is straightforward: create a hook script that explicitly enforces the behavior you want. By doing so, you remove ambiguity and leave Claude no option but to comply.

If you can share a specific case where Claude isn’t following your prompts, I can help you craft an appropriate hook to correct it.

Thanks for the pointer. For now I’ve fixed the issue. Your reply made me go through the hook script solution more carefully, and I’m exploring it now.