Audit the hooks and automatic scripts that run during the work of this agent: agent hooks (before and after a tool call, at the start of a session, at the stop), git hooks, and scripts that run when a file is saved.
Inventory. For each hook give the event, the condition that selects it, the command, the file that defines it (project, user, or local), and its purpose.
Test each hook with a safe sample input: one case that it must accept, and one case that it must reject. Record the exit code, the output and the time. If you cannot run a hook safely, read its code and say that you did not run it.
Failure of the hook itself. If the command of the hook fails (a missing program, a timeout, a syntax error), does the action continue or stop? Does somebody see the failure? A guard that lets all actions through when it breaks, with no message, protects nothing.
Message. When a hook stops an action, does the agent get a message that says what to do? Without one, the agent tries the same thing in a different way.
Ways around. Can the agent get the same result by a path that the hook does not match? Examples are a different tool, a shell command in place of the edit tool, a flag such as --no-verify, and an environment variable.
Cost. How much time does each hook add to each tool call? How much text does it add to the context each time?
Safety of the hooks.
Rules:
Output: a table with one row for each hook and these columns: purpose, works (yes, no, not tested), when it breaks (stops the action, lets it through), message (clear, not clear, none), way around, time. Then the fixes, most severe first.