Skip to content

Business operating system for Claude Code — 57 skills, 21 agents, smart daemon. Unified inbox (WhatsApp/Email/Slack/Telegram), autonomous PR merge, full-AWS monitoring, revenue (Stripe+RevenueCat), e-commerce (Shopify), marketing (Klaviyo/Meta/GA4), voice (Bland/ElevenLabs), APM (Datadog/NewRelic/OTEL), YOLO mode.

ops-inbox: verify SENT via labelIds (gog in:sent search is polluted) (#668)

Aurora Capital969a8b8a987a
diff --git a/claude-ops/skills/ops-inbox/SKILL.md b/claude-ops/skills/ops-inbox/SKILL.md
index d50690d2..d5a27455 100644
--- a/claude-ops/skills/ops-inbox/SKILL.md
+++ b/claude-ops/skills/ops-inbox/SKILL.md
@@ -684,9 +684,15 @@ Before confirming ANY NEEDS_REPLY or drafting, run steps 1–7:
1. **Same-thread recheck** — scan the full thread both directions (incl. `[voice]`/`[image]`/`[document]` enrichments). If the user replied after the last inbound, it is WAITING/HANDLED.
2. **Cross-thread, same person (MANDATORY)** — the user may have answered the same person on their other JID (lid↔phone), in a group both are in, or a secondary number. Search the contact across threads (`mcp__whatsapp__list_messages {query, limit:25}`, `is_from_me:true` after the inbound timestamp). A satisfying reply in ANY of the person's threads → HANDLED.
-3. **Cross-channel (MANDATORY)** — the user may have answered the email by WhatsApp, or the WhatsApp by email/iMessage/Slack/Telegram. For EVERY NEEDS_REPLY candidate, you MUST search the OTHER channels for a recent outbound to the same person OR about the same topic before confirming: `gog gmail search "to:<addr> newer_than:3d"`, `mcp__whatsapp__list_messages {query:"<name|topic>"}`, iMessage `chat_messages`, Slack/Telegram history. A hit on the same request → reclassify HANDLED. Skipping this search is not permitted — an unsearched candidate is not yet a confirmed NEEDS_REPLY.
+3. **Cross-channel (MANDATORY)** — the user may have answered the email by WhatsApp, or the WhatsApp by email/iMessage/Slack/Telegram. For EVERY NEEDS_REPLY candidate, you MUST search the OTHER channels for a recent outbound to the same person OR about the same topic before confirming: `gog gmail search "in:sent newer_than:21d (to:<addr1> OR to:<addr2>)"` (then **verify each hit's `labelIds` contains `SENT` via `gog gmail raw` — search alone is polluted), `mcp__whatsapp__list_messages {query:"<name|topic>"}` / phone+`@lid` deep-read, iMessage `chat_messages`, Slack/Telegram/Productlane history. A verified hit on the **same request** → reclassify HANDLED. Skipping this search is not permitted — an unsearched candidate is not yet a confirmed NEEDS_REPLY.
4. **Same request across DIFFERENT people / group (MANDATORY)** — the same ask sometimes arrives from several people, or in a group AND a DM. If the user already answered the request once (in the group, to one person, or in a broadcast), the duplicate copies are HANDLED — never draft the same answer twice. Match on topic/intent, not just sender identity.
-5. **Already-sent (email) (MANDATORY)** — a reply sent from another client may not be the thread's last message in the envelope first-pass. Open the thread (`gog gmail thread get`) AND search SENT (`gog gmail search "in:sent <topic|to:addr> newer_than:7d"`) for a message after the last inbound before classifying NEEDS_REPLY.
+5. **Already-sent (email) (MANDATORY)** — a reply sent from another client may not be the thread's last message in the envelope first-pass. Open the thread (`gog gmail thread get`) AND search SENT for a message after the last inbound before classifying NEEDS_REPLY.
+ - **Search:** `gog gmail search "in:sent newer_than:21d (to:<addr1> OR to:<addr2>)"` plus subject/topic variants for the **same ask** (not just same person).
+ - **VERIFY every hit with `gog gmail raw <id>` / `get`:** `labelIds` must contain **`SENT`**. `gog gmail search 'in:sent to:X'` is **polluted** — it often returns thread peers / inbound envelopes that lack `SENT` (session-hardened 2026-07-18). Search alone is never proof of outbound.
+ - **`DRAFT` ≠ delivered.** Lindy/Gmail drafts must not be treated as already-replied.
+ - **Same person ≠ same ask.** A pay-pack to Robert on Vinites/Skin does **not** close *Betaalronde Juli II*; calendar invites to JD do **not** close a TF sleep bug; old year Brittany threads do **not** close a new TML opp.
+ - **Cross-channel:** also check WA (phone + `@lid`), Slack, Productlane/support@ when the ask is product/support. Demote email NEEDS_REPLY when the same ask was already answered on WA (or vice versa).
+ - **Report:** every KEEP / NEEDS_REPLY row must state `already_replied?` = `no` | `yes (where)` | `partial (what remains)`. Never stage a draft that duplicates a verified SENT/WA reply.
6. **Use the contact registry** (below) to resolve who a sender/number/JID actually is and pull their cross-channel identity + context in one offline lookup, so the steps 2–5 searches are precise across every JID/address/handle the person owns.
7. **Trust the user's word over the store** — if the user says they replied, it is HANDLED even if the store doesn't show it.
@@ -1244,6 +1250,8 @@ Draft replies via `gog gmail send`. Archive via `gog gmail archive <messageId> [
> **Known trap — post-archive re-scan:** after archiving FYI messages, do NOT immediately re-run `gog gmail search "in:inbox"` to confirm — that search is cached/stale and will still return the archived messages, falsely suggesting archive failed. Trust the archive command's exit 0 as success. If you must verify a specific message, use `gog gmail raw <messageId>` and check that `"INBOX"` is absent from the `labelIds` array.
+> **Known trap — `in:sent` search is polluted (2026-07-18):** `gog gmail search "in:sent to:<addr>"` frequently returns messages whose `labelIds` do **not** include `SENT` (thread contamination / last-envelope peers). **Never claim "already replied" from search hits alone.** For every candidate: `gog gmail raw <messageId>` and require `"SENT" in labelIds`. `DRAFT` is never delivery. Pair with topic match so a different open ask to the same person is not false-closed.
+
### Open Tracking — WAITING bucket enrichment (opt-in)
**What it does:** when sending a reply from ops-inbox, you can optionally add a tracking pixel (`--track`). On subsequent inbox runs, the WAITING bucket shows which sent emails have been opened by the recipient, so you know who to nudge.