Blog

Claude Code Scheduled Tasks for Marketing Teams

Learn how to set up Claude Code scheduled tasks to run a marketing agent fleet on your own repo. State files, cron cadences, and practical setup steps.

agent-patternsmethodology
Glass hourglass with sand flowing against a solid black background.
Photo by Milad Fakurian on Unsplash

Claude Code scheduled tasks let you run autonomous agents on a recurring schedule against your own git repository. Instead of prompting Claude interactively, you define a task with a prompt file and a cadence, and the agent runs unattended: it reads its state from the prior session, does its work, commits the results, and stops. Armada Works runs its entire marketing operation this way, with seven agents each on their own schedule, each committing to the same repo.

This post covers the practical mechanics of setting up Claude Code scheduled tasks for marketing. If you want a broader overview of agent deployment, including fleet architecture and prerequisites, start with How to Deploy Claude Code Agents into Your Codebase.

What Scheduled Tasks Are

A Claude Code scheduled task is a managed feature within Claude Code that handles the full lifecycle of an agent run. It starts a fresh session, loads your prompt file, runs the agent against your working directory, and stops when the work is done. You configure it through the Claude Code CLI, and it runs on the defined schedule.

Each task needs three things:

  • A prompt file. A markdown document that defines the agent's role, scope, constraints, and output locations. This is the instruction set the agent reads at the start of every run.
  • A cadence. How often the task fires. Common patterns for marketing: Monday/Wednesday/Friday for content and SEO, daily for lead triage, twice a week for outbound research.
  • A working directory. The git repo the agent operates against. It reads files, writes files, and commits its output here.

The agent does not remember its previous session. Every run starts fresh, and persistent memory lives in state files that the agent reads at the start and updates at the end of each run. This is a design choice, not a limitation. Fresh sessions prevent context drift, stale assumptions, and runaway behavior.

What You Need Before You Start

You do not need to be a developer to run scheduled tasks, but you do need a few things in place.

  • A git repository. The agent commits its work. Your marketing content, state files, and agent prompts all live in git. If your content currently lives in Google Docs or Notion, you will need to migrate it.
  • Claude Code installed. The CLI must be available on the machine or environment where tasks will run.
  • A prompt file for each agent role. This is where the real work happens. A weak prompt produces weak output. A well-constrained prompt produces reliable, reviewable work.
  • A state directory. A folder in your repo (typically docs/agents/state/) where agents read and write their persistent context between runs.

Robert Cowherd, founder of Armada Works, puts it directly: "The prompt file is 80% of the work. If you spend an afternoon writing a good one, the agent runs for months. If you skip the prompt and wing it, you get a chatbot pretending to be an agent."

Setting Up Your First Marketing Agent

Here is a concrete example: a content agent that runs three times a week and drafts blog posts from a queue.

Step 1: Write the prompt file. Create a markdown file at docs/agents/content-agent-prompt.md that defines the role, constraints, and output locations.

## Role
You are the Content writer for [your company]. You draft blog posts
from the queue at docs/agents/state/content-queue.md.

## Constraints
- Never deploy to production.
- Never modify environment variables.
- Never install packages.
- Output goes to docs/content/blog/.

A production prompt will be longer (200 to 400 lines covering voice, formatting, security constraints, and collaboration rules). The point is that every behavioral rule lives in this file, not in your head.

Step 2: Create the state file and queue. Set up docs/agents/state/content-agent-state.md with a blank template the agent will populate on its first run. Create a content queue with your first few assignments. The agent reads the queue, picks the highest-priority item, drafts it, and marks it complete.

Step 3: Configure the scheduled task. In Claude Code, create the task pointing to your prompt file and set the cadence (e.g., Monday/Wednesday/Friday at 9 AM). The task fires at the specified times, runs the agent, and stops when the agent finishes.

Step 4: Review the first few runs. Check git log after the first three runs. Read the diffs. The agent will commit its drafts and update the state file. The first week is calibration: you will tune the prompt based on what the agent gets right and what it misses.

State Files and Cron Cadences in Practice

The state file is how an agent maintains continuity across sessions without conversation memory. At the end of each run, the agent writes a summary of what it did, what is in flight, and what it needs to remember. At the start of the next run, it reads that file first.

A typical state file includes:

Section Purpose
Current drafts in flight What the agent is working on right now
Recently shipped Completed work from the last two weeks
Queue snapshot Items pending, in progress, and completed
Open questions Issues needing human input before next run
Things to remember Style decisions, terminology, constraints discovered

Cadence depends on the role. Here is what Armada Works uses for its own fleet:

Agent Cadence Rationale
Content Mon/Wed/Fri 9 AM Blog posts need drafting time between runs
SEO Mon/Wed/Fri 9 AM Rankings data updates slowly; daily checks waste tokens
CMO (synthesizer) Mon/Wed/Fri 9 AM Reads all agent briefs, writes founder summary
Sales Lead Mon/Wed/Fri 9 AM Lead triage on a reasonable cadence
Outbound Mon/Wed/Fri 9 AM Prospect research batched, not real-time
Email Marketing Daily 9 AM Nurture sequences need daily send checks
Social Media Mon/Wed/Fri 9:30 AM Posts scheduled 2 to 3 times per week

Running agents more frequently than the work demands burns API credits without improving quality. Match the cadence to the natural rhythm of the work, not to how often you check your phone.

When to Do It Yourself vs. Hire a Consultancy

Setting up one agent is straightforward. Running a coordinated fleet of five to seven agents that read each other's output, maintain state across sessions, and produce reliable work without supervision is harder than it looks.

Do it yourself when:

  • You have one or two agents doing independent work with no coordination needed.
  • You are comfortable writing and iterating on 200-line-plus prompt files.
  • You have two weeks to spend calibrating output quality.
  • Your failure mode is low-stakes (a missed blog draft, not a misrouted lead).

Consider a consultancy when:

  • You need three or more agents that coordinate through shared state files.
  • You want a synthesizer agent (like a CMO) that reads every other agent's output and produces a unified summary.
  • You need security constraints, permission hooks, and audit trails from day one.
  • Your time is better spent reviewing agent output than writing prompts.

Armada Works offers a Pilot engagement ($2,500 to $4,000, one week) that ships a single working agent into your repo with a production-grade prompt, state files, and a reporting endpoint. The Pilot fee credits 100% toward a longer engagement if you continue within 30 days. If you decide to run the fleet yourself after that, you keep everything: the prompt, the state files, the commit history.

Frequently Asked Questions

Do I need to know how to code to use Claude Code scheduled tasks?

You do not need to write code, but you need to be comfortable with git, markdown, and reading diffs. The agent commits its work to your repository. You review it the same way you would review a colleague's pull request. If you can read git log --oneline, you can manage an agent.

How much do Claude Code scheduled tasks cost to run?

Cost depends on the model, the length of the prompt, and how much the agent reads and writes per session. A typical marketing agent session (reading state files, drafting a blog post, updating the queue) runs between $0.50 and $3.00 in API credits per run. A fleet of five agents running three times a week costs roughly $30 to $90 per week.

Can agents coordinate with each other?

Yes, through git-committed state files. One agent writes a brief; another agent reads it on its next run. The CMO pattern (a synthesizer agent that reads every other agent's output and produces a single summary) is the coordination model Armada Works uses. There is no shared memory or message queue. Git is the bus.

What happens if an agent makes a mistake?

The agent's work is a git commit. You revert it with git revert. Because every change is tracked in version control, nothing is permanent and nothing is hidden. The prompt's constraint section is your primary defense: a well-scoped agent cannot delete files, deploy to production, or modify environment variables. Claude Code's permission system enforces additional guardrails at the tool level.

How is this different from marketing automation tools?

Marketing automation runs predefined workflows on structured data: if a lead scores above 50, send email B. Claude Code agents reason about unstructured work: read this SEO report, notice the ranking gap, draft a blog post targeting it, commit the draft. Automation handles routing. Agents handle judgment. For a deeper comparison, see Marketing Agents vs. Marketing Automation.


If you want to explore whether a scheduled agent fleet fits your marketing operation, book a free 30-minute discovery call. No commitment, no follow-up sequence. We will tell you whether agents are the right fit, and if they are, what a Pilot would look like for your specific bottleneck.

Written by
Robert Cowherd
Book a call