How I Used Claude Code to Build an AI Brain That Runs My Entire Agency
Can Claude Code Run Your Entire Agency?
Yes, if we build the right system around it. I built a project folder that holds everything my agency knows: client briefs, ad frameworks, reporting templates, and onboarding checklists. Then I built AI skills that use that knowledge to do real work. Claude Code is the tool that builds it all. Plain language. No coding required.
I built a system where Claude manages every client, writes every ad, generates every report, and onboards every new account. The goal was simple: walk away from day to day operations completely, and have the output be better than when I did everything manually.
Why I Built This with Claude Code
I run a performance marketing agency called Fan Convert. I manage paid ads for 8 clients across Meta and Google.
For years, I was the bottleneck. Every report went through me. Every new client setup went through me.
I was looking at hiring media buyers to scale. Then I realized something.
What if I built a system where Claude does the work, and my project manager just oversees it?
Not a chatbot. Not a simple assistant. A full operating system for the agency. The foundation is the same as any AI workflow for a marketing team — start with the tasks that waste the most time.
So I stopped hiring. And I started building.
Three days later, I had a working system. One person, my project manager, manages the entire business.
Claude does the heavy lifting. The output is better than what I was producing manually.
What I Built with Claude Code
A project folder called Fan Convert Brain, stored on GitHub. Think of GitHub as a shared hard drive that tracks every change, like a permanent version history.
It holds everything the agency knows: client data, campaign strategies, processes, and six AI skills.
Ad copywriting. Campaign reporting. Client onboarding. Image generation. Landing page design.
Plus five production tools: a Facebook Ads publisher that creates ads from a spreadsheet, a client reporting portal, automated daily cron jobs for pulling ad metrics, a server side tag manager, and an auto sync system that backs everything up every 15 minutes.
Before You Start with Claude Code
- Claude Code installed on your computer. This is Anthropic's CLI tool. You type instructions in natural language and Claude writes code, creates files, and builds things for you.
- A GitHub account. GitHub is where I store the finished project so it's always backed up and accessible. Think of it as a shared folder on the internet.
- Your agency's information: client list, services, pricing, processes, campaign data.
- API keys for the platforms you use (Meta Ads, Google Ads). An API is how two tools talk to each other. When I say "Meta Ads API," it means Claude can create ads without you logging into Ads Manager.
- A Vercel account for deploying web tools. Vercel is the service that puts websites on the internet. When you push a file, Vercel sees the change and updates the site automatically.
The Steps
Stage 1: Create the Brain
This is the prompt:
In Claude Code, type: "I want to build a knowledge base for my marketing agency. Create a git repository called Fan-Convert-Brain with this structure: identity/ for who we are, processes/ for SOPs, strategy/ for our frameworks, benchmarks/ for performance data, tech-stack/ for tool docs, admin/ for services and billing, team/ for team priorities, clients/ for client workspaces, skills/ for AI capabilities, and tools/ for production software.
Create a CLAUDE.md at the root that acts as a router, telling you which folder to check depending on the type of question."
Claude builds the entire structure in under two minutes: every folder, every file, and the CLAUDE.md router that tells it where to look for anything.
CLAUDE.md file: This is your project's brain. It's the first file Claude reads when it opens the project. It tells Claude what folders exist and what's in each one. Think of it as a map that Claude follows to find the right information.
I confirmed it worked by opening the folder and checking every directory existed. Then I opened CLAUDE.md and verified it listed every folder with the right reading priority: strategy first for methodology questions, processes for "how do we do X," benchmarks for performance questions.
Without a clear structure, Claude doesn't know where to look and gives generic answers instead of answers based on your agency's actual data.
Stage 2: Build the Client Template
Paste this in:
In Claude Code, type: "Create a client template at clients/_template/ with this structure: a CLAUDE.md as the client brief, a context/ folder with files for client-info, offer, buyer-personas, funnel, accounts, brand-guidelines, and competitors. An admin/ folder with contract, services, pricing, invoicing, onboarding checklist, and notes.
A strategy/ folder with current-plan, roadmap, and decision-log. A campaigns/ folder with a change-log.
Plus folders for copy, data, reports, meetings, and tasks."
Before this template existed, every client folder was different. One had buyer personas. Another didn't.
I was the system. If I wasn't around, nothing was findable.
I read every file Claude created. The CLAUDE.md had a file index pointing to every context file.
The decision-log and change-log were set up as append-only files. You only add to them, never delete. Permanent record of every decision.
Now every client gets the exact same workspace. Nothing gets missed during onboarding. Anyone on the team can find anything in the same place.
Stage 3: Create the Context Routing Skill
The prompt:
In Claude Code, type: "Build a context routing skill at skills/context-routing/. The core idea is lazy loading: only load the information Claude needs for the current task, not everything at once.
Define 7 principles: light files only (under 80 lines each), explicit authority hierarchy (entity level overrides domain, domain overrides global), one concern per file, conditional routing by task type, explicit human approval for context changes, mandatory append-only logging, and platform agnostic design. Include reference docs for how to build a router file, how to structure a context file, scaling playbook, routing rules catalog, audit checklist, and anti-patterns."
SKILL.md file: This is the instruction file that tells Claude what to do. Think of it as a recipe card. Claude reads it and follows the steps. Every skill in the Brain has one.
The core principle here is lazy loading: Claude reads only what it needs for the current task. Not everything at once. I had six reference files, one for each area, how to build a router, how to structure a context file, scaling rules, routing catalog, audit checklist, and common mistakes.
I verified the authority hierarchy was explicit: a client's CLAUDE.md overrides the agency's CLAUDE.md, which overrides a skill's defaults. Every reference file stayed under 200 lines. The anti-patterns file listed real mistakes , "putting everything in one giant file" and "loading all context upfront."
This is the architecture that makes everything else work. Without routing, Claude either knows too little or tries to read too much and gets confused.
Stage 4: Build the Andromeda Copywriting Skill
Your instruction:
In Claude Code, type: "Build a copywriting skill at skills/andromeda-copywriter/ based on Eugene Schwartz's Breakthrough Advertising, adapted for Meta's algorithm. The key insight is that on Meta, the creative itself segments the audience, not the targeting.
Build a 4-phase process: Phase 1 gathers all client data (offer, personas, funnel). Phase 2 creates detailed buyer avatars.
Phase 3 generates hooks (the first line people see). Phase 4 writes full ad bodies with CTAs.
The output should be 10 ads organized in 2 thematic groups of 5. Include reference files for each phase."
CTA: CTA means Call to Action. It's the line that tells people what to do next, like "Book a call" or "Download this guide."
I ran it on a real client immediately: a high-ticket mentorship at 2,000 euros. The skill went through all 4 phases in order.
Each hook was different from the others. The ads spoke to specific pain points from the buyer persona, not generic marketing language.
Ad copy was the most time consuming task I did every week, and quality depended entirely on my energy level that day.
Stage 5: Build the Ad Reporting Skill
What to type:
In Claude Code, type: "Build an ad reporting skill at skills/ad-reporting/. It should analyze campaign data from Meta Ads, Google Ads, YouTube Ads, and TikTok Ads.
Create a mandatory 5-question workflow: first summarize found data, then ask campaign type, then ask target metric, then tag campaigns as Launch or Evergreen, then ask if the user wants an HTML report. Always generate two versions: a detailed agency report and a simplified client report.
Chart colors are always Google in red and Meta in blue. Priority metrics are CPL and cost per appointment, never CTR or CPC first.
Include reference files for each platform with benchmarks and metric definitions."
CPL: Cost Per Lead. How much money you spend to get one person to fill out a form or sign up. If you spent 100 euros and got 10 leads, your CPL is 10 euros. Lower is better.
Then I said: "The reports need to prioritize CPL and cost per appointment. I don't want CTR or CPC showing up first. Those metrics distract clients."
What happened instead: Claude reorganized the metric hierarchy in the skill so CPL and cost per appointment always appear at the top of every report, and CTR/CPC only show up in the detailed agency version.
I exported a real CSV from Meta Ads Manager and dropped it into Claude Code. The 5-question workflow triggered in order.
It detected Meta as the platform, set chart colors to blue, and put CPL front and center in the HTML report. I also tested with a Spanish-language CSV. Comma decimals, multi-row headers. It handled both.
Reporting took 2 to 3 hours per client per week, and half that time was formatting, not analysis. I covered the full reporting automation process in how to automate client reporting with AI.
Stage 6: Build the Client Onboarding Skill
Feed this to Claude Code:
In Claude Code, type: "Build an onboarding skill at skills/onboarding/ that automates the entire new client setup. 5 phases: Phase 1 gathers admin info (contract, billing, contacts). Phase 2 understands the market (offer, personas, funnel).
Phase 3 audits advertising setup (accounts, pixels, tracking). Phase 4 generates strategy (decision log, roadmap, current plan).
Phase 5 validates and launches. The skill should auto-generate every file in the client template, fully populated with real data from the conversation.
Include a question bank with every question mapped to the exact field it fills."
New client setup used to take a full day of back and forth. Emails about ad accounts. Follow-ups about the contract.
Hunting down pixel IDs alone took hours. The onboarding skill runs one conversation and does all of it.
I onboarded a real client through all 5 phases. After the conversation ended, I checked every file.
The offer was there. The funnel setup was there. The Meta pixel ID and Google Ads account ID were there.
The strategy file had the correct target CPL and daily budget. Everything populated. Nothing missing.
One conversation. Full client workspace. Ready for Claude to start working.
Stage 7: Build the Ad Image Generator Skill
Open Claude Code and type this:
In Claude Code, type: "Build an ad image generator skill at skills/ad-image-generator/. It should generate ad creatives across 4 sizes: square, feed, story, and landscape.
Use the Nano Banana MCP for image generation. Give the user 3 paths to start: provide a hook and angle, describe an idea, or upload a reference image.
Include a reference file with the JSON prompt schema for Nano Banana, a gallery of great ad images as examples, and a style framework document."
MCP: MCP is how Claude connects to external tools like image generators or ad platforms. Think of it as plugging in a cable between Claude and another app.
Clients need fresh creatives every week. Designing 4 size variants per concept used to take hours. The skill does all four from one prompt.
I tested it on a real estate client. I gave it a hook about luxury properties and checked that 4 size variants came out. The images matched the style framework and the generated prompt followed the Nano Banana schema exactly.
Fresh creatives, four sizes, one prompt. That's the shift.
Stage 8: Build the Pen-to-Web Skill
Prompt for this stage:
In Claude Code, type: "Build a pen-to-web skill at skills/pen-to-web/ that converts Pencil design files (.pen) into Next.js 15 landing pages with Tailwind CSS v4. The process: read the .pen file using Pencil MCP tools, map each design node to a React component, extract design tokens and variables, build the component tree, write the Next.js code, test it, and deploy to Vercel.
Include reference files for responsive strategy, Tailwind v4 setup, Pencil node-to-JSX mapping, and Next.js project structure."
Next.js: Next.js is the tool that builds the website. Think of it as the engine behind the page. You don't need to understand it to follow the steps.
Vercel: Vercel is the service that puts the website on the internet. When Claude pushes a file, Vercel sees the change and updates the website automatically.
Sign up for The Lead
The AI newsletter for marketing agencies.
- •Steal our AI experiments.
- •A weekly step-by-step guide.
- •Read in under 2 minutes.
- •Steal our AI experiments.
- •A weekly step-by-step guide.
- •Read in under 2 minutes.
Going from a design file to a live landing page used to require a developer. This skill removes that dependency entirely.
I designed a landing page for a personal brand site in Pencil and ran it through the skill. Responsive strategy worked on mobile and desktop.
Tailwind v4 classes matched the design tokens. The component mapping preserved the visual hierarchy from the design file.
From design file to live URL, one conversation.
Stage 9: Build the Facebook Ads Publisher
Type this exactly:
In Claude Code, type: "Build a tool at tools/fb-ads-publisher/ that creates Facebook Ads in bulk from a Google Sheet. The sheet has tabs for config (account IDs), testing groups, hooks, bodies, CTAs, and creatives.
The tool reads the sheet, generates every combination (hook x body x CTA x creative), downloads the creative images from Google Drive, and publishes each combination as a Facebook Ad via the Meta API. Ads should be created PAUSED by default.
Include a dry-run mode that validates everything without publishing. Build it in Python with a CLI interface."
.env file: This file stores your passwords and API keys. It stays on your computer and never gets shared. Every time the script runs, it reads this file so you don't have to paste your keys again.
Three hooks. Two bodies. Two CTAs. Four creatives.
That is 48 combinations. Creating them manually in Ads Manager takes an afternoon. The publisher does it in two minutes.
I ran the dry-run first to verify the math: 3 x 2 x 2 x 4 = 48. Then I ran it live. All 48 ads appeared in Meta Ads Manager, paused, with the correct copy and images matched to the right combinations.
Victor messaged me after I showed him the publisher running. "How long did that actually take?"
Two minutes, I told him. He stared at the number. "We need to start doing this for every client."
Stage 10: Build the Reporting Portal
Copy and paste this:
In Claude Code, type: "Build a client-facing reporting portal at tools/reporting-portal/ using Next.js 15. It should have a login page and a dashboard that shows campaign reports per client.
Build the API routes for authentication and data fetching. Deploy it to Vercel."
Clients used to email me asking for the PDF. Now they log in and see everything, any time, without involving me.
I deployed to Vercel and logged in with test credentials. The dashboard loaded.
Client data was isolated. One client cannot see another's reports. The report formatting matched my agency style with the correct chart colors.
A portal gives clients 24/7 access. Sending PDF reports by email is unprofessional and clients lose them.
Stage 11: Build the Automated Cron Jobs
The exact prompt:
In Claude Code, type: "Build automated cron jobs at tools/agency-crons/ that run daily on Vercel. They should pull ad metrics from Google Ads and Meta Ads APIs automatically so I don't need manual CSV exports anymore.
Deploy as serverless functions on Vercel."
API route: An API route is a small piece of code on the website that runs when triggered. In this case, it runs on a schedule (daily) and pulls data from ad platforms automatically.
Exporting CSVs from ad platforms every week is the most boring task in the agency. This cron runs on its own, every day, without anyone touching it.
I ran the Google Ads cron manually with a backfill parameter to pull the last 85 days of data. The numbers matched what I saw in the Google Ads dashboard. The next day, the cron ran on schedule with no intervention.
Hours saved per month, just from not manually exporting data.
Stage 12: Set Up Git Auto-Sync
Run this:
In Claude Code, type: "Set up automatic git sync at tools/git-auto-sync/. It should commit and push all changes to GitHub every 15 minutes.
Create a shell script that runs as a cron job on my machine. Include error logging."
GitHub: GitHub is where I store the finished project so anyone with access can download it. Think of it as a shared folder on the internet that keeps a history of every change.
Before this was running, I lost changes twice. A crash, a lost file.
Since auto-sync started: nothing lost. Every 15 minutes, everything backs up automatically.
I made a small change to a file and waited 15 minutes. Checked GitHub.
The change appeared with the auto-sync commit message. The sync.log showed the script ran without errors.
If the laptop dies, nothing is lost. When my PM gets her access set up, she'll see every change in near real time.
Stage 13: Onboard Every Client
Your prompt:
In Claude Code, type: "Use the onboarding skill to set up [client name]. Here's everything I know about them: [paste client information: name, contact, offer, price, target audience, ad accounts, current campaigns, funnel URLs]."
The test is simple: after onboarding, can Claude answer a question about the client without me telling it anything?
I onboarded my most mature client and then asked cold: "What's the target CPL?" Claude answered correctly from the strategy file: under 12 euros.
"What's the daily budget?" Correct. "What CRM do they use?" Correct. Every answer came from the files, not from me.
Every client needs a complete workspace for Claude to do its job well. Garbage in, garbage out.
Stage 14: Set Up Team Management
Paste this into Claude Code:
In Claude Code, type: "Create a team management system at team/. Each person gets their own folder with a CLAUDE.md defining their role and a priorities.md for their weekly tasks.
Create a CLAUDE.md at the team root with rules: priorities.md files are the source of truth (not ClickUp), max 15 items per week, tag tasks as [Agencia] or [Personal]. Create an agency-priorities.md for cross-team items.
Set up the founder as transitioning from ops to strategy, and the PM as taking over operations."
Then I said: "I was using ClickUp before but it's too heavy. Let's move to just markdown files. During the transition, Claude can still read ClickUp via MCP but the markdown priorities are the source of truth."
What happened instead: Claude set up the team CLAUDE.md with a transition rule: ClickUp is read-only reference, priorities.md is the source of truth. Clean cut.
I opened the founder's priorities.md and confirmed it had the current week tasks tagged correctly. The PM's CLAUDE.md defined her role clearly. The team CLAUDE.md enforced the 15-item limit and the tagging convention.
If the PM is going to manage everything, she needs a clear system that shows what's priority this week without logging into another tool.
Stage 15: Save the PRODUCT.md
Use this prompt:
In Claude Code, type: "Update the CLAUDE.md with everything I built. List every folder, every skill, every tool, and the reading priority.
Make sure anyone opening this project for the first time knows exactly where to find everything."
PRODUCT.md file: This is your project's memory. It documents what you built, what decisions you made, and where everything lives. When you come back to this project in three weeks and forgot what you did, this file tells you everything. In my case, CLAUDE.md serves this purpose.
I tested this the best way I know how: opened a fresh Claude Code session in the project directory and asked questions cold.
"Where do I find Client X's target CPL?" Strategy folder. "How do I create a new ad?" Andromeda skill.
"What's the onboarding process?" Onboarding skill. Claude answered all three without any context from me. The routing works.
When you come back to this project, or when your PM opens it for the first time, this file tells you everything.
What I'd Do Differently
Start with the context routing skill. I built some things before formalizing the routing framework. If you build routing first, everything else follows the same architecture from day one. The broader picture of what an AI-powered agency looks like helped me understand how these pieces fit together before I built them.
Onboard clients before building skills. I built the reporting skill, then realized I didn't have client data structured properly to feed it. The onboarding skill should come before everything else.
Set up git sync first. I lost a few changes before the auto-sync was running. Version control on day one saves headaches.
When I showed Vinod the finished system, his first question was: "How long did this actually take?" Three days, I told him. He looked at me and said: "That is three days that just changed how we run this company."
The Claude Code Stack
| Tool |
What it does |
| Claude Code |
The AI that builds and runs everything |
| GitHub |
Stores the Brain, backs up every change |
| Vercel |
Hosts the reporting portal and cron jobs |
| Meta Ads API |
Creates and reads Facebook/Instagram ads |
| Google Ads API |
Pulls campaign metrics |
| Google Sheets API |
Reads ad testing structures |
| Google Drive API |
Downloads ad creative images |
| Pencil MCP |
Reads design files for landing pages |
| Nano Banana MCP |
Generates ad images |
| Next.js 15 |
Builds the web tools and landing pages |
| Tailwind CSS v4 |
Styles everything |
| Python |
Powers the Facebook Ads publisher |
| Docker |
Runs the server-side tag manager |
Files
Fan-Convert-Brain/
CLAUDE.md - The brain's router
agency/ - Agency-level knowledge
clients/ - 8 client workspaces + template
skills/andromeda-copywriter/ - Ad copy generation
skills/context-routing/ - Information architecture
skills/ad-reporting/ - Campaign analysis
skills/ad-image-generator/ - Creative generation
skills/pen-to-web/ - Design to code
skills/onboarding/ - Client setup automation
tools/fb-ads-publisher/ - Bulk ad creation
tools/reporting-portal/ - Client dashboard
tools/agency-crons/ - Automated data pulling
tools/git-auto-sync/ - 15-minute backups
tools/sgtm-server/ - Server-side tracking
team/ - Team priorities and roles
processes/ - Standard operating procedures
strategy/ - Frameworks and playbooks
benchmarks/ - Performance benchmarks
tech-stack/ - Tool documentation
templates/ - Reusable templates
Frequently Asked Questions
What can you build with Claude Code?
Claude Code can build complete software systems, not just individual scripts. In this project alone it built six AI skills, five production tools, a client reporting portal, a bulk Facebook Ads publisher, and an automated data pipeline, all from plain language instructions.
The range is wide: web apps, API integrations, automation scripts, knowledge bases, and anything that involves creating and organizing files.
How do I start a project in Claude Code?
Open your terminal, navigate to the folder you want to work in, and type claude. That opens the Claude Code interface. From there you give it instructions in plain English and it writes code, creates files, and builds things for you.
The most important first step is creating a CLAUDE.md file that tells Claude what the project is and where everything lives.
Is Claude Code hard to learn if you don't code?
The prompts in this article are copy-pasteable. You do not need to understand the code Claude writes, you need to understand what you want to build and describe it clearly.
The learning curve is in structuring your instructions. The more specific you are about the output you want, the better the result.
What is a CLAUDE.md file and how does it work?
CLAUDE.md is a plain text file that sits at the root of your project. Every time Claude Code opens the project, it reads this file first.
It tells Claude what folders exist, what each one contains, and which files to read depending on the type of task. Think of it as an index card that gives Claude a map of your project before it does anything.
How do you give Claude Code long-term memory?
Claude Code has no memory between sessions by default. The solution is a folder structure where all context lives in files, not in conversation history.
Every time you open the project, Claude reads the CLAUDE.md and loads the right context files for the task at hand. The files are the memory. That is exactly how this agency brain works.
How much does Claude Code cost?
Claude Code runs on your Anthropic account. Pricing depends on the Claude model you use and how much you build in a session. For a project like this one, expect to spend between $20 and $60 over a 3-day build.
After the build is complete, day-to-day usage, running skills, generating reports, writing ad copy, costs a few dollars per session depending on the volume.
Can you use Claude Code to automate a marketing agency?
Yes. This article documents exactly that.
Six AI skills handle copywriting, reporting, client onboarding, image generation, and landing page design. Five production tools handle bulk ad creation, client portals, automated data pulls, and version control.
One project manager oversees the whole system. Claude does the execution.
Claude Code runs in your terminal and operates directly on your file system. It reads, writes, and edits files without you copying and pasting between a chat interface and your editor.
The key difference for non-developers is that you describe what you want in plain language and Claude figures out the implementation. You stay in charge of the logic. Claude handles the code.
How long does it take to build something useful with Claude Code?
The agency brain in this article took three days. That includes the full folder structure, six AI skills, five production tools, and onboarding eight existing clients.
A single useful tool, like a reporting script or a bulk uploader, can be built in a few hours on a first session.
What APIs does Claude Code work with?
Any API that has documentation. In this project: Meta Ads API, Google Ads API, Google Sheets API, Google Drive API, and Vercel for deployment.
Claude reads the API documentation, writes the integration code, handles authentication, and tests the connection. You provide the API keys in a .env file. Claude does not touch the keys directly.