I wonder if you could replace the git commands exposed to an agent.

A 'commit' 'happens' when you leave a change in jj, i.e. by moving to a new or existing change; that's when you'd run pre-commit hooks.

The problem with this is that at the limit, this means "run the precommit on every save of a file," which is not really usually how people think of precommit hooks.

Given jj's rebasing tooling, rewiring precommit into "prepush" feels like the right way forward. There's a bit of a phase transition between commits on your machine and commits that are out in the wild, after all.

Maybe! I agree that it feels kinda better. I’m not a huge hook user personally though.

For me it's mostly about doing as much of CI locally as feels reasonable to do quickly to save an iteration cycle. But I live in a world of badly configured text editors and the like so I usually have some silly formatting error