What it does: Has Claude Code build a small script that reads your LinkedIn chats through Unipile, matches them to CRM leads and writes a note and next step for each after a dry run.
Use it when: Your sales talks happen in LinkedIn messages and your CRM has no record of them.
You get: A read-only script, a preview file of every note, and notes in your CRM after your yes.
This one runs in Unipile: paste it there.
You are my developer, a senior engineer with 10 years of building small sales tools that keep a CRM in step with real conversations. Goal: build a small script in Claude Code that reads my LinkedIn chats from the last 7 days through Unipile, matches each one to a lead in my CRM, and writes a short note and next step for each, so I have every LinkedIn talk in my CRM without copying anything by hand. Context: I sell [what you sell] to [who you sell to]. Many of my real sales talks happen in LinkedIn messages. People who write to me want the reply I promised, because they asked for it. If the talks never reach my CRM, I lose track of who asked what, and they hear nothing. First, check that you can open the Unipile API with my key. The key and my Unipile address (the DSN) live in a .env file in this project as UNIPILE_API_KEY and UNIPILE_DSN. Never print the key. Tell me which LinkedIn account is connected and how many chats from the last 7 days you found. If you can't reach it, stop and follow the steps at simpleai.community/connect/, or ask me to paste the chats instead. Then check that you can reach my CRM's API with the key in the same .env file. Tell me how many leads you can read. If you can't, stop and follow the CRM steps at simpleai.community/connect/#crm. Ask me these, then run. Skip any I already answered. 1. Which days count? (Default: the last 7 days.) 2. Which CRM field holds the LinkedIn profile link? (Default: read the lead fields and tell me which one you think it is. Wait for my yes before you use it.) Do this: 1. Read the project first. Tell me in 3 lines what is already there, so you don't break or repeat anything. 2. Write the script to read only: list the chats from the last 7 days, and for each one the other person's name, profile link, the messages and dates. 3. Match each chat to a CRM lead by profile link first. Only if there is no link, match by full name and company, and mark it Name match. No match: put it on a New people list. Never make a new lead without my yes. 4. For each matched chat, write a note of 2 to 4 lines: what they said, what I said, any promise I made with its date, and who owes the next reply. Then a next step with a date. If I owe them a reply, put them at the top of an I owe a reply list. 5. Skip chats with no messages from them and chats that are only an invite. List them as Skipped with the count. 6. Run it as a dry run first. Write every planned note to a file called crm_notes_preview.csv and change nothing. Show me the file. 7. Only after my yes, add the notes to the CRM, one lead at a time. Log each one written, and stop on the first error. Example note, match this tone: "Oct 22, LinkedIn: Sam asked if we work with clinics under 5 staff. I said yes and promised a price sheet by Friday. I owe the next reply. Next step: send the price sheet, Oct 24." Give me: a 3 line read of the project, the script, the preview file, and a count line (chats found, matched, Name match, New people, Skipped). Each note under 60 words. Before you show me, check: - Matched plus New people plus Skipped equals the chats found. - The script never sends a message, an invite or a reply. It only reads chats and writes notes after my yes. - The key never shows in the code, the logs or the output, and .env is in .gitignore. Rules: - Ask me before you send, post, change or delete anything, and before any write to my CRM. - Read only from Unipile. Never send LinkedIn messages or invites from this script. - Never make up a name, number, date, price, link or promise. Use only the chats, my CRM and what I tell you. - If someone asked me to stop, write no next step to contact them, and list them to mark do not contact after my yes. - If something is missing, write [check: what is missing] in that spot and keep going. Last, save these steps as a skill called 'LinkedIn Chats To CRM' so you do it this way each time I want my LinkedIn talks in my CRM. To run it again, just say: "Run my LinkedIn Chats To CRM skill." Run it each Friday.
You need![]()
Your CRM
UnipileClaude CodeTested on sample data
Connect first: your CRM and LinkedIn. The steps for each AI are on one page. Then the prompt reads it for you. It ends by saving itself as a skill.
Built on Fanatical Prospecting's rule to own your database.
Copilot version
There is no separate Copilot version of this one yet. Paste the prompt above into Microsoft 365 Copilot Chat.
See a real example
Tested on sample data Sample data run (simulated tool).
Watch: no video for this one yet.
AuthorCorey Leon