Yesterday I've tried coding with Anthropic Claude a Python script to read my email and summarize it.
I've asked Claude for a utility that connects to my mailbox using IMAP, downloads a copy of today's messages and summarizes each one using AI, storing the summaries in a text file. The utility should start by accepting a command-line parameter with the number of days past (default to today) and read a file containing the IMAP server parameters.
Initially Claude misunderstood my request for an option to choose any of 3 AIs and instead gave me a solution that would ask all 3 AIs for the summary (Anthropic, OpenAI and Llama) in a sequence. 🤦♂️
I've tried 3 different ways Claude suggested for using IMAP and none of them worked. It gave a few outdated configuration steps too.
I had to recode the IMAP part to isolate the problem and only then started making progress in troubleshooting. Claude initially gave me the IMAP implementation without using OAuth. I had to tell it that the email client Thunderbird was able to use IMAP with Hotmail. Only then it started "thinking" about what it missed instead of looping me over the same troubleshooting steps.
Then we found SSL certificates on macOS were a problem and Claude gave me commands to fix it.
Claude ended up giving me an alternative that I haven't heard before: use Microsoft Graph API with Azure and OAuth (no more IMAP) to read email from Hotmail. Claude gave me a bunch of wrong OAuth scopes and Tenant Ids but after some iterations, the solution worked surprisingly well.
The AI summarization was failing and there was no visibility on where so I had to instrument the code to report that issue better before fixing it.
Claude made a confusion of ConfigParser vs Dict methods that I had to tell it explicitly what did and what didn't work so it wouldn't try the same thing again.
The entire process required several iterations and starting a new chat to get Claude out of a rut.
After a few hours, the tool works, but it did require a lot of intervention and knowing where to look in the code/configuration.

