Keep Google Calendar Updated from WhatsApp Groups with Claude
I was tired of tracking events across my WhatsApp groups by hand and overcommitting myself, so I built a daily AI assistant that reads the groups and keeps my Google Calendar up to date automatically. I'm in six busy groups: multiple cricket chats, a tournament group, a volunteering rota, a weekly class, and a tennis club. Events arrive as polls, times change, venues are added, fixtures are cancelled, and the same match is often posted in multiple groups. A Claude Cowork scheduled task runs every morning. Using Claude in Chrome, it opens WhatsApp Web and reads only the fixed list of six named groups, starting from where it stopped last time. It turns messages into calendar events based on polls, merges duplicates across groups by matching the event type, date and time, and venue, and emails me a short digest covering what changed, what needs my attention, and which chats I had already read myself. I can reply to that email to steer it—for example, “delete that,” “move to 6pm,” or “why did you create this?”—and the next run acts on or answers my reply. Three small files next to the prompt make the workflow reliable: - `state.json` records where each chat was last read and which events it owns. It never overwrites a field I edited by hand. - `run.log` contains a one-line record for every action and the reason for it, so the assistant can answer questions weeks later without rereading WhatsApp. - `lessons.md` holds rules it writes for itself when something goes wrong, such as “WhatsApp changed its page layout, use this selector instead.” It reads these rules every run and can improve them. The key prompt rules are: “Your sources are exhaustive: these six chats and nothing else. Reading a chat that is not a source is itself the failure.” “Never create a second event for the same occasion. Merge; the first source owns it.” “Fields I changed by hand are locked. Report conflicts, don't overwrite.” “Send the digest every run, even when nothing happened, so silence means the run failed.” The result is that my calendar follows my WhatsApp groups without me doing anything, and each morning’s email flags the two or three things that actually need a decision. Step-by-step: 1. I define a fixed list of six named WhatsApp groups as the only allowed sources. 2. I schedule a Claude Cowork task to run every morning. 3. Using Claude in Chrome, the task opens WhatsApp Web and resumes reading each source from where it stopped last time. 4. It turns messages and polls into Google Calendar events, updating times, venues, and cancellations as needed. 5. It merges duplicate events across groups by matching the event type, date and time, and venue, while keeping the first source as the event owner. 6. It protects fields I edited by hand and reports conflicts instead of overwriting them. 7. It records chat progress and event ownership in `state.json`, logs every action and its reason in `run.log`, and reads `lessons.md` for rules learned from previous problems. 8. It emails me a digest every run, including what changed, what needs my attention, and which chats I had already read myself. 9. I reply to the digest when I want to delete an event, move it, or ask why it was created; the next run acts on or answers my reply.
0 comments