Cline
This guide shows how to integrate Cline with Maybe Don’t using hooks.
Prerequisites
- Maybe Don’t gateway running in
httporssemode (see Get Started) - Cline installed in VS Code
jqandcurlon PATHMAYBE_DONT_URLenvironment variable set (e.g.,http://localhost:8080)- macOS or Linux (the reference bash scripts require a Unix shell)
Install the Hook
Export the hook script into your project’s .clinerules/hooks/ directory:
mkdir -p .clinerules/hooks
maybe-dont hooks export --agent cline > .clinerules/hooks/maybe-dont-hook.sh
chmod +x .clinerules/hooks/maybe-dont-hook.shConfigure Cline
Export the config snippet:
maybe-dont hooks export --agent cline --configThis outputs the configuration to place in .clinerules/hooks/. Update the command path to where you placed the hook script:
{
"hooks": {
"preToolUse": {
"command": ".clinerules/hooks/maybe-dont-hook.sh"
},
"postToolUse": {
"command": ".clinerules/hooks/maybe-dont-hook.sh"
}
}
}Set the gateway URL before launching VS Code:
export MAYBE_DONT_URL="http://localhost:8080"Supported Events
| Event | Phase | Description |
|---|---|---|
preToolUse | Pre-tool | Fires before Cline executes a tool. The hook can block the tool call. |
postToolUse | Post-tool | Fires after tool execution. Observability only — results are logged but cannot be blocked or modified. |
Verify It Works
Open VS Code with Cline and trigger a tool call. Check the gateway’s audit log for entries — you should see an intercept record for the tool call.
The hook is silent on allow. On deny, you’ll see stderr output like:
[maybe-dont] WARNING (PostToolUse): Policy violation detected — <reason>Filtering
Cline hooks support a matcher field using Claude Code-compatible regex syntax. The matcher filters which tools trigger the hook based on tool name.
{
"hooks": {
"PreToolUse": [
{
"matcher": ".*",
"hooks": [
{
"type": "command",
"command": ".clinerules/hooks/maybe-dont-hook.sh"
}
]
}
]
}
}Use a specific pattern like "execute_command" to match only CLI tools, or ".*" to match all tools. See the Cline hooks documentation for details.
Agent-Specific Notes
- The reference hook scripts are bash — they require macOS or Linux. On Windows, you can write your own hook in any language that calls the intercept endpoint.
- Hook configuration lives in
.clinerules/hooks/in your project root. - Cline passes tool details as JSON on stdin to the hook script.