adloop: Command for Claude Code

.claude/commands/optimize-campaign.md

optimize-campaign is a command for Claude Code from kLOsk/adloop. It costs 8 tokens per session (433 once invoked), scanned A, original, MIT.

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

Written for Claude Code: allowed-tools in frontmatter.

This is kLOsk/adloop's own configuration. It tells Claude Code how to work on adloop itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything adloop configures →

Reuse

Borrowing it

Nothing to install: this file belongs to kLOsk/adloop. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/kLOsk/adloop/main/.claude/commands/optimize-campaign.md
Clone the repo
git clone --depth 1 https://github.com/kLOsk/adloop

Made for: Claude Code.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for optimize-campaign

README.md
[![agentmods](https://agentmods.dev/badge/commands/klosk/adloop/optimize-campaign/github.svg)](https://agentmods.dev/commands/klosk/adloop/optimize-campaign)
Your own site
<a href="https://agentmods.dev/commands/klosk/adloop/optimize-campaign"><img src="https://agentmods.dev/badge/commands/klosk/adloop/optimize-campaign/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for optimize-campaign

Your own site · 80×15
<a href="https://agentmods.dev/commands/klosk/adloop/optimize-campaign"><img src="https://agentmods.dev/badge/commands/klosk/adloop/optimize-campaign.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
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. A grade says what 26 rules found in the file — not that it is safe.
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.1 $0.00008 $0.00433
Opus 5.5 $0.00003 $0.00173
Sonnet 5.5 $0.00002 $0.00087
Haiku 4.5 $0.00001 $0.00043

Measured 2mo ago against content hash 6fd92bafc1a8, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, 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 2mo ago.

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. 2mo ago 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 (293 stars, last pushed 2d ago), licensed MIT. It adds 8 tokens to every session and 433 once invoked, about $0.0000 per session on Opus 5.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.

Related

optimize-campaign compared with commands from other repositories

optimize-campaign next to 6 commands from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
optimize-campaignkLOsk/adloopCommand2932d agoMITA8Claude Code
seo-auditbsisduck/google-search-ads-analytics-docsCommand25mo agononeA33Claude Code
google-docsbsisduck/google-search-ads-analytics-docsCommand25mo agononeA31Claude Code
setupringo380/ga-mcp-fullCommand027d agoMITA24Claude Code
auth-statusringo380/ga-mcp-fullCommand027d agoMITA16Claude Code
auth-logoutringo380/ga-mcp-fullCommand027d agoMITA15Claude Code
reconnectringo380/ga-mcp-fullCommand027d agoMITB40Claude Code