npx -y cc-safety-net@latest install --devin. It adds one PreToolUse hook to Devin CLI’s config.json, so every tool call reaches CC Safety Net first. Then run npx cc-safety-net doctor to confirm the hook is active. Devin CLI hooks fail open, which means a hook that times out or dies before it answers lets the call proceed.
Install CC Safety Net in Devin CLI
1
Run the installer
2
Confirm the hook is active
What the Devin CLI install changes
The installer writes this managed entry intohooks.PreToolUse in Devin CLI’s config.json:
$XDG_CONFIG_HOME/devin/config.json, which defaults to ~/.config/devin/config.json. On Windows it is %APPDATA%\devin\config.json. See Where Devin CLI keeps its configuration for the exact rules.
- The entry has no matcher, so every tool call reaches the hook, not only
exec. - Install keeps every other key, hook event, and
PreToolUseentry in the file. Whenconfig.jsondoes not exist, install creates it with that onehookskey. - Devin CLI accepts comments and trailing commas in
config.json. Install and uninstall write the file back as plain JSON, so your comments are lost.
What the Devin CLI hook checks
execis the only command tool. The hook detects its shell dialect.- The hook analyzes the text that
write_to_processcalls type into a running process. See How the Devin CLI hook checks typed input. - For other tools, the hook inspects the tool input for protected paths.
Which directory the Devin CLI hook analyzes commands in
Devin CLI does not tell the hook the session’s working directory, so the hook uses the directory it runs in. Anexec call can name another directory in workdir, and the hook then analyzes the command there.
- A relative
workdirresolves against the session directory. - The
workdirdoes not have to be inside the session directory. - The hook denies a
workdirthat is blank or not a string. - The hook denies a
workdirthat is not an existing directory, and the denial names that directory.
How the Devin CLI hook checks typed input
Awrite_to_process call types into a process that is already running. The hook analyzes the typed text from text_input or bytes_input as a shell command. A text_input of y with a bytes_input of <CR> analyzes y.
The hook denies the call when it cannot know the line the receiving program runs:
- Text arrives together with
<ESC>,<BS>, an arrow key, or a<C-…>key. bytes_inputcarries a<Name>key that Devin CLI does not document.- Both
text_inputandbytes_inputcarry text.
<UP><CR> or <C-c>, are not commands, and the hook does not analyze them.
What happens when the Devin CLI check fails
Devin CLI hooks fail open. Only exit code 2 or ablock decision blocks a tool call. A timeout, a missing npx, or a hook process that dies before it answers lets the call proceed. An error the hook catches itself still blocks, because the hook answers block for it.
Devin CLI coverage limits
- Project hooks. CC Safety Net supports only the user-level
config.jsonthat install writes. Hooks in a project.devin/hooks.v1.jsonrun with the repository root as their working directory, and Devin CLI gives the hook no way to correct for that. - Split input. The hook analyzes each
write_to_processcall on its own, so it does not check a command typed across several writes as one command. - Devin Cloud. CC Safety Net does not cover Devin Cloud sessions.
- Claude Code hooks. Devin loads Claude Code hook files by default, so a CC Safety Net hook installed for Claude Code can also run in a Devin session. That only duplicates denials.
Uninstall CC Safety Net from Devin CLI
config.json, even when hooks.PreToolUse ends up empty. When the file holds no managed handler, uninstall writes nothing and reports the hook as not installed.
Where Devin CLI keeps its configuration
Devin CLI lets you move its configuration directory. CC Safety Net follows the same override, so it still finds a relocated config:$XDG_CONFIG_HOME/devinwhenXDG_CONFIG_HOMEis set and not empty.- Otherwise
<home>/.config/devin. - On Windows,
%APPDATA%\devin, or<home>\AppData\Roaming\devinwhenAPPDATAis unset or empty.
config.json in that directory. CC Safety Net uses the variable’s value as written, with no ~ expansion.
Troubleshoot Devin CLI
Whenconfig.json has a problem, install stops and writes nothing. doctor prints the same message as Error (Devin CLI): <message>, counts Devin CLI as not configured, and exits 1. Fix the file, then run the install again.
If
doctor warns about a changed hook entry, run the install again. Managed hook drift lists the warnings.