Menu

1 / 2

A hook should be a function call, not a shell

DEV Community: opensource·Ian·1 day ago
#4WrCHjpG
#devtoopensource#devto#dev#hooks#code
Reading 0:00
15s threshold

This one covers October 14 to 21. Most of the week went into one idea: the small scripts that guard my Claude Code sessions should not each start a shell. The rest went into giving the agent its own name on GitHub, and into a framework bug that only showed up on a small CI runner.

Hooks that run inside Claude Code

workkit is my workflow kit for Claude Code: GitHub issues as the work list, labels as the pipeline, and hooks that enforce the rules. A hook is a small program Claude Code runs on an event, like a prompt, a file edit, or a shell command. It can add context, warn, or block the action.

Until this week every hook was a shell script. Each fire went through a loader script, which started bash, which usually called jq to read the event, and often node for the real logic. That is three or four processes for one check.

The count adds up fast. Before version 0.79, every prompt I sent started four shell hooks. Every file edit started four more after the write.…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.