permissions hook helper
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

Send macOS notification on passthrough so user knows Claude is waiting

+10
+10
chook.mjs
··· 2 2 3 3 import { readFileSync, existsSync } from "fs"; 4 4 import { appendFileSync, openSync, closeSync, writeFileSync } from "fs"; 5 + import { execFileSync } from "child_process"; 5 6 import { resolve } from "path"; 6 7 import { homedir } from "os"; 7 8 ··· 413 414 process.exit(0); 414 415 } 415 416 417 + // Passthrough — Claude is waiting for user approval, send notification 416 418 audit(config.audit, input, "passthrough", null); 419 + const detail = toolInput.command || toolInput.file_path || toolInput.notebook_path || toolName; 420 + const short = detail.length > 80 ? detail.slice(0, 77) + "..." : detail; 421 + try { 422 + execFileSync("osascript", [ 423 + "-e", 424 + `display notification "${short.replace(/"/g, '\\"')}" with title "chook: ${toolName} needs approval"`, 425 + ]); 426 + } catch {} 417 427 } catch (e) { 418 428 process.stderr.write(`chook error: ${e.message}\n`); 419 429 process.exit(1);