claude_cli: guard denies before the tool runs (hx#182) (#19)

This commit was merged in pull request #19.
This commit is contained in:
hermes committed 2026-11-14 11:19:51 +00:00
1 parent a76c0ac16f
commit 9ce4756fad
5 files changed
+96 -25

No files matched your search

+11
View File
@@ -0,0 +1,11 @@
#!/usr/bin/env python3
"""Extension that starts fine (handshake, subscribes to tool_call) and then dies on the first event: a guard that
crashes mid-run. hx treats this as "continue"; permissions = "extensions-only" must turn it into a deny."""
import json, sys
for line in sys.stdin:
m = json.loads(line)
if m["method"] == "initialize":
print(json.dumps({"jsonrpc": "2.0", "id": m["id"], "result": {"subscribe": ["tool_call"], "tools": []}}), flush=True)
else:
sys.exit(1)