Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
| curl -X POST \ | ||
| -H "Content-Type: application/json" \ | ||
| -d @- \ | ||
| --max-time 30 \ | ||
| "${server_url}/rpc/hooks.claude" |
There was a problem hiding this comment.
🟡 curl in send_hook.sh lacks -sS flag, causing progress meter noise on stderr
The curl command in send_hook.sh is missing the -sS (silent + show-errors) flag. When Claude Code runs a command-type hook, it captures stdout (for the hook response), but stderr flows to the user's terminal. By default, curl outputs a progress meter to stderr whenever stdout is redirected (i.e., not a terminal) — which is exactly the case here since Claude Code captures the command's stdout. This means every tool invocation will display curl's transfer progress bar in the user's terminal, which is disruptive and noisy.
| curl -X POST \ | |
| -H "Content-Type: application/json" \ | |
| -d @- \ | |
| --max-time 30 \ | |
| "${server_url}/rpc/hooks.claude" | |
| curl -sS -X POST \ | |
| -H "Content-Type: application/json" \ | |
| -d @- \ | |
| --max-time 30 \ | |
| "${server_url}/rpc/hooks.claude" |
Was this helpful? React with 👍 or 👎 to provide feedback.
| curl -X POST \ | ||
| -H "Content-Type: application/json" \ | ||
| -d @- \ | ||
| --max-time 30 \ | ||
| "${server_url}/rpc/hooks.claude" |
There was a problem hiding this comment.
🔴 send_hook.sh does not handle curl failure, risking tool-blocking on network errors
The send_hook.sh script does not handle curl failures gracefully — if curl exits non-zero (e.g., DNS failure, server unreachable, timeout), the script propagates that non-zero exit code to Claude Code. For PreToolUse command-type hooks, a non-zero exit from the hook command may cause Claude Code to block the tool invocation. This is a regression from the previous http type hooks, where Claude Code handled HTTP failures internally with built-in resilience. Since this is a monitoring/analytics hook, it should never block the user's primary workflow. The fix is to append || true (or exit 0) so the script always exits successfully regardless of whether the telemetry request succeeded.
| curl -X POST \ | |
| -H "Content-Type: application/json" \ | |
| -d @- \ | |
| --max-time 30 \ | |
| "${server_url}/rpc/hooks.claude" | |
| curl -sS -X POST \ | |
| -H "Content-Type: application/json" \ | |
| -d @- \ | |
| --max-time 30 \ | |
| "${server_url}/rpc/hooks.claude" || true |
Was this helpful? React with 👍 or 👎 to provide feedback.
We have some special rules on paths that start with rpc, so i need to move the hooks otel path behind there