Another example is I whitelist dependencies based on the dependency age, for example a library needs to have been around for a year, then it can do `uv add {dependency}`.
As a third example, hooks tell Claude not to write out *_test|debug.py at the root of a project, which for some reason it very often does when it wants to fix some issue. The hooks tell it to write a proper test case using the test framework in place. So instead of having random debug and test scripts everywhere after a long session, I have more test coverage.
This is all in the agent-policies-server project linked above. Mainly it reduces interruptions and I don't have to worry about it doing something particularly stupid. (It is not a replacement for sandboxing)
> Do you use an editor alongside the CLI to review code or only examine the diffs?
I do have the file tree open alongside the CLI, and that is both in Zed. How much of the code I review depends on who owns the code, meaning a client, employer or me. In most cases I review it myself, as for many clients code goes through a peer review process. In some cases the organization uses automated quality metrics and has agents looking at code instead. If agents don't have any more comments, and the quality metrics also approve, it's good enough for them. As for my own personal projects, I look at the code when I feel like it, which is practically never.
I use hooks to automate decisionmaking (i.e. stronger permissions than a regex by parsing the bash) and similarly automate guidance. Our tooling is open source so here is an example: https://github.com/Devleaps/agent-policies-server/blob/maste...
Another example is I whitelist dependencies based on the dependency age, for example a library needs to have been around for a year, then it can do `uv add {dependency}`.
As a third example, hooks tell Claude not to write out *_test|debug.py at the root of a project, which for some reason it very often does when it wants to fix some issue. The hooks tell it to write a proper test case using the test framework in place. So instead of having random debug and test scripts everywhere after a long session, I have more test coverage.
This is all in the agent-policies-server project linked above. Mainly it reduces interruptions and I don't have to worry about it doing something particularly stupid. (It is not a replacement for sandboxing)
> Do you use an editor alongside the CLI to review code or only examine the diffs?
I do have the file tree open alongside the CLI, and that is both in Zed. How much of the code I review depends on who owns the code, meaning a client, employer or me. In most cases I review it myself, as for many clients code goes through a peer review process. In some cases the organization uses automated quality metrics and has agents looking at code instead. If agents don't have any more comments, and the quality metrics also approve, it's good enough for them. As for my own personal projects, I look at the code when I feel like it, which is practically never.