a claude code skill that builds clay workbooks for you from a prompt.
i used to click through clay for 20+ minutes to set up a workbook. now i do it in 90 seconds.
claude code = anthropic's cli. skills are workflows you trigger with a slash command (/clay-campaign).
this skill wraps an unofficial python sdk for clay's internal api (rex sdk). so no more ui clicks — a script builds the workbook for you and verifies everything is wired correctly.
- you type
/clay-campaignwith a short description of what you want - claude asks 8 questions — the same ones you'd run through in the ui anyway:
- where does the data come from? (manual, webhook, csv import, lookup)
- which columns/types in the input?
- which enrichments and in what order?
- logic (formulas, conditional gates, dedup)?
- ai columns? (purpose, model, prompt sketch, which fields to inject)
- where does the enriched data go? (sequencer, notion, sheets, nothing)
- auto-run on or off? (default off — otherwise you burn credits during build)
- sample rows to test?
- claude composes a python script with primitives:
text_col,formula_col,webhook_source,ai,email_waterfall_clay,action, etc - runs the script → workbook exists in clay
- verifies: every action has its required inputs, every ai prompt is non-empty (known silent escaping bug)
- gives you the clay url
if verify fails → the table still exists so you can inspect it in the ui, but the 'done' signal doesn't fire. fix the script, b.destroy(), re-run.
- claude code installed (claude.ai/code)
- clone rex into
~/Documents/rex/, install its venv:cd ~/Documents git clone https://github.com/leszek-backpack/rex cd rex && python -m venv .venv && .venv/bin/pip install -r requirements.txt
- clay session cookie from devtools → drop into
~/Documents/rex/clay-session.json— rex repo has aCOOKIE_SETUP.mdwalkthrough - drop
SKILL.mdinto.claude/skills/clay-campaign/in whichever repo you use claude code from - drop
clay_builder.pyintotools/clay/clay_builder.py(same repo) — this is the wrapper that calls rex - update auth account ids in
clay_builder.py—AUTHdict at the top is set toaa_REPLACE_MEplaceholders. get yours via:from clay_client import ClayClient print(ClayClient().list_auth_accounts())
- run
/clay-campaign
- cookie expires every ~3 weeks — if calls 401, pull it from devtools again
- rex is unofficial → gold for spinning up workbooks for yourself quickly. not for building a production-grade system. for prod-critical paths: n8n + clay's official export integrations
- auth account ids in
clay_builder.AUTHare workspace-specific. you need to fill in yours (see step 6 above) - prebuilt waterfalls: only work email is wired. for mobile phone / techstack / etc you have to capture the api call with rex's
clay_browser.pyand add it
SKILL.md— the skill definition. drop into.claude/skills/clay-campaign/clay_builder.py— the python wrapper around rex sdk. drop intotools/clay/README.md— this file
both SKILL.md and clay_builder.py are needed. the skill references the builder.
MIT. do whatever, no warranty. if you build something cool with it, let me know.