.devin/ directory (or a user-level config) and Devin CLI runs them at the matching lifecycle events. Existing hooks in .claude/ directories are also picked up automatically — see Where Hooks Live.
What Can Hooks Do?
Enforce policies
Block dangerous commands, require confirmation for specific actions, or restrict file access.
Add context
Inject additional instructions or information when specific tools are called.
Run side effects
Execute scripts, send notifications, or log events when things happen.
Modify permissions
Dynamically grant or restrict permissions based on the situation.
Quick Example
Create.devin/hooks.v1.json in your project:
./scripts/check-command.sh before every shell command execution. The script receives event data on stdin and can block the action by returning a non-zero exit code.
Hook Events
Hooks can respond to these lifecycle events:
See Lifecycle Hooks for details on each event and its available data.
Hook Format
Each hook has a type (command or prompt), an optional matcher (regex on the hook event’s tool_name), and configuration:
Command Hooks
Command hooks run a shell command. Event data is passed as JSON on stdin, and the command can return JSON on stdout to control the outcome (see Output format below). Input (stdin):DEVIN_PROJECT_DIR environment variable is automatically set to the project root directory.
See Using the Matcher for the built-in tool names and MCP tool name format you can match.
Output format
A command hook can print a JSON object to stdout to control the outcome. To approve or block an action, return a top-leveldecision (with an optional reason):
additionalContext inside a hookSpecificOutput object tagged with the event name:
updatedInput inside a PreToolUse hookSpecificOutput. Fields in updatedInput are merged into the tool’s arguments, so you can update a subset (e.g. just command):
Exit Codes
Where Hooks Live
Devin CLI reads hooks from the following locations. All use the same JSON format.Project-Level
User-Level (Global)
In
.devin/hooks.v1.json, the hooks object is the entire file (no wrapper key needed). In all other locations, hooks are nested under the "hooks" key in a settings file.Hooks from
.claude/ paths are loaded when read_config_from.claude is enabled (the default). You can disable this in your user config if needed.Verifying Hooks
Use the/hooks slash command to see all currently loaded hooks and their source files:
Next Steps
Lifecycle Hooks
Deep dive into each event type and what data is available.
Configuration
Control which config locations Devin CLI reads hooks from.

