feat: Discord-based remote permission approval via PermissionRequest hook

Resolved 💬 2 comments Opened Mar 27, 2026 by SkylerChenTaiwan Closed Mar 27, 2026

Summary

Engineer sessions 經常因為等待 permission approval 而卡住(supervisor 不在、PM 沒注意到)。利用 Claude Code 原生的 PermissionRequest blocking HTTP hook,實現透過 Discord 遠端批准權限。

Motivation

  • Session 卡在 permission prompt 是目前最大的效率瓶頸之一
  • PM 不可能 24 小時盯著每個 terminal
  • 參考 claude-watch 的架構:用 blocking hook 攔截權限請求,轉發到外部介面讓用戶回應

Proposed Solution

  1. settings.jsonPermissionRequest blocking HTTP hook,指向 pmx daemon
  2. Daemon 收到權限請求後,轉發到對應 session 的 Discord thread
  • 顯示:session 名稱、要執行的操作、檔案/指令內容
  • 提供 ✅ 批准 / ❌ 拒絕 的 reaction 或 button
  1. PM 在 Discord 回覆後,daemon 回傳 hookSpecificOutput 給 Claude Code
  2. Session 根據結果繼續或停止

Technical Reference

  • Claude Code PermissionRequest hook 是 blocking hook,最多等 10 分鐘
  • Hook response 格式:{ hookSpecificOutput: { hookEventName: "PermissionRequest", decision: { behavior: "allow" | "deny" } } }
  • 參考實作:https://github.com/shobhit99/claude-watch/blob/main/skill/bridge/server.js

Acceptance Criteria

  • [ ] pmx daemon 能接收 PermissionRequest hook
  • [ ] 權限請求轉發到正確的 Discord thread
  • [ ] PM 在 Discord 批准/拒絕後,session 正確繼續或停止
  • [ ] 超時處理(10 分鐘未回應 → 自動拒絕 + 通知 PM)
  • [ ] 支援「全部允許」選項(allow all for this session)

View original on GitHub ↗

This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗