
Going deeper: Intercepting subcommands in Make, Just, and Git Hooks
If you haven't seen it yet, I have been working on tokf, a command and hook combo that helps me reduce the amount of tokens injected into Claude Code when commands like cargo test are run. The initial post about it can be found here . The main benefit of doing this is increasing the amount of context available to Claude Code, which generally leads to better results. Going deeper I started by using the hooks to intercept the commands being run and modify them to be run by tokf instead, this works well when Claude Code simply tries to run a command like cargo test . A lot of the time, however, that simple command will be part of a Justfile or a Makefile. This means that being able to intercept just test doesn't let us filter the subcommands. We need to go deeper, we need to be able to intercept the commands that just tries to run, not only just itself. Shell interception Both make and just allow us to set up a shell which they can use to execute the commands that have been configured. Th
Continue reading on Dev.to
Opens in a new tab



