Claude Code for Google & Meta Ads: Agent Setup (2026)
Adspirer Team
This is the hands-on guide to using Claude Code for Google Ads and Meta Ads. You will install the Adspirer plugin, create a versioned brand workspace with CLAUDE.md and STRATEGY.md, define safety rules, run a cross-platform audit, and build campaigns paused for review. The focus is repeatable terminal workflows—not the lighter connector setup used in Claude Chat or Desktop.
If you have used Claude Code for software development, the working model will feel familiar: it reads the files you authorize, calls tools, and carries out multi-step tasks in a terminal workspace. This guide applies that model to paid media management—specifically the Google Ads and Meta Ads jobs that benefit from durable instructions and reviewable files.
Adspirer is a hosted MCP server that gives Claude Code access to advertising tools across Google Ads, Meta Ads, Amazon Ads, ChatGPT Ads, LinkedIn Ads, and TikTok Ads. In this setup Claude Code can gather performance evidence, draft files, and prepare account changes. “Autonomous” should describe the multi-step execution—not permission to change live spend without a review boundary.
This guide focuses on the Google Ads + Meta Ads workflow. It’s more setup than connecting ChatGPT to the Adspirer plugin — but it’s meaningfully more powerful for automation. You define the rules once; Claude Code executes them on a schedule.
Use this guide for Claude Code + Google Ads/Meta Ads in a terminal workspace. For a quick conversation in Claude web or Desktop, use connect Claude to Google Ads or connect Claude to Meta Ads. For a visual project that creates reports and recurring deliverables, use Claude Cowork for marketers.
This guide is part of the Claude Code agent setup series.
- How to Build an AI Marketing Agent for Paid Media — The concept and why it matters
- How to Set Up Your AI Marketing Agent with Claude Code — Full agent architecture, sub-agents, memory system
- How to Set Up Your AI Marketing Agent with Codex — The OpenAI Codex equivalent
- This post: Running Google Ads and Meta campaigns from Claude Code CLI
Prerequisites
Before starting, make sure you have all four of the following:
- Claude Code CLI installed and working. Anthropic currently recommends its native installer, with Homebrew, WinGet, package-manager, and npm options also documented. See the Claude Code installation guide.
- Claude Code access through a Pro, Max, Team, or Enterprise subscription, a Claude Console account, or a supported cloud provider.
- Adspirer account with at least one ad account connected. Create a free account →
- Google Ads and/or Meta Ads account connected inside Adspirer. You’ll do this during Step 2.
You can use this guide with Google Ads only, Meta Ads only, or both connected simultaneously. The cross-platform comparison features require at least one account on each platform.
Step 1: Install the Adspirer Plugin
Open Claude Code and type this directly into the input bar (not as a prompt to the AI):
/plugin install adspirer-advertising-agent@adspirer-marketplaceOr browse for it: type /plugin, switch to the Discover tab, search for “Ads”, and select adspirer-advertising-agent from adspirer-marketplace.
After installation, reload plugins to activate:
/reload-pluginsThis single install sets up everything needed to manage ads from Claude Code:
| Component | Location | Purpose |
|---|---|---|
| MCP Server | Plugin config | Connects Claude Code to Adspirer’s 400+ advertising tools across six platforms via OAuth 2.1 |
| Sub-Agent | ~/.claude/agents/performance-marketing-agent.md | Defines the agent’s behavior, brand context loading, and workflow patterns |
| Skill | ~/.claude/skills/ad-campaign-management/SKILL.md | Proven tool sequences for each task type across all platforms |
| 5 Slash Commands | ~/.claude/commands/*.md | Quick-access commands for setup, performance review, waste audit, copy writing, and refresh |
Plugin contents and file locations can change as Claude Code and the Adspirer plugin evolve. Verify the current install receipt and Adspirer setup documentation in your environment.
The /plugin and /reload-plugins commands must be typed directly into Claude Code’s input bar — they are user commands, not prompts for the AI. If you ask the AI to run them, you’ll get a “nested session” error.
The plugin is the only supported way to connect Adspirer to Claude Code — it bundles the MCP server, sub-agent, skill, and slash commands in a single install. (The older manual claude mcp add flow has been retired.) See the Claude Code setup documentation for details.
Step 2: Connect Your Ad Accounts
After installing the plugin, authenticate with Adspirer. Type in the Claude Code input bar:
/mcpFind plugin:adspirer-ads-agent:adspirer MCP Server in the list and select Authenticate. A browser window opens where you:
- Sign in to your Adspirer account (or create one)
- Connect your Google Ads account via OAuth
- Connect your Meta Ads account via OAuth
Both connections use OAuth 2.1 with PKCE. Your ad credentials are never stored locally — Adspirer handles all platform authentication server-side. You can revoke access anytime from your Adspirer dashboard. See the security documentation for the full security model.
After authenticating, run /mcp again to verify. The Adspirer server should show as connected with tools listed.
Step 3: Create Your Brand Workspace
Navigate to the folder where you keep your brand’s marketing files, then launch Claude Code:
cd ~/Clients/YourBrand # wherever your brand docs liveclaudeRun the setup command:
/adspirer:setupWhat Happens During Setup
Scans Your Local Files
The agent reads brand documents in your folder — .md, .txt, .csv, .pdf, .yaml, .json files. Brand guidelines, media plans, audience research, competitor notes — anything it finds gets absorbed into the brand context. Drop your brand docs into the folder before running setup. The more context you give it, the more relevant every future recommendation will be.
Pulls Your Ad Account Data
Calls Adspirer’s get_connections_status tool to confirm which platforms are live, then pulls account-level metadata for Google Ads and Meta Ads — account names, IDs, active campaign counts, and current status.
Pulls 30-Day Performance Baseline
Pulls the last 30 days of campaign performance across all connected platforms. This baseline is what the agent uses for anomaly detection, KPI comparisons, and future trend analysis.
Creates CLAUDE.md
Builds the brand context file — brand overview, target audiences, voice guidelines, connected platforms, budget guardrails, KPI targets, performance snapshot, and key findings from the initial data pull. Claude Code reads this file automatically at the start of every session.
Creates STRATEGY.md
Initializes the strategy playbook. Starts nearly empty but fills over time with confirmed strategic directives: AVOID/PREFER/CONSTRAINT rules per platform — for example, “AVOID broad match on branded Google Ads campaigns” or “PREFER Reels placements on Meta for prospecting audiences.” Directives are only written to this file after your explicit confirmation.
Your Workspace After Setup
~/Clients/YourBrand/├── CLAUDE.md # Brand context — loaded automatically every session├── STRATEGY.md # Strategy directives — updated only with your approval├── brand-guidelines.pdf # Your existing docs└── media-plan.csv # Your existing docsWhat a Real CLAUDE.md Contains
Here’s an abbreviated example of what the agent creates for a SaaS brand:
# CLAUDE.md — CloudBase Brand Context
## Brand OverviewCloudBase sells B2B project management software for engineering teams.Industry: SaaS / Productivity. Primary market: US, Canada, UK.
## KPI Targets- Google Ads Search: Target CPA $80, Target ROAS 4.0x- Meta Ads Prospecting: Target CPL $35, Frequency cap: 3.0- Meta Ads Retargeting: Target ROAS 6.0x, Max CPM $18
## Budget Guardrails- Monthly Google Ads budget: $12,000 (never exceed without approval)- Monthly Meta Ads budget: $8,000 (never exceed without approval)- Single campaign daily budget cap: $500
## Connected Platforms- Google Ads: Account 123-456-7890 (12 active campaigns)- Meta Ads: Account 9876543210 (8 active ad sets)
## Performance Snapshot (Last 30 Days)- Google Ads: 847 conversions, avg CPA $74, ROAS 4.3x- Meta Ads: 312 leads, avg CPL $41, top creative: Video-ProductDemo-v3
## Brand VoiceProfessional but approachable. No jargon. Short sentences. Never use"leverage", "synergy", or "game-changer". Approved CTA: "Start free trial".
## Safety Rules- All new campaigns created PAUSED — never enable without human approval- Budget changes above 20% require explicit human confirmation- Never modify campaigns that have converted in the last 7 days without reviewWhat a Real STRATEGY.md Contains
# STRATEGY.md — CloudBase Ad Strategy
## Google Ads Directives- AVOID: broad match on branded keywords (causes brand cannibalization)- PREFER: exact + phrase match for high-intent keywords- CONSTRAINT: max CPC $4.00 on non-branded search terms
## Meta Ads Directives- PREFER: Advantage+ audience over manual interests for prospecting- AVOID: static image creatives in prospecting (video outperforms 2.4x)- CONSTRAINT: pause any ad set with frequency > 3.0 within 7 days
## Cross-Platform- Attribution model: Data-driven (Google), 7-day click / 1-day view (Meta)- Report comparison window: same 30-day period, not rollingStep 4: The 5 Ad Management Skills
Your agent has 5 skills covering every ad management workflow. You don’t need to memorize slash commands — describe what you need in plain language and the agent matches the right workflow. But knowing the commands makes you faster when you know exactly what you want.
| Skill | Slash Command | What It Does |
|---|---|---|
| Setup | /adspirer:setup | Bootstraps brand workspace, creates CLAUDE.md and STRATEGY.md, pulls account data |
| Performance Review | /adspirer:performance-review | Cross-platform scorecard against your KPI targets, anomaly detection, strategy drift check |
| Wasted Spend | /adspirer:wasted-spend | Finds keywords spending without converting, creatives with declining CTR, audiences with poor ROI |
| Ad Copy | /adspirer:write-ad-copy | Brand-voice ad copy using your CLAUDE.md guidelines and real performance data |
| Refresh | /adspirer:refresh-brand-context | Re-scans folder for new brand docs, pulls latest performance, updates CLAUDE.md |
Commands and bundled workflows can change between plugin versions. Use /help, inspect the installed plugin, and confirm the current Adspirer documentation before turning a command into a team process.
Step 5: Configure Safety Rules
This is the most important section of this guide. When Claude Code manages live ad spend autonomously, the safety rules you define in CLAUDE.md are your protection layer. They are not suggestions — they are constraints the agent enforces before taking any action.
Add this safety block to your CLAUDE.md before you run any write operations:
## Safety Rules (Non-Negotiable)
### What the Agent MUST NEVER Do Without Explicit Human Approval- Enable any campaign from PAUSED to ENABLED status- Increase any campaign's daily or monthly budget- Change any campaign's bidding strategy- Modify a campaign that has converted in the last 7 days- Create campaigns on platforms not listed in Connected Platforms above
### What the Agent Can Do Autonomously (Read Operations)- Pull performance data from any connected platform- Generate reports, audits, and recommendations- Identify wasted spend candidates- Research keywords and audience segments- Generate ad copy drafts
### Spending Caps — Hard Limits- No single campaign may have a daily budget above $500 without approval- No monthly platform budget may exceed the amounts in KPI Targets above- Any budget increase recommendation above 20% of current spend requires human sign-off
### Campaign Creation Rules- All new campaigns created with status: PAUSED- Include a summary of all campaigns created in the same response- Flag any campaign where estimated CPC exceeds the CPA target by 3xNever enable Claude Code’s “Full Access” mode for ad management workflows. Full Access auto-approves all tool calls including write operations. For advertising, always use Auto mode — read operations run automatically, write operations (creating campaigns, changing budgets, modifying targeting) require your explicit approval before executing. The whole value of the safety model is that the agent surfaces the recommendation and you make the final call on spend.
Claude Code’s built-in permission layer
Beyond your CLAUDE.md safety rules, Claude Code has permission modes that control local files, commands, network access, and tool calls. They do not replace Adspirer’s own write and deletion gates.
| Mode | Current behavior | Fit for connected ad accounts |
|---|---|---|
| Default | Reads run without asking; other actions prompt unless pre-approved | Recommended starting point |
| Plan | Read-only exploration and planning | Best for audits and proposed changes |
| Accept Edits | File edits and common filesystem work run without asking | Useful for report files, but review MCP permissions separately |
| Auto | Eligible actions are evaluated by background safety checks | Use only after testing account and tool boundaries |
| Bypass Permissions | Skips permission checks | Do not use with live ad accounts |
Permission modes, eligibility, and client behavior can change. Check Anthropic’s current permission-mode documentation and your workspace policy before choosing a mode.
For the first live-account workflow, use Plan or Default mode and keep Adspirer’s confirmation gates in place. Review the proposed account, object, date range, and change before approving a write. Never treat a broader Claude Code permission mode as permission to change advertising spend.
Step 6: Run Your First Performance Audit
With installation, authentication, brand workspace, and safety rules in place, run your first audit:
What Claude Code Does
After you send that prompt, Claude Code executes this sequence automatically:
Reads Your Brand Context
Loads CLAUDE.md (KPI targets, budget guardrails, brand rules), STRATEGY.md (active directives and constraints).
Verifies Platform Connections
Calls get_connections_status to confirm Google Ads and Meta Ads are active and pulls account-level metadata.
Pulls Google Ads Data
Calls Adspirer tools for campaign metrics, ad group performance, keyword data, search term report, and Quality Score indicators for the 30-day window.
Pulls Meta Ads Data
Calls Adspirer tools for campaign and ad set metrics, creative-level performance, audience segment data, frequency by ad set, and delivery insights.
Cross-References Against Targets
Compares actual CPA, ROAS, CPL, and frequency against your CLAUDE.md targets. Checks STRATEGY.md for any campaigns violating your directives — for example, a broad match keyword running on a branded campaign you explicitly prohibited.
Returns Structured Report
Delivers a prioritized action list — metrics by platform, anomalies flagged with explanations, strategy drift identified, and specific recommended actions ordered by estimated impact.
What the Output Looks Like
The agent returns a structured report covering:
- Platform scorecards — campaign-by-campaign comparison against your KPI targets, color-coded by performance vs. target
- Anomalies — any metrics outside normal range with a causal explanation (e.g., “Search Campaign #3 CPA spiked 40% — driven by 3 keywords with zero conversions in 30 days and $800 combined spend”)
- Strategy drift — any campaigns running in violation of your STRATEGY.md directives
- Wasted spend candidates — specific line items with dollar amounts and recommended action
- Top 3 actions — prioritized by estimated impact with the data reasoning for each
No dashboard tabs. No CSV exports. No spreadsheet building. From terminal prompt to structured analysis in a few minutes.
What Autonomous Mode Actually Means
“Autonomous” in Claude Code means something specific — and something more limited than the word might imply. It’s worth being direct about this.
What Claude Code Can Run Unsupervised
These are read-only operations. Claude Code can be scheduled to run these on a cron schedule without your presence:
- Pull performance data and generate reports
- Flag anomalies against your KPI targets
- Identify wasted spend candidates
- Check for strategy drift
- Generate copy drafts
- Research keywords and audience segments
What Always Requires Your Approval
These are write operations that affect live campaigns and real spend. Configure Claude Code and the Adspirer workflow to stop for approval before executing them:
- Enabling any campaign from PAUSED to LIVE
- Changing any budget (daily or monthly)
- Modifying targeting on a live ad set
- Adding or removing keywords
- Changing bidding strategies
The useful frame is not “the AI runs the account.” The agent handles evidence collection, analysis, research, drafting, and paused builds; the account owner approves the decisions that affect spend. Do not encode a percentage-of-work claim unless you have measured it for your own workflow.
Setting Up Scheduled Audits
Claude Code now offers session-scoped /loop tasks, Desktop scheduled tasks, and cloud Routines. For a durable weekly workflow, create a Routine conversationally from the CLI:
/schedule every Monday at 8am, run a read-only Google Ads and Meta Adsperformance review for the previous 7 complete days. Compare against the KPItargets in CLAUDE.md, check tracking health first, and return do now,investigate, and monitor. Do not make account changes.Review the Routine’s repositories, connectors, and permissions before saving it. Anthropic’s cloud Routines can run when your laptop is closed, while Desktop tasks can use local files on your machine. Session-scoped /loop tasks require the session to remain available and expire after a limited period.
Claude Code schedules vs Adspirer’s native Ad Ops agents
Claude Code gives you a general-purpose scheduled workspace; Adspirer attaches recurring work to the advertising operating system. The Watch Agent scans connected accounts server-side, while Ad Ops agents work toward a plain-English goal and route proposed changes into an approval queue.
The two approaches can complement each other. Use a Claude Code Routine when the task needs the files and instructions in a versioned project. Use the Adspirer-native path when the task should live beside account monitoring and approval records. In either case, inspect the connector permissions: unattended runs should not inherit broad write access by accident.
Google Ads vs Meta Ads from Claude Code
Both platforms connect through the same Adspirer MCP server, but the workflows and what the agent monitors differ by platform.
PromptBoxes: 5 Commands to Run This Week
Beyond the audit commands above, these are the five prompts that deliver the most value in the first week of using Claude Code with Adspirer:
FAQ
What’s Next
Your setup is complete: the Adspirer plugin is installed, Google Ads and Meta Ads are connected, your brand workspace is created, safety rules are configured, and your first performance audit is done.
The two highest-value next steps from here:
- Set up the weekly scheduled audit — the Monday morning prompt above. Once this runs automatically, you stop missing the Friday CPA spike that compounds over the weekend.
- Build out your STRATEGY.md — after each audit session where the agent identifies a pattern (e.g., “broad match on branded terms is cannibalizing conversions”), add a confirmed CONSTRAINT directive. Over time, this file becomes the accumulated knowledge of every insight you’ve validated.
The compounding effect is real: the more sessions you run, the more context the agent carries into the next one. Three months in, Claude Code is not starting fresh every Monday — it’s working from a complete picture of your account history, your brand constraints, and your proven strategies.
Ready to start? Sign up for Adspirer (free tier: 15 tool calls/month) and install the plugin with /plugin install adspirer-advertising-agent@adspirer-marketplace.
Related Articles
- How to Set Up Your AI Marketing Agent with Claude Code — Full agent architecture: sub-agents, MEMORY.md, web research capabilities
- How to Set Up Your AI Marketing Agent with Codex — The OpenAI Codex equivalent for scheduled autonomous workflows
- How to Build an AI Marketing Agent for Paid Media — The concept and architectural decisions behind agentic ad management
- What Is MCP (Model Context Protocol)? — The protocol that makes Claude Code + Adspirer possible
- How to Connect Claude to Google Ads (2026 Guide) — The simpler Claude desktop app setup
More articles to read
Should You Hire a PPC Specialist or Use AI? 2026 Guide
Honest comparison of hiring a PPC manager vs using AI tools like Claude and ChatGPT to run Google Ads and Meta campaigns in-house. Includes real cost breakdown.
Free Google Ads MCP: When Google's Server Fits (2026)
Google's free Google Ads MCP server is open source and read-only. See its three tools, setup needs, limits, and when a hosted option fits better.
Claude Cowork for Marketers: Ads, Reports, Automation
Use Claude Cowork for Google Ads and marketing: connect live ad accounts, work from brand files, run analyses, build reports, and schedule reviews.
How to Run Facebook & Instagram Ads with Your Codex AI Agent [2026]
Build a Meta Ads specialist agent with Codex: creative fatigue monitoring, audience optimization, campaign ideation from real data, and autonomous workflows that compound knowledge.