Skip to main content
Run 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 into hooks.PreToolUse in Devin CLI’s config.json:
The file is $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 PreToolUse entry in the file. When config.json does not exist, install creates it with that one hooks key.
  • 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

  • exec is the only command tool. The hook detects its shell dialect.
  • The hook analyzes the text that write_to_process calls 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.
For an allowed call, the hook writes nothing, so Devin CLI’s own permission prompt still applies.

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. An exec call can name another directory in workdir, and the hook then analyzes the command there.
  • A relative workdir resolves against the session directory.
  • The workdir does not have to be inside the session directory.
  • The hook denies a workdir that is blank or not a string.
  • The hook denies a workdir that is not an existing directory, and the denial names that directory.

How the Devin CLI hook checks typed input

A write_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_input carries a <Name> key that Devin CLI does not document.
  • Both text_input and bytes_input carry text.
Keys sent on their own, such as <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 a block 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.json that install writes. Hooks in a project .devin/hooks.v1.json run 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_process call 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

Uninstall removes only the managed handler and writes the file back. It never deletes 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/devin when XDG_CONFIG_HOME is set and not empty.
  • Otherwise <home>/.config/devin.
  • On Windows, %APPDATA%\devin, or <home>\AppData\Roaming\devin when APPDATA is unset or empty.
The file is config.json in that directory. CC Safety Net uses the variable’s value as written, with no ~ expansion.

Troubleshoot Devin CLI

When config.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.
Last modified on October 22, 2026