iMessage plugin: permission_request broadcasts to all allowlisted DMs instead of self-chat only
Bug
The permission_request notification handler in the iMessage channel plugin (server.ts ~line 565) sends permission prompts to every allowlisted DM, not just the owner's self-chat.
What happens
- Claude Code emits a
permission_requestnotification (e.g. for a Bash or Write tool call) - The handler collects handles from
access.allowFromplusSELFaddresses - It resolves each handle to chat GUIDs via
qChatsForHandle - It sends the permission prompt text to all resolved chats
This means every contact in allowFrom receives internal permission request messages like:
🔐 Permission request [xxxxx] Bash: Create channels/imessage directory Reply "yes xxxxx" to allow or "no xxxxx" to deny
Expected behavior
Permission requests should only be sent to the owner's self-chat — not to DMs with other contacts. The self-chat is where the owner interacts with Claude; broadcasting permission prompts to other people is a privacy leak and confusing UX.
Suggested fix
In the permission_request handler, resolve only SELF handles (not allowFrom), and further filter to chats where every participant is also a SELF address (true self-chat):
const candidates = new Set<string>()
for (const h of SELF) {
for (const { guid } of qChatsForHandle.all(h)) candidates.add(guid)
}
const targets = new Set<string>()
for (const guid of candidates) {
const participants = qChatParticipants.all(guid)
if (participants.length > 0 && participants.every(p => SELF.has(p.id.toLowerCase()))) {
targets.add(guid)
}
}
Environment
- macOS, Claude Code with iMessage channel plugin
dmPolicy: "allowlist"with multiple contacts inallowFrom
This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗