The official imessage@claude-plugins-official plugin reads chat.db and sends via
AppleScript directly, bypassing ComposeService.send and its duplicate-send guard
(the 2026-06-29 spam vector). Add opt-in installer flags to disable + replace it
at the source so every agent that enables the plugin is covered, not just one
agent's settings.json:
--replace-imessage back up the plugin's .mcp.json, symlink the prospector MCP
dist into the plugin root, and rewrite .mcp.json so the
'imessage' server launches the guarded prospector MCP.
--restore-imessage restore the original .mcp.json + drop the symlink.
REPLACE_VENDOR_IMESSAGE=1 / VENDOR_IMESSAGE_ROOT=... env knobs.
Idempotent (preserves the original backup once); reversible. Verified: bash -n,
replace/restore mechanics in a sandbox, and the restore branch end-to-end.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>