Borrowing it
Nothing to install: this file belongs to shashankrai1983/fb-ads-automation. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.
curl -O https://raw.githubusercontent.com/shashankrai1983/fb-ads-automation/main/.claude/commands/fb-ads/optimize.mdgit clone --depth 1 https://github.com/shashankrai1983/fb-ads-automationWrote 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.
[](https://agentmods.dev/commands/shashankrai1983/fb-ads-automation/optimize)<a href="https://agentmods.dev/commands/shashankrai1983/fb-ads-automation/optimize"><img src="https://agentmods.dev/badge/commands/shashankrai1983/fb-ads-automation/optimize.svg" alt="Measured on agentmods" height="20"></a>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.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00000 | $0.00439 |
| Opus 5 | $0.00000 | $0.00219 |
| Sonnet 5 | $0.00000 | $0.00088 |
| Haiku 4.5 | $0.00000 | $0.00044 |
Grade A, and why
optimize 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 6d 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.
What it actually says
Analyze and optimize a specific campaign (or all active campaigns if none specified).
For comprehensive multi-campaign optimization with creative suggestions, load the ads-optimizer agent instead: "Load optimizer agent"
Argument: $ARGUMENTS (campaign ID or "all")
Steps
-
If a specific campaign ID is provided, use that. Otherwise, call
list_campaignswithstatus_filter=ACTIVEand analyze all. -
For each campaign being optimized: a. Call
get_campaignto get current config (budget, status, objective) b. Callget_campaign_insightswithdate_preset=last_14dandtime_increment=1for daily trends c. Callget_creative_fatigue_reportwithdays=14d. Callget_audience_saturation_checkwithdays=14e. Calllist_ad_setsfor the campaign to check per-adset budgets -
Read
knowledge/playbook.mdfor current threshold values. Score each entity against the Red Flag Thresholds and Decision Frameworks. -
Present an optimization action table:
## Optimization Report — [Campaign Name]
### Current State
- Objective: X | Daily Budget: $Y | Status: Z
- 14d Spend: $X | CTR: X% | CPC: $X | Frequency: X
### Findings
[Detailed analysis of fatigue, saturation, cost trends]
### Action Table
| # | Action | Entity | Details | Impact | Risk |
|---|--------|--------|---------|--------|------|
| 1 | Pause ad | ad_123 | CTR dropped 40% | High | Low |
| 2 | Expand audience | adset_456 | Frequency at 4.2 | Med | Med |
### Execute?
Which actions should I execute? (specify numbers, "all", or "none")
-
Wait for explicit user confirmation. Execute only approved actions.
-
After executing, log changes to
docs/optimization-log.mdwith date, actions taken, and rationale.
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.
- 6d ago First seen · 46 lines · 0 tokens per session scan A 60d4fc28754d
optimize is a command published in the GitHub repository shashankrai1983/fb-ads-automation (0 stars, last pushed 6mo ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 439 tokens. 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-09-01.
Other commands, from other repositories
checklist
Generate a custom checklist for the current feature based on user requirements.
clarify
Identify underspecified areas in the current feature spec by asking up to 5 highly targeted clarification questions and encoding answers back into the spec.
specify
Create or update the feature specification from a natural language feature description.
converge
Assess the current codebase against the feature's spec, plan, and tasks, then append any remaining unbuilt work as new tasks to tasks.md so implement can complete it.
implement
Execute the implementation plan by processing and executing all tasks defined in tasks.md.
analyze
Perform a non-destructive cross-artifact consistency and quality analysis across spec.md, plan.md, and tasks.md after task generation.