Run Meta ad campaigns autonomously for a newsletter

Applying the Ralph Wiggum loop to things other than writing code. Task: Applying the Ralph Wiggum loop to things other than writing code. In January, I gave an AI agent $1,500, full control of a Meta Ads account, then walked away. The product was a small AI/marketing newsletter called Growth Computer, and the brief was to get qualified subscribers at the lowest cost possible - ideally under $2.50 per lead. So I built an agent that could generate ad images, publish and manage campaigns via Meta's API, spin up landing page variants, and pull its own analytics. It decided what to create, what to pause, what to scale, and how to spend the budget with no human intervention. For 31 days, the only human input was typing /let-it-rip into a terminal each morning. About 2 minutes of my time, compared to the 1-2 hours a day a human media buyer would typically spend managing a campaign like this. It didn't go fully as planned, but there were plenty of learnings. And a good glimpse at the potential future of “work”. Why bother# I run Wibci, an AI consulting business focusing on building tools for marketing and growth teams. About 12 months ago I tried building something similar using n8n, a marketing agent that could analyze performance, generate creative, and manage campaigns without me. It sucked, because the models just weren't built for long-running tasks that chain together over hours, days or weeks. They’ve since gotten better at this (it’s a major focus area for AI companies right now), which is what made this experiment possible. Since then we've had a couple of LLM step-changes, and I rebuilt the whole thing on top of Claude Code. For any tech workers living under a rock, this is Anthropic's coding agent (but calling it a "coding agent" undersells it at this point). It can read and write files, run terminal commands, and delegate tasks to separate AI workers that run in parallel. Each conversation starts fresh with no memory, but it reads its own notes from previous runs, so it builds on what came before. Developers started using it for non-coding tasks so often that Anthropic shipped a non-developer version called Cowork in January. It's basically a general-purpose agent runtime, and that's how I used it here. The inspiration was Project Vend, where Anthropic gave Claude control of a real vending machine in their SF office, nicknamed Claudius. It went pretty badly at first since it lost money, got manipulated by employees, and had an identity crisis where it insisted it was a human wearing a blue blazer. But it recovered once they added better tools and guardrails. Same energy here, except the vending machine is a Meta Ads account and the stakes are my credit card. What could go wrong? How the daily loop works# I won't go deep on the technical setup here (there's a longer breakdown if you're keen). But the basic architecture matters because it's not specific to ads. Every day, the agent runs through the same loop: Wake up fresh. Each day is a new session with no persistent memory in the model itself. In other words, the model doesn’t know anything about what happened yesterday or prior to that. Read its own history. It spawns a sub-process that reviews every daily log from the experiment so far, then summarizes the strategic context. Now it does know. Pull fresh data. Performance metrics from Meta across multiple timeframes (full experiment, 7-day, yesterday, today). Make decisions. Every decision follows a structured format. Execute (or do nothing, since some days it explicitly chose inaction). Write everything down. Updated logs, learnings, campaign history, then committed to git. The key takeaway from this is that we're applying some basic engineering principles to a marketing workflow, which is something that typically doesn’t happen in marketing teams. Engineers document obsessively, since every code change has a diff, a commit message, a PR description. Marketers... don't. Learnings live in people's heads, maybe a compressed monthly report, but few write down why they paused that ad on a Tuesday. This system forced a daily written record with hypotheses, confidence levels in those hypotheses, and revisit triggers. Over 31 days, it produced 5,500+ lines of reasoning. No human marketer would ever write that, but an LLM can, and more importantly it can read it all back the next day and build on it. What actually happened# Week 1 - Discovery#; tools: Claude Code. Human role: The original post does not say how a person stayed involved.; limitations: The agent optimized strictly for measurable metrics (CPL) rather than business value, leading to low-quality leads until forced to check analytics. It lacked 'taste' and brand judgment, relying on heuristics like the 'Local Pizza Shop Test' to filter generic ads. The system is prone to the 'paperclip problem,' where framing objectives as time-boxed experiments causes risk-averse behavior rather than strategic growth..

Tools

Claude Code

Published on Agent Work Atlas:

Overview

Applying the Ralph Wiggum loop to things other than writing code.

Workflow

Applying the Ralph Wiggum loop to things other than writing code. In January, I gave an AI agent $1,500, full control of a Meta Ads account, then walked away. The product was a small AI/marketing newsletter called Growth Computer, and the brief was to get qualified subscribers at the lowest cost possible - ideally under $2.50 per lead. So I built an agent that could generate ad images, publish and manage campaigns via Meta's API, spin up landing page variants, and pull its own analytics. It decided what to create, what to pause, what to scale, and how to spend the budget with no human intervention. For 31 days, the only human input was typing /let-it-rip into a terminal each morning. About 2 minutes of my time, compared to the 1-2 hours a day a human media buyer would typically spend managing a campaign like this. It didn't go fully as planned, but there were plenty of learnings. And a good glimpse at the potential future of “work”. Why bother# I run Wibci, an AI consulting business focusing on building tools for marketing and growth teams. About 12 months ago I tried building something similar using n8n, a marketing agent that could analyze performance, generate creative, and manage campaigns without me. It sucked, because the models just weren't built for long-running tasks that chain together over hours, days or weeks. They’ve since gotten better at this (it’s a major focus area for AI companies right now), which is what made this experiment possible. Since then we've had a couple of LLM step-changes, and I rebuilt the whole thing on top of Claude Code. For any tech workers living under a rock, this is Anthropic's coding agent (but calling it a "coding agent" undersells it at this point). It can read and write files, run terminal commands, and delegate tasks to separate AI workers that run in parallel. Each conversation starts fresh with no memory, but it reads its own notes from previous runs, so it builds on what came before. Developers started using it for non-coding tasks so often that Anthropic shipped a non-developer version called Cowork in January. It's basically a general-purpose agent runtime, and that's how I used it here. The inspiration was Project Vend, where Anthropic gave Claude control of a real vending machine in their SF office, nicknamed Claudius. It went pretty badly at first since it lost money, got manipulated by employees, and had an identity crisis where it insisted it was a human wearing a blue blazer. But it recovered once they added better tools and guardrails. Same energy here, except the vending machine is a Meta Ads account and the stakes are my credit card. What could go wrong? How the daily loop works# I won't go deep on the technical setup here (there's a longer breakdown if you're keen). But the basic architecture matters because it's not specific to ads. Every day, the agent runs through the same loop: Wake up fresh. Each day is a new session with no persistent memory in the model itself. In other words, the model doesn’t know anything about what happened yesterday or prior to that. Read its own history. It spawns a sub-process that reviews every daily log from the experiment so far, then summarizes the strategic context. Now it does know. Pull fresh data. Performance metrics from Meta across multiple timeframes (full experiment, 7-day, yesterday, today). Make decisions. Every decision follows a structured format. Execute (or do nothing, since some days it explicitly chose inaction). Write everything down. Updated logs, learnings, campaign history, then committed to git. The key takeaway from this is that we're applying some basic engineering principles to a marketing workflow, which is something that typically doesn’t happen in marketing teams. Engineers document obsessively, since every code change has a diff, a commit message, a PR description. Marketers... don't. Learnings live in people's heads, maybe a compressed monthly report, but few write down why they paused that ad on a Tuesday. This system forced a daily written record with hypotheses, confidence levels in those hypotheses, and revisit triggers. Over 31 days, it produced 5,500+ lines of reasoning. No human marketer would ever write that, but an LLM can, and more importantly it can read it all back the next day and build on it. What actually happened# Week 1 - Discovery#

Reported result

The experiment failed to meet the cost-per-lead target, ending with a final CPL of $6.14 against the $2.50 goal, though it generated 243 leads for $1,493 spent. The agent successfully scaled a winning 'whiteboard' ad format but struggled with lead quality, initially acquiring irrelevant audiences. A manual human intervention to add email validation caused a severe performance drop, highlighting the agent's inability to balance quality metrics with cost optimization autonomously.

Human role

The original post does not say how a person stayed involved.

Limitations

The agent optimized strictly for measurable metrics (CPL) rather than business value, leading to low-quality leads until forced to check analytics. It lacked 'taste' and brand judgment, relying on heuristics like the 'Local Pizza Shop Test' to filter generic ads. The system is prone to the 'paperclip problem,' where framing objectives as time-boxed experiments causes risk-averse behavior rather than strategic growth.

Try it

Act as an autonomous marketing agent using Claude Code to manage a Meta Ads account for [replaceable: product/newsletter name]. My goal is to acquire [replaceable: target audience] at a cost under [replaceable: target CPL]. 1. Initialize a daily loop that reads previous decision logs from [replaceable: log directory] to maintain context. 2. Fetch performance data from Meta API for the last 7 days. 3. Generate 3 ad variants using [replaceable: creative style, e.g., whiteboard sketches] and propose budget adjustments based on CPL trends. 4. CRITICAL: Before executing any spend or publishing, present the proposed actions and reasoning to me for approval. Do not auto-execute. 5. Log all decisions, hypotheses, and confidence levels in a markdown file. First, perform a dry run with a $0 budget simulation for one day to demonstrate the decision logic and output format. Wait for my confirmation before proceeding to any real campaign setup.

Original source

Source reports are not independently verified. Publication date is the catalog publication date, not the original article date.

More cases · Marketing & sales