4 ms·
I do not need to waste tokens on skills, I use Claude Code hooks. Have a look at the TDD guard at https://codeleash.dev https://codeleash.dev - the scripts/tdd
by cadamsdotcom 3mo ago
I do not need to waste tokens on skills, I use Claude Code hooks.
Have a look at the TDD guard at https://codeleash.dev https://codeleash.dev - the scripts/tdd_log.py arguments are pretty specific but it also has guidance in CLAUDE.md and lots of helpful error messages.
- 8cvor6j844qw_d6 3mo agoMay I know when should skills be used over hooks and vice versa?
- thx67 3mo agoHooks are for doing AoP style wrapping of your interactions with the harness. Type /hook on the console see what is available. Have CC analyze your session and suggest converting part of your workflow to a hook, and then have it test it.
- cadamsdotcom 3mo agoHooks provide determinism. Hooks can run code. Hook code can be written in advance by the agent, runs in milliseconds, costs zero tokens, and gives the same result everytime. Agents live at the boundary of codification; anything codifiable should be codified rather than run through an unpredictable machine. Hence, use hooks when you want determinism & predictability & certainty. Examples: your stop hook could run tests against the code that’s just been written. Now, if your agent docs also tell your agent that the stop hook will run tests and there’s no need to run tests itself, then it’ll trigger a stop when it’s done instead of running tests itself. Just be sure to change the exit code to 2 and route the test failure output to stderr so Claude Code will show that output to the agent. Because the stop hook will fail over and over until tests pass, you just created a very simple guard that guarantees tests pass before you see the code - your agent can’t stop working without passing tests!