How to run Meta ads from Claude Code
Claude Code turns a product list into finished Feed, Stories and Reels ads saved as files in your project, edits the video on your own machine, and creates the Meta campaign paused until you say go.
By Grace Kong·Updated ·8 min read
Batch Meta ads from your agent
TL;DR
Setup is one claude mcp add command, a CLAUDE.md with your Meta rules, and an ask rule on Hypesonic's paid run tool so every paid call stops for a yes.
The Meta playbooks need a shell (ffmpeg for captions and the cut, a browser to set headlines in your fonts), which Claude Code has. Making a Reel costs about $4 to $15 at 480p, a static ad about $0.20 to $0.75.
Feed ads are 4:5 at 1440 x 1800; Reels and Stories are 9:16 at 1440 x 2560 with the top 14% and bottom 35% kept clear (Meta Ads Guide).
A cloud scheduled task can pull results every Monday and draft new hooks with your laptop closed, using your claude.ai connectors rather than servers added in the terminal.
Set up Claude Code for Meta ads
One command adds Hypesonic; CLAUDE.md carries the Meta rules Claude should follow on every run.
Open a terminal in the folder where you keep your ad work (a git repo is ideal, so every batch is versioned) and run:
claude mcp add --transport http hypesonic https://www.hypesonic.com/mcp
Restart Claude Code and sign in when the browser opens. Do it once in an interactive session: a claude -p run cannot finish the sign-in (Claude Code docs). Add --scope user to use Hypesonic in every project. You sign in to your Meta ad account through Hypesonic too, with no developer app of your own. Full setup: hypesonic.com/agents/claude-code.
Then put the standing rules in CLAUDE.md at the top of the folder. Claude reads it at the start of every session there, so you stop repeating yourself:
# Meta ads
- Ad account: Ember US (act_1234567890), USD. Optimize for Purchase.
- Name campaigns {product}_{angle}_{yyyy-mm}; ads {placement}_{hook}.
- Feed 4:5 at 1440x1800. Reels and Stories 9:16 at 1440x2560,
nothing in the top 14% or bottom 35%.
- Prices and offers come from the live site, never from memory.
- Save ads to ads/meta/{yyyy-mm}/{product}/ with a manifest.csv.
- Quote every paid run (estimate: true) and wait for my yes.
- New campaigns launch paused.To make every paid call stop for an explicit yes, add "ask": ["mcp__hypesonic__run"] under permissions in .claude/settings.json. Claude Code names MCP tools mcp__<server>__<tool>, so the rule covers only Hypesonic's paid tool (permissions docs).
The command: one prompt, or a skill you rerun
Type the job in plain words, then save it as a skill so next month's batch is one slash command.
Start claude in the folder and describe the job. Name the input file, the output folder, the budget and what has to wait for you:
Read products.csv. For the 3 products with the highest margin, make 4 static ads and 2 Reels each from their product pages. Save them under ads/meta/2026-12/. Then build one campaign per product at $60 a day, paused, and show me the quote first.
When the batch works, save the steps as a skill. Skills live in .claude/skills/<name>/SKILL.md, load only when used, and take arguments through $ARGUMENTS (skills docs):
.claude/skills/meta-batch/SKILL.md --- name: meta-batch description: Make and launch a batch of Meta ads for one product page argument-hint: [product-url] [daily-budget] disable-model-invocation: true --- Make Meta ads for $ARGUMENTS, following CLAUDE.md. 1. Find the Hypesonic playbooks for static and video Meta ads and follow them. 2. Show one line per ad (idea, format, hook) before anything is paid for. 3. Quote, wait for my yes, then make the ads and save them with the manifest. 4. Create the Meta campaign through Hypesonic, paused, and print its IDs.
Next month: /meta-batch https://yourshop.com/products/candle-trio 60.
What Claude Code does, step by step
It follows Hypesonic's Meta playbooks, quotes before it pays, and does the video edit on your machine.
- Reads your files. CLAUDE.md, products.csv and, if you add it, last month's Ads Manager export, so it knows which hooks already won.
- Finds the recipe.
playbook_searchreturnsmeta-static-adsandmeta-video-ads;playbook_getloads the steps. Both list "an agent with a shell" as a requirement: the video edit, captions and end card run through ffmpeg, and static headlines are set in your brand's fonts in a browser. Claude Code has that shell. - Learns the brand. It reads each product page, collects real product photos and sends them with
asset_upload, so the product in the ad is the real one. - Shows the plan. One line per ad: idea, format, hook. You cut weak ideas before they cost anything.
- Quotes.
runwithestimate: trueprices the batch. With your yes, oneruncall starts up to 12 requests, each with anidempotency_keyso a retry never pays twice. - Collects and edits.
run_waitwaits up to 45 seconds per call (video takes a few minutes). Claude downloads the takes, burns in captions, adds the end card and masters audio to about -14 LUFS (loudness units relative to full scale) for phones, as the playbook says. - Checks. Ratio, pixel size and safe zones against Meta's guide; a transcript of every Reel against its script.
- Launches. It creates the campaigns, ad sets and ads in your Meta account through Hypesonic, shows the structure and daily budgets, and keeps them paused until you say go.
What you get back
Files you own, a manifest that ties each file to its run, and campaign IDs.
ads/meta/2026-12/
candle-trio/
feed_4x5_gift-angle.png
stories_9x16_gift-angle.png
reels_9x16_selfie-hook.mp4
manifest.csv (ad name, angle, hook, placement, file, run id)
launch.json (campaign, ad set and ad IDs, status)Ask for a spend line at the end: spend_get reports what the batch cost by model, and a budget_tag on each run keeps this batch separate from the next. Expect about $0.20 to $0.75 per static ad and $4 to $15 per Reel at 480p: the model's price plus a 10% markup, and failed runs cost nothing.
Meta numbers to build around
Size, text and timing limits decide whether a batch passes review on the first try.
| Item | Limit or benchmark |
|---|---|
| Feed image or video | 4:5 at 1440 x 1800 px |
| Stories and Reels | 9:16 at 1440 x 2560 px; text clear of the top 14%, bottom 35% and 6% each side |
| File limits | Images JPG or PNG up to 30 MB; video MP4, MOV or GIF up to 4 GB |
| Facebook Feed headline | 27 characters |
| Starting budget Meta suggests | At least $5, over at least 7 days |
| Daily budget swing | Up to 75% over on a given day, never more than 7 times the daily budget in a week |
| Review | Most ads within 24 hours |
| Learning phase | About 50 results per ad set in a week |
| US cost per 1,000 views | $20.85 in November 2026, up from $18.20 in October |
Sources: Meta Ads Guide, image, video, Reels safe zones, Facebook Feed, Meta pricing, ads in review, learning phase, Birch and Shopify citing Birch.
At $20.85 per 1,000 views, a $60 daily budget buys about 86,300 views a month (our math). If you optimize for leads at the $27.39 average cost per lead (LocaliQ), reaching 50 a week takes about $196 a day per ad set (our math), so small budgets should optimize for a cheaper event while they test.
Run it every week without opening a terminal
A cloud scheduled task can pull results and draft replacements while your laptop is closed.
/schedule every Monday at 8am: pull last week's Meta results from Hypesonic, list the 5 ads with the worst cost per purchase, draft 3 new hooks for each, quote them and post the list. Do not launch or buy anything.
- Cloud scheduled tasks run on Anthropic's servers on Pro, Max, Ultra, Team and Enterprise plans, at most once an hour, and are still in research preview (docs).
- They use the connectors on your claude.ai account, not servers added with
claude mcp add. Add Hypesonic at claude.ai/customize/connectors, or commit it to the repo's.mcp.json. - Runs use auto mode for permissions by default, so write "do not buy" into the prompt and keep launches for a session where you are watching.
- For a check every few minutes during a launch day,
/loop 30mrepeats a prompt inside an open session; those loops end after 30 days (docs).
What Claude Code is best and worst at for Meta
It wins on volume, files and repeat runs; it is weaker when people who don't use a terminal need to review.
| Strong | Weak |
|---|---|
| Big batches from a spreadsheet. Anthropic's growth team used Claude Code to read CSVs of hundreds of ads, find underperformers and write new variants within character limits in minutes (Anthropic). | Looking at creative. A terminal shows file names, not pictures; ask for an HTML contact sheet and open it in a browser. |
| Files and history. Every ad, manifest and launch record sits in git. | Sharing with teammates who don't code. The Claude app's artifacts are easier for review. |
| Video finishing. The shell runs ffmpeg for captions, end cards and loudness. | Unattended runs. claude -p cannot complete OAuth, so sign in interactively first. |
| Rules that stick: CLAUDE.md, skills and permission rules apply every run. | Account diagnostics inside Ads Manager. Meta's own Ads MCP covers more reporting tools. |
Questions
Can Claude Code run Facebook ads?
Yes. With the Hypesonic MCP added, Claude Code makes the images and videos, saves them in your project and creates the campaign, ad sets and ads in your Meta account once you approve the quote.
Do I also need Meta's official Ads MCP?
Not to launch. Meta's server, in open beta since April 29, 2026, is useful for deep reporting and diagnostics on existing campaigns, and it creates everything paused. You can add both servers to Claude Code.
Can Claude Code read my Ads Manager export?
Yes. Export a CSV, drop it in the project folder and name it in your prompt. Claude ranks past ads by cost per result and uses the winning hooks as the starting point for new ones.
Will it spend money without asking?
No. Hypesonic quotes every paid run first, and an ask rule on mcp__hypesonic__run in .claude/settings.json makes Claude Code stop for your yes on every paid call.
How long until the ads are live?
Making a batch takes minutes for statics and a few minutes per video. Meta then reviews most ads within 24 hours.
Sources
- 1Claude Code docs, Connect to tools via MCP · accessed Nov 30, 2026
- 2Claude Code docs, Extend Claude with skills · accessed Nov 30, 2026
- 3Claude Code docs, Configure permissions · accessed Nov 30, 2026
- 4Claude Code docs, Automate work with scheduled tasks · accessed Nov 30, 2026
- 5Claude Code docs, Run prompts on a schedule · accessed Nov 30, 2026
- 6Anthropic, How Anthropic teams use Claude Code · Jul 24, 2025
- 7Meta Ads Guide, image ads · checked Nov 30, 2026
- 8Meta Ads Guide, video ads · checked Nov 30, 2026
- 9Meta Ads Guide, Instagram Reels video · checked Nov 30, 2026
- 10Meta Ads Guide, Facebook Feed image · checked Nov 30, 2026
- 11Meta, ad pricing · accessed Nov 30, 2026
- 12Meta Business Help Center, About ads in review · accessed Nov 30, 2026
- 13Meta Business Help Center, About the learning phase · accessed Nov 30, 2026
- 14Birch, Facebook advertising costs · Nov 2026
- 15Shopify, how much do Facebook ads cost (Birch data) · Nov 2026
- 16LocaliQ, Facebook advertising benchmarks · Sep 2026
- 17Meta, Ads MCP server · accessed Nov 30, 2026
Batch Meta ads from your agent
Keep reading
- GuidesCan Claude run your Meta ads? Yes, here is howRead
- GuidesHow to make UGC video ads with Claude CodeRead
- GuidesHow to run TikTok ads from Claude CodeRead
- IntegrationsClaude for advertising: what it can do and how to set it upRead
- IntegrationsMeta Ads MCP: what Meta's official server can and can't doRead
- Ad specsWhat are the Meta ad specs for every placement?Read
- CostsHow much do Facebook ads cost in 2026?Read
- IntegrationsHow to connect the Hypesonic MCP to your AI agentRead