optimize-campaign

A step-by-step checklist for improving a Google Ads campaign, an online advertising campaign managed through Google's ad platform.

In plain words
What is it for?
Useful for reviewing campaign metrics, cleaning up search terms with negative keywords, improving Quality Score, and drafting new search ads.
Why use it?
It helps find tracking failures, wasted spending, weak keyword relevance, and underperforming advertisements before making changes.

Command for Claude Code

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add commands/klosk/adloop/optimize-campaign
Clone the repo
git clone --depth 1 https://github.com/kLOsk/adloop

Made for: Claude Code.

Per session 8 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 433 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00008 $0.00433
Opus 5 $0.00004 $0.00217
Sonnet 5 $0.00002 $0.00087
Haiku 4.5 $0.00001 $0.00043

Measured yesterday against content hash 6fd92bafc1a8, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

optimize-campaign scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured yesterday.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.claude/commands/optimize-campaign.md · 55 lines

What it actually says

Optimize Google Ads campaign: $ARGUMENTS

Follow this checklist in order — earlier items have higher impact.

Context tip: run the diagnosis reads with compact=true (totals + top offenders instead of full row dumps); switch to full mode only when drafting a change against a specific entity.

1. Diagnose

  • get_campaign_performance — current metrics
  • attribution_check — is tracking working?
  • If zero conversions + significant spend: STOP and resolve tracking first

2. Search term cleanup

  • get_search_terms — identify irrelevant terms wasting budget
  • get_negative_keywords — what's already blocked (avoid duplicates)
  • Propose negatives with add_negative_keywords (show preview, wait for approval)
  • Group negatives by theme for clarity

3. Quality Score

  • get_keyword_performance — check QS for each keyword
  • QS < 5 = relevance problem (landing page + ad copy mismatch)
  • Suggest specific improvements to ad copy or landing page

4. Ad copy

  • get_ad_performance — which ads perform best
  • If CTR < 2% across all ads: headlines need rewriting
  • If fewer than 3 active ads: create new ones with draft_responsive_search_ad
  • Count characters before drafting (30 char headline limit)

5. Bidding strategy

  • Check if campaign uses Smart Bidding or Manual CPC
  • Manual CPC + Broad Match: MIGRATE to Phrase/Exact OR switch to Smart Bidding
  • Recommend Maximize Conversions if sufficient conversion data exists

6. Budget

  • Is daily budget >= 5x target CPA?
  • If not: either increase budget or focus on reducing CPA first
  • Use estimate_budget if considering budget changes

Rules

  • One change at a time — show preview, wait for approval
  • Never edit during Learning Phase
  • Priority order: tracking > negatives > QS > ad copy > bidding > budget
Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. yesterday First seen · 55 lines · 8 tokens per session scan A 6fd92bafc1a8

Subscribe to this mod's changes

optimize-campaign is a command published in the GitHub repository kLOsk/adloop (253 stars, last pushed 1mo ago), licensed MIT. It adds 8 tokens to every session and 433 once invoked, about $0.0000 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.