How I Built an AI Marketing Team with Claude Code
A behind-the-scenes look at how I built an autonomous marketing team using Claude Code, agent teams, and markdown files. No code required.
In Part 1, I showed you what a week looks like when AI runs your marketing. Today I want to show you how I actually built it.
The short version: it is mostly just markdown files. And I didn't write a single line of code. Claude wrote all of it.
Here is the full breakdown.
How It Started: One Conversation
The whole project began with a single Claude Code session.
I opened the terminal and started explaining my situation. Here is my product, here is what it does, here is who it is for, here is who we compete with, here is our value prop. I connected the Ahrefs MCP server so Claude could pull our current keyword rankings and see where we stood in search. Then I asked: build me a go-to-market strategy.
Claude came back with a 90-day content plan. Blog post topics were mapped to SEO pillars. It included a social media distribution cadence, platform priorities, and weekly milestones. This was a concrete, sequenced plan rather than a vague collection of ideas.
From there, I just started executing it one piece at a time. "Write the first blog post." "Set up the social media tracker." "Create the content calendar." Each conversation added a new layer to the system. Within a few days, I had a working marketing operation. I didn't sit down and architect it all upfront. I just kept asking Claude to build the next thing I needed.
The Mental Model: Hire Employees, Not Write Prompts
The first shift that made everything click: stop thinking about prompts and start thinking about job descriptions.
Agentic marketing is the process of using autonomous AI agents to manage end-to-end marketing workflows, from strategy and content creation to distribution and performance analysis.
When you hire someone, you give them:
- A title and scope
- A style guide
- Company documentation
- The right tools
- A schedule
- Clear goals
That is exactly what I built. It just exists in markdown files instead of an employee handbook. A HubSpot survey showed that 64% of marketers were already using AI by early 2024, but most were still using it as a simple drafting tool. The shift to an agentic model changes the AI from a tool into a teammate.
The Team Structure
I have five agents:
| Agent | Role |
| Chief Marketing Officer | Strategy, orchestrates the other agents, reports to me |
| Content Writer | Blog posts, Sanity CMS publishing, image generation |
| Social Media Marketer | Twitter/X, Reddit, Medium, Slack communities |
| HN Marketer | Hacker News submissions and karma building |
| Performance Reviewer | Analytics, reads all trackers, generates reports |
Each agent is a single markdown file in .claude/agents/. Claude Code reads these files and spawns specialized subagents when the CMO delegates work.
The Experimental Feature: Agent Teams
This whole thing is built on an experimental Claude Code feature called agent teams. It is an opt-in capability that lets one agent spawn and coordinate other agents as subprocesses.
Here is what actually happens when the cron job fires:
- Claude Code starts and activates the CMO.
- The CMO reads the weekly plan, determines the current time slot, and figures out what needs to happen.
- For each piece of work, the CMO uses Claude Code's Agent tool to spawn a specialist subagent.
- That subagent gets its own isolated context window, its own system prompt, and its own set of tools.
- It executes, reports back, and exits.
- The CMO moves to the next task.
What makes this powerful is that specialists can run in parallel. Each runs independently with a focused, purpose-built system prompt.
The agents coordinate through a task system, a shared file system for state, and direct messaging to the CMO. Each agent also has a persistent memory directory that survives across sessions.
What an Agent File Actually Looks Like
An agent file has two parts: frontmatter and the system prompt. The frontmatter configures Claude Code behavior (model, memory settings, description).
The description field is how the CMO decides when to invoke this agent. The memory: project setting means the agent has access to persistent memory files.
The rest of the file is the agent's system prompt. It is their job description. It covers what documents to read, what tools they have access to, their specific workflow, hard rules, and error handling.
The Rules System: Shared Knowledge
Beyond agent files, I have a rules folder with guidelines that apply across agents. This includes Sanity CMS schemas, UTM formatting, social media tracking rules, and image generation protocols.
These are the company policies every new hire would read on day one. Once written, I never have to repeat them. If an agent makes a mistake, I fix the rule file. All future behavior inherits the fix.
Custom Scripts and MCP Servers
Some platforms don't have official Claude Code integrations, so I had Claude write lightweight Node.js scripts for them. I didn't write any of these myself. I just described what I needed and Claude wrote the code.
For platforms with proper APIs (Sanity, X/Twitter, Slack, Ahrefs), I use MCP (Model Context Protocol) servers. The agents call these as native tools, making operations feel like first-class actions.
The Feedback Loop
The system runs itself through a handoff chain. The Social Media Marketer logs everything. The Performance Reviewer generates reports and updates marketing insights. The CMO reads these and updates strategy. Finally, the Content Writer reads the strategy to write the next piece of content.
The CMO also has persistent memory across sessions. Patterns from previous weeks accumulate, making the system smarter over time.
Staying in the Loop via Slack
Fully autonomous is great until something goes wrong. My solution is to have the agents report everything to a private Slack channel. Every session starts with the CMO posting a daily plan.
Each agent identifies itself by name in every message. After a blog post goes live, the content writer posts the URL. After a social media session, the marketer posts a thread of links. Failures get reported too, so I can see problems without digging through log files.
The Day-to-Day
Once the system was running, my job became management. Most of my interactions are short conversations with Claude to update rules or agent files.
It is like managing a remote team over Slack, except your employees have perfect memory and never forget a policy update.
What Surprised Me
The hardest part was not the code—it was writing precise enough specifications. Rules compound. Each rule I add improves behavior across every agent that reads it. The time slot system changed everything by providing predictable execution windows.
If you have ever hired someone and written up their responsibilities clearly, you already know how to build this. Try building your own AI-powered team with Runbear.
