Claude Code's /loop command shipped in June 2026, and the broader "claude code skills" ecosystem grew from roughly 5,000 to 33,000 monthly US searches in the months that followed. The top results for "claude loop" today are Addy Osmani's Loop Engineering post (a software engineering perspective), the Claude Code scheduled tasks docs, and scattered Reddit threads. Zero of them are written for a growth marketer. That is the gap this article closes, a loop playbook for go-to-market teams who are technical enough to run a CLI but are not developers.
> Quick Definition. A claude loop is a CLI command that runs a prompt on a schedule inside a Claude Code worktree, the prompt executes, observes the result, and repeats at a fixed interval. Loop engineering is the practice of designing those prompts, schedules, and guardrails so the loop does useful GTM work without drifting or burning API credits.
If you already run Claude Code, the Claude marketing skills ultimate guide covers the broader skill ecosystem. This article is the next layer down: what to do when a skill needs to run on a schedule, unattended, against live marketing data. Pair it with the best Claude Code workflows for marketing agencies for the agency context, and Claude skills for SEO for the search-specific deep-dive.
TL;DR
- The 5 GTM Loop Archetypes, Monitor, Nurture, Generate, Syndicate, Optimize, are the core framework in this article. Every claude loop you build maps to one of them, and each has a different cost profile and approval requirement.
- Loop cost modeling is simple math: tokens per run × daily frequency × Claude per-token price = monthly dollars. A daily Monitor loop costs under $3/month; a weekly Generate loop can hit $40/month. Never ship a loop without knowing its monthly cost.
- The ESG Framework, Enable → Schedule → Govern, is the mental model for safe loop deployment. Skip any one stage and you either burn credits, miss runs, or let a drifted loop touch production unsupervised.
- When NOT to use a loop is as important as when to use one: MCP servers, plain cron, and human judgement each beat a loop in specific situations. Loops are not a universal replacement for automation.
What Is a Claude Code /loop?
A loop is a single CLI command that runs a prompt on a schedule inside an isolated worktree, observes the result, and repeats at a fixed interval until you stop it. It is the scheduled-task primitive of Claude Code, the equivalent of cron for prompts that need to interpret data, call tools, and produce output unattended. The closest analogy for a growth marketer is a scheduled Zapier flow, except the "steps" are natural language instructions Claude interprets each cycle, and the "connections" are MCP servers Claude can call on demand. That distinction matters because it means a loop can handle unstructured inputs (a SERP that changed, a reply that came in, a creative that fatigued) without you pre-mapping every possible branch. The claude loop is what you ship when the work is too unstructured for Zapier and too frequent for a human.
Three terms you need to lock in before you build your first loop:
- Worktree. A disposable copy of your repo where the loop runs. The loop can read your
CLAUDE.md, your skills, and your connected MCP servers without touching your main branch. When the loop finishes a cycle, the worktree is what gets reset. This isolation is what makes a loop safe to schedule, it cannot accidentally commit to your main branch. - Interval. How often the loop runs. Claude Code accepts cron syntax (
0 9 * * 1= every Monday 9 AM) or natural language ("every 12 hours"). The interval is the single biggest cost lever, a daily claude loop is 30× more expensive than a monthly one at the same token count. - Prompt cycle. One execution of the prompt inside the worktree. A cycle pulls context, runs tools, produces output, and stops. A loop is just a sequence of prompt cycles on a timer, which means the prompt itself has to be bounded, a cycle that runs forever is a bug, not a loop.
That is the whole primitive. Everything else in this article is patterns, cost math, and guardrails built on top of it. If you can describe what one cycle should do in plain English, you can ship a loop, the rest is engineering discipline.
The 5 GTM Loop Archetypes
Every claude loop you will ever build maps to one of five archetypes. The 5 GTM Loop Archetypes (Monitor / Nurture / Generate / Syndicate / Optimize) framework below is the asset the rest of this article references, print it, stick it on the wall, and use it as the first question you ask before shipping any claude loop: which archetype is this? The framework is what separates a safe, cheap, useful loop from an expensive, drifted, dangerous one.
| Archetype | What it does | Example GTM use | Frequency | Approval |
|---|---|---|---|---|
| Monitor | Check status and alert | Daily rank tracking, budget pacing, competitor page diff | Daily | None (read-only) |
| Nurture | Sequence drips and follow-ups | Email sequences, LinkedIn engagement, re-engagement | Hourly/daily | Draft only |
| Generate | Batch create at scale | Ad creative variants, blog outlines, landing page drafts | Weekly | Draft only |
| Syndicate | Reformat and distribute | Cross-post blog → LinkedIn → X → newsletter | Weekly | Draft only |
| Optimize | Analyze and improve | A/B test analysis, bid optimization, refresh triggers | Weekly/monthly | Recommend, human approves |
Two columns drive most of your decisions: Frequency (cost) and Approval (safety). A Monitor loop is read-only and cheap, so it can run daily with no approval. An Optimize loop touches money, so it should recommend, not execute. Mixing those up is how loops go wrong, and the 5 GTM Loop Archetypes framework exists precisely to keep those two columns honest.
Monitor Loop, "Check status and alert" (your first claude loop)
A Monitor loop reads data and writes a notification. It never mutates state. Example: a daily rank tracking claude loop that pulls 50 target keywords from Search Console, compares positions to yesterday, and posts a Slack alert for any keyword that moved more than three positions. Monitor loops are the safest place to start because the worst they can do is send a noisy alert. They are also the cheapest archetype, a daily Monitor loop typically costs $1, $3/month in tokens, which is why the Quick Start later in this article ships a Monitor claude loop as your first one.
Nurture Loop, "Sequence drips and follow-ups"
A Nurture loop advances a sequence by one step per cycle. Example: a daily outbound claude loop that checks for replies on yesterday's cold emails, drafts contextual follow-ups for non-responders, and queues them for human review before sending. Nurture loops touch real customers, so they should always draft, never send. The human reviews the queue once a day and clicks send. This is the boundary between "loop" and "autonomous agent", a Nurture loop is a loop precisely because it stops for approval.
Generate Loop, "Batch create at scale"
A Generate loop produces a batch of artifacts in one cycle. Example: a weekly creative claude loop that takes this week's top-performing ad hooks, generates 10 new variants per hook (image prompt + primary text + headline), and writes them to a draft doc for the creative lead. Generate loops are the highest-token archetype, a single run can burn 50K, 200K tokens because output is long. Cost them before you ship them.
Syndicate Loop, "Reformat and distribute"
A Syndicate loop takes one asset and reformats it for N channels. Example: a weekly claude loop that takes Monday's published blog post, drafts a LinkedIn carousel, an X thread, and a newsletter blurb, and queues all three for review. Syndicate loops are the cheapest way to multiply content output without multiplying input. They are also the archetype most likely to drift, a Syndicate loop that "improves" the source asset while reformatting it has stopped being a Syndicate loop and become a Generate loop. Keep the boundary tight.
Optimize Loop, "Analyze and improve"
An Optimize loop reads performance data, proposes changes, and waits for human approval before executing. Example: a weekly Google Ads claude loop that pauses keywords with CPA above 2× target, raises bids on keywords with CPA below 0.5× target, and writes the proposed changes to a doc for the PPC lead to approve. Optimize loops touch money. The rule is simple: the loop recommends, the human approves, the loop executes the approved diff. Never let an Optimize loop execute without a human in the middle until you have run it in read-only mode for at least a month and the recommendations have been consistently sane.
The Anatomy of a Claude Code Loop Setup
A working loop has three files: a CLAUDE.md persona block, a .loop file, and a cron schedule. The anatomy below is what every archetype shares, once you can read these three files fluently, you can ship any claude loop in the 5 GTM Loop Archetypes framework. The setup is deliberately boring so the prompt can be interesting, and the three files map cleanly onto the ESG Framework later in this article: CLAUDE.md is the Enable stage, .loop is the Schedule stage, and the cron entry plus kill switch is the Govern stage. If you get the anatomy right, the governance comes almost for free.
CLAUDE.md persona block
Your CLAUDE.md is the loop's persona, the instructions Claude reads at the start of every cycle. Keep it short, specific, and role-bound. The persona block below is a real Monitor loop persona, lightly edited. It runs in under 8K tokens and costs about $0.07 per cycle at current pricing.
# GTM Loop: SEO Monitor
You are an SEO operations lead running a daily rank tracking loop.
Your job:
1. Pull the 50 target keywords from `data/seo/keywords.csv`.
2. Fetch current Google positions via the Search Console MCP server.
3. Compare to yesterday's positions stored in `data/seo/positions-latest.json`.
4. For any keyword that moved more than 3 positions (up or down), append a row to `data/seo/alerts.md` with: keyword, old position, new position, delta, date.
5. If any keyword moved more than 10 positions, also post a message to the Slack MCP channel `#seo-alerts`.
6. Overwrite `data/seo/positions-latest.json` with today's positions.
Rules:
- Never edit `keywords.csv`. It is owned by the human.
- Never call any tool that mutates state outside the `data/seo/` directory.
- If the Search Console API returns an error, retry once after 60 seconds, then log the error to `data/seo/errors.log` and exit.
- Stop after one cycle. The loop runner will restart you tomorrow.The persona block is the highest-leverage file in the setup. A vague persona ("track rankings and alert me") produces a drifted claude loop within a week. A bounded persona like the one above runs for months without intervention. The two structural choices that matter: numbered steps (so the loop knows when it is done) and explicit "never" rules (so the loop knows what it cannot touch).
.loop file
The .loop file is the loop's configuration, name, schedule, prompt file, and worktree path. It is the single source of truth for what the loop is and when it runs.
# .loop files live in the repo root
name = "seo-rank-monitor"
schedule = "0 8 * * *" # 8 AM daily, cron syntax
prompt = "prompts/seo-monitor.md"
worktree = ".loops/seo-rank-monitor"
timeout_minutes = 10
max_tokens_per_cycle = 20000Five fields, all required. The two that cost the most money are schedule (frequency) and max_tokens_per_cycle (per-run ceiling). Set max_tokens_per_cycle deliberately low, if a cycle hits the ceiling, the loop should exit with an error, not silently truncate. A truncated claude loop is worse than a failed one because it produces output that looks complete but is not.
Cron scheduling
Claude Code's /loop command reads the .loop file and registers the schedule. Two ways to install a loop, depending on where the host lives.
# Option A: register the loop with Claude Code's native scheduler
claude loop add .loop
# Option B: run via system cron (useful when the host machine is always on)
# Add to crontab:
# 0 8 * * * cd /path/to/repo && claude loop run seo-rank-monitorThe native scheduler is simpler and is the right starting point for most GTM teams. System cron is more durable, it survives a Claude Code restart and runs even when the app is closed, but requires the Claude CLI to be on PATH and authenticated. For a loop that touches production ad spend, prefer system cron on a always-on host; for a Monitor loop that only posts to Slack, the native scheduler is fine.
Loop Cost Modeling
Every claude loop has a monthly cost. The formula is simple and you should run it before you ship any loop, not after.
monthly_cost = tokens_per_run × runs_per_day × 30 × price_per_tokenAt Claude's current pricing (roughly $3 per million input tokens, $15 per million output tokens, blended ~$9/M for a typical mixed workload), here is what each archetype in the 5 GTM Loop Archetypes framework costs at typical frequencies:
| Archetype | Tokens/run | Frequency | Monthly cost | Notes |
|---|---|---|---|---|
| Monitor | 8K | Daily | ~$2 | Read-heavy, short output |
| Nurture | 15K | Daily | ~$4 | Drafts replies, medium output |
| Generate | 80K | Weekly (4×/month) | ~$29 | Long output, batched |
| Syndicate | 25K | Weekly (4×/month) | ~$9 | Medium output, 3 channels |
| Optimize | 30K | Weekly (4×/month) | ~$11 | Reads + recommendation doc |
Worked example: a 5-loop GTM stack (one loop per archetype) runs about $55/month in tokens. That is roughly the cost of one Zapier professional seat and an order of magnitude less than the human time it replaces (Directional, your token counts will vary with prompt length and tool usage). Two levers shrink cost fast: lower the frequency (weekly beats daily, monthly beats weekly), and shrink the prompt (a 500-token prompt beats a 2,000-token prompt at the same frequency). Cost modeling is not optional, it is the third file in your loop setup, alongside CLAUDE.md and .loop.
The ESG Framework for Safe Loop Deployment
ESG is the mental model for going from "claude loop exists" to "claude loop is safe and monitored." The ESG Framework has three stages, in order, and skipping any one of them is how loops go wrong in production.
Enable
Enable means the loop can run at all. The worktree exists, the CLAUDE.md is written, the MCP servers it needs are connected, and the prompt runs end-to-end without errors on a single manual invocation. If you cannot run the loop once by hand, you cannot loop it. Most loop failures are Enable failures, a missing MCP token, a wrong file path, a tool that returns 401. The Enable stage is where you find those before they cost you money.
Schedule
Schedule means the loop runs on a timer and the timer survives a machine restart. Use the native Claude Code scheduler or system cron, not a backgrounded while true script. Verify the schedule by checking the loop's log file after two scheduled runs, if you only see one entry, the schedule is wrong. A loop that runs once and stops is not a loop; it is a script that ran once.
Govern
Govern means a human can see what the loop did, override it, and stop it. Three governance primitives make a loop safe to leave running overnight. First, log everything, every cycle writes to data/<loop>/log.md with timestamp, tokens used, and a one-line summary. Second, approval gates on every mutating archetype, Nurture, Generate, Syndicate, and Optimize loops write to a draft queue that a human clears daily, and only Monitor loops run without a gate. Third, a kill switch, a single command (claude loop stop <name>) that halts the loop within one cycle. Test the kill switch before you ship, not after.
When you skip the Enable stage, the loop errors silently and you only find out when a customer notices. When you skip Schedule, the loop runs once and stops, which is a script, not a loop. When you skip Govern, the loop eventually drifts into doing something you did not intend, and that is the failure mode that costs real money. All three ESG Framework stages are non-optional, and they have to ship in that order.
When NOT to Use a Claude Loop
Claude loops are not the answer to every automation question. Three cases where something else beats a loop, and knowing the boundary is part of loop engineering.
Use an MCP server when the trigger is event-driven, not time-driven. If you want to act the moment a lead fills out a form, an MCP server that listens for the webhook beats a loop that polls every five minutes. Loops are for scheduled work; MCP servers are for reactive work. Mixing them up is how you end up with a 60-second polling claude loop burning tokens to check a queue that gets one event per day.
Use plain cron when the job is deterministic and needs no judgment. A nightly database backup, a weekly CSV export, a daily sitemap rebuild, these are cron jobs, not claude loops. Adding Claude to a job that does not need judgment increases cost and failure surface area for zero gain. A loop earns its cost when the prompt has to decide something; if it never does, use cron.
Use human judgement when the cost of a wrong decision is high and the frequency is low. A monthly pricing page rewrite, a quarterly ICP refresh, a one-off crisis response, these are not claude loops. A loop that runs monthly costs almost as much in governance overhead as it saves in human time. Just do the work.
The rule of thumb: if the job runs more than once a week AND requires Claude to interpret unstructured data, it is a loop. Otherwise, it is something else, and forcing it into a loop is a category error.
Quick Start: Your First Claude Loop in 10 Minutes
A 10-minute path to your first running Monitor loop. Use the SEO rank tracker from the archetypes section, it is the safest first loop because it is read-only and costs under $1/month. The steps below map onto the ESG Framework: steps 1, 6 are Enable, step 7 is Schedule, and step 8 is Govern. Do not skip the Govern step even though the loop is read-only, the kill switch is a habit you want before you ship a mutating loop.
- Create the worktree directory.
mkdir -p .loops/seo-rank-monitor data/seoin your repo. The worktree is where Claude will run each cycle; the data directory is where the loop writes its outputs. - Write `prompts/seo-monitor.md` with the
CLAUDE.mdpersona block from the Anatomy section above. Save it. This is the persona file the loop reads at the start of every cycle, keep it bounded or the loop will drift. - Write `data/seo/keywords.csv` with 10 target keywords (one per line,
keyword,urlcolumns). Keep it to 10 for the first run so cost is trivial and so you can read every row of output by hand. - Write `.loop` at the repo root with the config from the Anatomy section. Set
schedule = "0 8 * * *"for daily at 8 AM. Daily is fine for a Monitor loop; do not start more frequent than that until you have cost data. - Connect the Search Console MCP server in your Claude Code settings (Settings → MCP → Add server → Google Search Console). Authenticate with read-only scope. Read-only is the only scope you need for a Monitor loop and is the only scope you should grant.
- Run it once by hand.
claude loop run seo-rank-monitor --once. Watch it pull positions, writepositions-latest.json, and (if anything moved) append toalerts.md. Fix any errors before moving on, this is the Enable stage of the ESG Framework, and any error here will be a silent error once the loop is scheduled. - Register the schedule.
claude loop add .loop. Confirm withclaude loop list. This is the Schedule stage, the loop now runs at 8 AM daily until you stop it. - Set the kill switch.
claude loop stop seo-rank-monitor, verify it halts. Then re-add:claude loop add .loop. This is the Govern stage, and testing the kill switch before you ship is what makes a loop safe to leave running overnight. - Check the log tomorrow. Open
data/seo/log.mdand confirm one cycle ran, tokens used, and summary line. If yes, you have a working loop. - Add the Slack MCP for alerts when you are ready. Re-run step 6 to verify the alert fires on a >10-position move.
That is the full first loop. Total time: about 10 minutes if your MCP servers are already connected, 20 if they are not. Cost for the first month: under $1.
Where This Goes Next
The 5 GTM Loop Archetypes and the ESG Framework are the two assets you carry from this article into every channel-specific deep-dive that follows. A Monitor loop for SEO, a Nurture loop for outbound, an Optimize loop for Google Ads, each is the same primitive applied to a different stack of MCP servers and a different cost ceiling. The discipline transfers; the configurations do not.
The pattern that compounds is this: once you have one claude loop running safely, the second one is half the work, the third is a quarter, and by the fifth you are staffing a channel with a loop instead of a person. That is the shift that makes a small GTM team operate like a large one, not more tools, but more loops running the tools you already have. The work that compounds is the work that runs without you watching it.
Metaflow is built for exactly this motion. The platform ships marketing agents that hold your positioning, competitors, and connected accounts as durable context, and pause for approval before anything ships, which is the same boundary the ESG Framework enforces. If you want to skip the CLI plumbing and start from a loop that already knows your stack, that is the layer Metaflow adds on top of raw Claude Code.
Frequently Asked Questions
What does the loop do in Claude Code?
A loop in Claude Code runs a prompt on a schedule inside an isolated worktree, observes the result, and repeats at a fixed interval. It is the scheduled-task primitive of Claude Code, the equivalent of cron for prompts that need to interpret data, call tools, and produce output unattended. Metaflow's marketing agents use the same primitive but add durable context and approval gates so a loop can run against live accounts without losing your positioning.
Can I run Claude Code in a loop?
Yes. The /loop command (shipped June 2026) is the native way to run Claude Code on a schedule. You write a .loop file with a name, schedule, prompt path, and worktree, then claude loop add .loop registers it. The loop runs at the scheduled interval until you stop it with claude loop stop <name>. Metaflow wraps this same command with a marketing-specific persona and MCP stack so you do not have to write the persona block from scratch.
How long can a Claude Code loop run?
A single prompt cycle should be bounded by timeout_minutes in your .loop file, 10 minutes is a safe default for Monitor and Nurture claude loops, 30 for Generate. The loop itself (the recurring schedule) runs indefinitely until you stop it. There is no built-in maximum; the constraint is cost, not time. A daily claude loop that runs for a year costs 365× one cycle's token cost, model it before you ship it, the same way Metaflow's agents log tokens per run so the monthly cost is always visible.
How much does a Claude Code loop cost in tokens?
Cost = tokens per run × runs per day × 30 × price per token. At Claude's current blended ~$9 per million tokens, a daily Monitor loop with 8K tokens/run costs about $2/month; a weekly Generate loop with 80K tokens/run costs about $29/month. A typical 5-loop GTM stack runs about $55/month in tokens (Directional, your prompts and tool usage will vary the actual count by 2, 3×). Metaflow's dashboards surface this per loop so you do not have to compute it by hand.
Conclusion
The /loop command is six weeks old and the SERP is six months behind it. The teams that publish the canonical GTM claude loop patterns now are the ones that get cited later, by AI answer engines, by the next round of searchers, and by the developers who will eventually write the libraries that make loops easier. The 5 GTM Loop Archetypes framework, the ESG Framework, and the cost model in this article are the assets you can use today to ship your first loop in 10 minutes. Start with a Monitor loop, cost it, govern it, then add one archetype at a time until you have a full GTM stack running unattended. The future of GTM operations is scheduled AI that drafts, humans that approve, and loops that cost less than the coffee budget, and Metaflow is where those loops live once you outgrow the CLI. Time to ship your first one.
Sources
- Anthropic, Claude Code overview and changelog
- Claude Code, Scheduled tasks reference
- Addy Osmani, Loop Engineering (software engineering perspective)
- Anthropic, Building effective agents
- DataForSEO, US search volume for "claude code skills" 5K → 33K growth
- GitHub, AgriciDaniel/claude-seo plugin (14.2K stars)
- GitHub, AgriciDaniel/claude-ads plugin (8.0K stars)
- r/ClaudeAI, community loop use-case discussions





