Claude Code can run shell commands, edit files, and push to git on your behalf. That power is the point — and the risk. Hooks are the mechanism for putting deterministic guardrails around it: small scripts the harness runs at defined points in the agent's loop, able to inspect — and block — wha...
Source: [Dev.to](https://dev.to/ludoonus/how-claude-code-hooks-work-a-practical-guide-to-pretooluse-gates-1i3k)