Skip to main content

process_opencode_hook

Function process_opencode_hook 

Source
pub fn process_opencode_hook(input: &str) -> Result<String>
Expand description

Process an OpenCode tool.execute.before hook invocation.

OpenCode’s hook format differs from Claude Code / Cursor:

  • Input: { "tool": "bash", "sessionID": "...", "callID": "..." }
  • Args: { "command": "git status" }

The hook receives both input and output (args) as separate objects, but when invoked via CLI (sqz hook opencode), we receive a combined JSON with both fields.