---
published: true
id: pre-tool-use
title: PreToolUse
description: Knowledge captured in João Lopes' learning graph.
tags:
- claude-code
- hooks
locale: en
resource: https://joaolopes.dev.br/knowledge/concepts/en/pre-tool-use/
created: '2026-03-28'
---

# PreToolUse
A Claude Code hook event that fires before every tool call is executed, capable of blocking, annotating, or passing the call through.

## Definition
PreToolUse hooks receive the tool name and parameters before execution. The hook can block the call (exit code 2), annotate it with additional context (exit code 0 with stdout), or let it pass (exit code 0, no output). This is the primary mechanism for preventing unwanted actions — a script can inspect the tool call and reject it before the runtime executes it. PreToolUse runs synchronously: the tool call waits for the hook to complete.

## Source
- [Automate Workflows with Hooks — Anthropic Docs](https://docs.anthropic.com/en/docs/claude-code/hooks-guide)

## Related
- PostToolUse
- [Lifecycle](/concepts/en/lifecycle.md)
