Skip to content

Add Claude Code plugin for Overwatch#1

Open
abhisheksoamj wants to merge 1 commit intomainfrom
add-plugin
Open

Add Claude Code plugin for Overwatch#1
abhisheksoamj wants to merge 1 commit intomainfrom
add-plugin

Conversation

@abhisheksoamj
Copy link
Copy Markdown

Summary

  • Two-plugin marketplace (overwatch-mac, overwatch-windows) routing Claude Code hook events to Cerberus (/v1/hooks/evaluate?format=ide).
  • Wires PreToolUse (matcher .*), PostToolUse (matcher .*), UserPromptSubmit, SessionStart, Stop, Notification.
  • Fail-open on missing HIGHFLAME_API_KEY or network failure.

Test plan

  • /plugin marketplace add file:///absolute/path/to/overwatch-claude-code + /plugin install overwatch-mac in Claude Code
  • Set HIGHFLAME_API_KEY (and HIGHFLAME_URL for local Cerberus); trigger a tool call; confirm PreToolUse + PostToolUse POSTs land on the backend
  • Unset HIGHFLAME_API_KEY; confirm hook exits 0 silently (fail-open)
  • Windows: install overwatch-windows, verify .ps1 executes and posts to Cerberus

🤖 Generated with Claude Code

Two-plugin marketplace (overwatch-mac, overwatch-windows) that routes
Claude Code hook events (PreToolUse, PostToolUse, UserPromptSubmit,
SessionStart, Stop, Notification) to Cerberus for real-time security
evaluation. Fail-open on missing API key or network failure.

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces the Highflame Overwatch plugin for Claude Code, providing hook adapters for macOS, Linux, and Windows to route security events to the Cerberus backend. Feedback suggests handling empty stdin in the shell script to prevent invalid JSON and reducing network timeouts in both the shell and PowerShell scripts to improve CLI responsiveness.

EVENT="${2:-unknown}"

# Read IDE payload from stdin
payload=$(cat)
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

If stdin is empty, the payload variable will be empty, which results in invalid JSON being constructed on line 33 (e.g., ...,"payload":}). While Claude Code hooks typically provide a payload, it's safer to handle the empty case explicitly to ensure the request to Cerberus is always valid JSON, as is done in the PowerShell version.

Suggested change
payload=$(cat)
payload=$(cat)
[ -z "$payload" ] && payload="{}"

Comment on lines +36 to +41
response=$(printf '%s' "$body" | curl -s -f -m 10 \
-X POST \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $HIGHFLAME_API_KEY" \
-d @- \
"$HIGHFLAME_URL/v1/hooks/evaluate?format=ide" 2>/dev/null) || true
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

A 10-second timeout (-m 10) is quite long for a blocking hook in an interactive CLI tool. If the security backend is slow or the network is unstable, the user will experience a significant delay for every tool use or prompt. Since the plugin is designed to fail-open, reducing this timeout to 2-3 seconds would provide a better user experience while still allowing for most legitimate evaluations.

Suggested change
response=$(printf '%s' "$body" | curl -s -f -m 10 \
-X POST \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $HIGHFLAME_API_KEY" \
-d @- \
"$HIGHFLAME_URL/v1/hooks/evaluate?format=ide" 2>/dev/null) || true
response=$(printf '%s' "$body" | curl -s -f -m 2 \
-X POST \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $HIGHFLAME_API_KEY" \
-d @- \
"$HIGHFLAME_URL/v1/hooks/evaluate?format=ide" 2>/dev/null) || true

Comment on lines +37 to +44
$resp = Invoke-WebRequest `
-Uri "$BaseUrl/v1/hooks/evaluate?format=ide" `
-Method Post `
-TimeoutSec 10 `
-Headers @{ "Authorization" = "Bearer $ApiKey" } `
-ContentType "application/json" `
-Body $body `
-UseBasicParsing
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

Similar to the shell script, a 10-second timeout for a blocking IDE hook can negatively impact the user experience during network latency. Reducing -TimeoutSec to 2 or 3 seconds is recommended for a more responsive feel.

    $resp = Invoke-WebRequest `
        -Uri "$BaseUrl/v1/hooks/evaluate?format=ide" `
        -Method Post `
        -TimeoutSec 2 `
        -Headers @{ "Authorization" = "Bearer $ApiKey" } `
        -ContentType "application/json" `
        -Body $body `
        -UseBasicParsing

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants