Terminal
Terminal/Skill
Finds duplicate contacts in a CSV or CRM list and proposes which record to keep, with the evidence for each decision, without merging anything.
By Clay
Works with
npx skills add clay-run/clay-skill-creator --skill dedupe-contactsThe insight: a duplicate is a claim that needs evidence, and a merge is a destructive act. An email or identifier match is near-certain; a name+company match is only a candidate until a second signal corroborates it. Exact company matching misses ~40% of true duplicates — companies carry many domains (regional TLDs, acquisitions, rebrands) — so anchors must be alias-expanded first. And a merged record must be ONE person's coherent state: mixing conflicting fields across records fabricates a person who never existed. Clay's catalog contains no merge or delete executor — Clay flags, a human merges. This skill outputs a merge plan with per-decision evidence and executes nothing.
Nothing here ships with a value. Each one is the installer's, not the author's: ask for it, never substitute a plausible default, and where an answer does not exist say which step becomes unavailable rather than guessing. Where a default IS defensible it is named below, and using it means saying so in the output.
| Input | What the installer supplies | If it is missing |
|---|---|---|
| The contact list | a CSV, a table, or a CRM object pulled out first | no default — never dedupe a CRM blind |
| Which fields exist | email, name, company or domain, plus tiebreakers: created date, owner, profile URL, phone, opportunities | ask. Fewer fields means fewer match layers, not a failed run |
| Domain knowledge | parent and canonical domains, acquisitions, rebrands | this is the seed of the alias map. Without it, one company reads as several |
| Where merges execute | native CRM merge, a merge tool, or by hand | ask. This skill produces the merge plan; executing it is theirs |
If an answer sheet is present beside this skill, load it and ask only for what it does not cover. A partial sheet is normal; a value it is missing gets asked for on its own rather than restarting the interview. Say which values came from the sheet before using them — a sheet applied silently is a wrong field nobody catches. If there is no sheet, say nothing about sheets — the check is a file lookup, not a question, so run the interview as though the feature did not exist rather than reporting an absence. At delivery, offer to save the answers back (identifiers only — never a token or a password), private and never published — and phrase the offer so it explains itself: "want me to save your answers to a file, so the next person on your team doesn't have to answer these again?"
Run clay whoami; echo "exit_code=$?". If it fails or Clay tools are missing, run
the Clay plugin's setup skill and re-run. Say which workspace you're in. (A local
CSV dedupe costs zero credits; Clay serves only the table/CRM arms.)
A full CRM cleanup runs dedupe FIRST: dedupe → hierarchy repair → field backfill — repairing fields on records about to merge is wasted spend.
In code, never an LLM:
+tag; fold local-part dots ONLY on dot-insensitive
providers (Gmail) — corporate mail treats a.b ≠ ab.Inside a Clay table the same transforms exist as free catalog actions
(clay-normalize-first-and-last-names, normalize-company-name, normalize-url).
Per distinct domain, build an alias set with provenance, strongest first:
kirivale.com ↔ kirivale.co.uk).
An ordinary anchor — the L3 pair still needs its second signal, as always.Survivor per group by a deterministic 5-rule ladder — first rule that discriminates wins:
Merge semantics — the distinction that keeps records coherent:
A merge plan: group · survivor (id) · merged records (ids) · layer (L1/L2/L2-id/L3) · evidence (incl. alias derivation) · confidence · ladder rule · field conflicts, a
review list (candidates + AI-alias pairs), a do-not-merge list (collisions,
with conflicting evidence), and a summary line: N in → S survivors, M merged, R review pairs, C do-not-merge pairs.
Ask: "Dedupe this 14-row export; we acquired BrandX last year." L1 catches
Ana.Ruiz@northfield.example = ana.ruiz@northfield.example; L2-id merges Maria Santos /
Maria Lee on one LinkedIn URL. Alias pass: Priya Nair / kirivale.com merges with
P. Nair / kirivale.co.uk (label family + same phone); Chris Doyle / brandx.example with
Chris Doyle / acme-corp.example (acquisition map); an AI-suggested alias pair stays in
review. Ana's survivor wins on rule 2 (open opportunity); her title conflict
(Manager vs Director) is recorded — the survivor's Manager ships, the loser's
phone fills her empty phone field. Summary: 14 in → 9 survivors, 5 merged, 1 review pair, 0 do-not-merge pairs. No writes; the plan goes to the CRM merge screen.