whatsapp-sync

whatsapp-sync is a skill for Claude Code from tonydzi/second-brain-starter-kit. It costs 80 tokens per session (2,559 once invoked), scanned A, original, MIT.

A text-only synchronizer that refreshes recent WhatsApp messages into an Obsidian vault, a searchable SQLite database, group labels, contact notes, and a dashboard. Obsidian is a folder-based note-taking app, and the live bridge only exposes a recent window rather than the full history.

In plain words
What is it for?
Use it to pull recent messages, rebuild the searchable data layer, resolve names, label groups, and update the related vault pages and dashboard.
Why use it?
It keeps conversation data and notes current without downloading media or duplicating records when the refresh runs again.

Skill for Claude Code

Written for Claude Code: shipped in a Claude Code plugin. Also seen: mentions subagents.

Part of the second-brain-skills plugin — 100 skills shipped together

Good fit Use it to pull recent messages, rebuild the searchable data layer, resolve names, label groups, and update the related vault pages and dashboard.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/tonydzi/second-brain-starter-kit/whatsapp-sync
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add tonydzi/second-brain-starter-kit --skill whatsapp-sync
Clone the repo
git clone --depth 1 https://github.com/tonydzi/second-brain-starter-kit

Made for: Claude Code.

Or install second-brain-skills, the plugin that ships this one along with the rest of its 100 skills.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for whatsapp-sync

README.md
[![agentmods](https://agentmods.dev/badge/skills/tonydzi/second-brain-starter-kit/whatsapp-sync/github.svg)](https://agentmods.dev/skills/tonydzi/second-brain-starter-kit/whatsapp-sync)
Your own site
<a href="https://agentmods.dev/skills/tonydzi/second-brain-starter-kit/whatsapp-sync"><img src="https://agentmods.dev/badge/skills/tonydzi/second-brain-starter-kit/whatsapp-sync/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for whatsapp-sync

Your own site · 80×15
<a href="https://agentmods.dev/skills/tonydzi/second-brain-starter-kit/whatsapp-sync"><img src="https://agentmods.dev/badge/skills/tonydzi/second-brain-starter-kit/whatsapp-sync.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 80 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,559 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 1 finding. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00080 $0.02559
Opus 5 $0.00040 $0.01280
Sonnet 5 $0.00016 $0.00512
Haiku 4.5 $0.00008 $0.00256

Measured yesterday against content hash 660b28834ddf, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-09, from the pricing page.

Security

Grade A, and why

whatsapp-sync scanned grade A with 1 finding against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured yesterday.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Runs shell commandslowCapability

Expected in a hook, worth knowing in a rule or an instructions file.

- On Windows `subprocess.terminate()/.kill()` does NOT reliably kill the node child → zombies ACCUMULATE (found 11 once). Any spawn script must `taskkill /F /T /PID <its-own-pid>` in a finally block (see `nightly_pull.py
skills/whatsapp-sync/SKILL.md · 78 lines

How it starts

The opening of the file, as written. The whole thing — 78 lines — stays where its author put it; the contents beside it link to each section on GitHub.

OBJECTIVE: Refresh the WhatsApp slice of the Second Brain — pull the recent text the live bridge exposes, rebuild the SQLite+FTS5 data layer, re-resolve names, re-label active groups, rebuild the dashboard, and refresh the vault notes (MOC + groups + optionally contact notes). Fully deterministic except the group-label step (Sonnet). Idempotent: build_db.py is a full rebuild from raw_train/, so re-runs never duplicate.

CONTEXT:

  • Live bridge = @oss_maintainer/whatsapp-mcp (Baileys), main number "Tony PaloAlto ResearchLab" (jid [email protected]). Memory [[whatsapp-mcp-integration]] has the full setup + pairing playbook.
  • Pipeline home: $IMPORTS_ROOT/whatsapp/. Data: whatsapp_train.db (SQLite+FTS5) + raw_train\ (JSON). Vault home: $OBSIDIAN_VAULT/01-Conversations/WhatsApp/ (_WhatsApp-MOC.md, _WhatsApp-Groups.md, 9 contact notes). Dashboard: _Dashboards\WhatsApp-Dashboard.html.
  • SCOPE: TEXT ONLY. Never download_media; ignore the hasMedia flag.
  • Model routing: the group-label step is grunt classification → Sonnet subagent (per [[model-routing-sonnet-grunt]]). Contact-note summaries (CRM intel, not Anton's authorial voice) → Sonnet draft acceptable under the quality gate; escalate to Opus if weak.

⚠️ HARD SAFETY (corrected model, proven 2026-06-16):

  • A 2nd client doing READ-ONLY (list_chats/list_messages) does NOT trigger AUTH_KEY_DUPLICATED — the server degrades it to read-only and coexists. Only WRITE ops (resolve_contacts) need sole-client (else they error harmlessly into read-only). So a read pull can run alongside the registered MCP.
  • On Windows subprocess.terminate()/.kill() does NOT reliably kill the node child → zombies ACCUMULATE (found 11 once). Any spawn script must taskkill /F /T /PID <its-own-pid> in a finally block (see nightly_pull.py). The nightly twin does this; it kills ONLY its own child, never the registered server.
  • Gentle on the main number ([[telegram-safety]] sibling): read-only, modest pacing; ban-risk was accepted consciously (variant A).

STEPS:

  1. PULL-MODE decision. Call mcp__whatsapp__get_my_profile.
    • If it returns the profile → bridge is LIVE → use PULL-LIVE (step 2a). NEVER spawn train_pull.py.
    • If the tool is absent/errors (headless) → use PULL-SPAWN (step 2b). 2a. PULL-LIVE (preferred, no double-client risk):
    • mcp__whatsapp__list_chats {limit:100} → the chat list (jid, name, isGroup).
    • For EACH chat: mcp__whatsapp__list_messages {jid, limit:50} (bump to 100 only if a chat is high-value). Collect {id, from, fromMe, type, text, timestamp, hasMedia}. Pace gently.
    • Assemble $IMPORTS_ROOT/whatsapp/live_pull.json = [{jid,name,isGroup,messages:[...]}, ...] (Write tool) and run python ingest_live.py (→ raw_train/ + train_summary.json, the format build_db eats). 2b. PULL-SPAWN (headless only): pre-flight kill stray node, then python train_pull.py (it spawns ONE temporary client, waits ~45s for history sync, writes raw_train/ + train_summary.json), then hard-kill node.
  2. BUILD DATA: python build_db.py (drops + rebuilds whatsapp_train.db from raw_train/ — idempotent; categorizes; named=0/1).
  3. NAMES (DMs): if PULL-SPAWN, python names_fix.py (resolve_contacts + re-snapshot chats2.txt). If PULL-LIVE, optionally call mcp__whatsapp__resolve_contacts {resync:true} then re-list to upgrade numeric DM names. (Group subjects: the server is PATCHED to fetch real group subjects via groupMetadata on get_chat — after the next MCP restart list_messages/get_chat return real names; until then groups are labeled by content in step 6.)
  4. DASHBOARD: python build_dash_export.py (→ _Dashboards\WhatsApp-Dashboard.html + valuable_chats.json).
  5. GROUP LABELS (active groups, n_mine≥3):
    • python extract_active_groups.py (→ active_groups.json, compact content samples, 0 tokens).
    • Spawn ONE Sonnet subagent (Agent tool, model:'sonnet') to read active_groups.json and write group_labels.json = [{jid,label,category,lang,confidence,one_line}] (categories: work-business|household-community|project-windmill|family-personal|crypto-web3|longevity-health|services-vendors|other). No media, no WhatsApp tools.
    • python apply_group_labels.py (writes labels into DB, named=2 = INFERRED) then re-run python build_dash_export.py so the dashboard shows the labels. 6.5 GRAPH-LINK (Rail 1 people + Rail 2 concepts — the [[relink-mechanism]] applied to WhatsApp; rich path only):
    • python link_people.py (0 tokens): phone-join WhatsApp DM jid (=phone last10) → apple-contacts\contacts.dbvault_matches → CRM/person note → people_matches.json. Phone match = T1 (trust); name-only = T2 (DO NOT trust — surname-blind false positives).
    • For T2 candidates spawn a Sonnet judge (Agent, model:'sonnet') → people_verified.json (conservative: confirm only on surname+role match, else null = WA note stays canonical). Identity-critical: a wrong link corrupts the graph.
    • Concepts: create/confirm any NEW topic-concept (windmill-park, etc.) per concept-creation-rules (DUP-CHECK first — e.g. household already = concept-bible-household/concept-bible-staff-hr).
    • python link_apply.py (idempotent): writes "## 🔗 Graph" into each WA note (verified person/CRM + concepts) + back-links into the 4 rich targets = BIDIRECTIONAL. Run AFTER vault_backup. Verify 0 broken targets.
  6. VAULT (BACKUP FIRST — [[vault-backup-rule]]): python $IMPORTS_ROOT/vault_backup.py, then:
    • python build_groups_note.py (→ _WhatsApp-Groups.md).
    • Refresh _WhatsApp-MOC.md counts if chat/msg totals changed. (Contact notes: refresh only if a key chat changed materially — keep open-action-items current; that's the high-value part.)
  7. REINDEX (RAG): rely on the nightly Brain Reindex @04:00, or python $IMPORTS_ROOT/brain_embed_update.py --wait-gpu 10 if Anton wants it searchable now.
  8. REPORT: chats/msgs pulled, named vs ✎-inferred counts, new/changed open-action-items flagged for Anton, dashboard path. End with a 🧒 In plain words recap (messages TO Anton only).

Read the full file on GitHub · 78 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. yesterday First seen · 78 lines · 80 tokens per session scan A 660b28834ddf

Subscribe to this mod's changes

whatsapp-sync is a skill published in the GitHub repository tonydzi/second-brain-starter-kit (6 stars, last pushed yesterday), licensed MIT. It adds 80 tokens to every session and 2,559 once invoked, about $0.0004 per session on Opus 5. A static security scan graded it A with 1 finding (runs shell commands). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-09.

Related

Other skills, from other repositories

ingest

A tool for adding a URL, file, text, or Inbox item to the LLM Wiki. It checks the material's purpose, preserves the original source, compiles a wiki page, updates indexes and logs, and reviews the result.

johnfkoo951/cmds-llm-wiki · 56 tokens

obsidian-bases

Create and edit Obsidian Bases (.base files) with views, filters, formulas, and summaries. Use when working with .base files, creating database-like views of notes, or when the user mentions Bases, table views, card views, filters, or formulas in Obsidian.

Linearl/reasonix_skill_repo · 63 tokens

wiki-ingest

Ingest supplied source material into an Obsidian vault with provenance and claim tracking: pasted text, files staged in the selected vault's inbox or .raw archive, or explicitly approved URLs. Use for a single source or bounded batch, not for saving an assistant answer. Triggers: ingest, ingest this file, ingest this…

AgriciDaniel/claude-obsidian · 88 tokens

autoresearch

Run a bounded, source-grounded research loop, draft a cited dossier, and optionally propose a separately reviewed canonical vault merge. Use when the user wants autonomous or deep research that may access the public web. Triggers: /autoresearch, autoresearch, research this topic, deep dive into, investigate, find…

AgriciDaniel/claude-obsidian · 80 tokens

wiki-retrieve

Build and query a vault-local contextual BM25 retrieval index with optional multilingual Nomic cosine reranking; use for retrieve, hybrid retrieval, BM25, rerank, contextual retrieval, chunk search, vault search, semantic search, find relevant passages, or retrieval diagnostics. Derived caches stay under .vault-meta…

AgriciDaniel/claude-obsidian · 81 tokens

canvas

Create, inspect, and update Obsidian JSON Canvas boards with text, file, link, group, and edge nodes. Use for canvas status, canvas lists, visual maps, zones, spatial layouts, adding vault notes or media to a .canvas file, and requests such as create canvas, add to canvas, or put this on the canvas.

AgriciDaniel/claude-obsidian · 72 tokens