Claude Code lets marketers build landing pages, automate campaign workflows, analyze competitor data, and generate content systems — all using plain English commands in your terminal. It's not a chatbot. It's Anthropic's AI coding agent that reads your files, writes code, and executes tasks autonomously. Marketers using it report building in hours what used to take weeks with a developer.
This guide covers the system behind Claude Code for marketing: context management with /compact, project memory with CLAUDE.md files, Plan Mode for safe experimentation, and the slash commands that make workflows repeatable.
The Single Most Important Concept: Context
Claude Code has a context window—a limited amount of information it can hold at once. Every file it reads, every command output, every message in your conversation fills this window.
Here's what most people don't know: performance degrades well before the context window is full. When context fills up, Claude starts "forgetting" earlier instructions and making more mistakes. Claude Opus 4.6 has a massive 200K token context window (with a 1M beta available), but you'll get better results by keeping sessions focused.
This changes how you should work:
- Start fresh for each task. Use
/clearbetween unrelated work. - Scope conversations narrowly. One campaign brief per session, not five.
- Compress when needed. Use
/compactto summarize and free up space.
/compact to get a summary, then /clear entirely, and paste back only what matters. Fresh context with critical information preserved. You can also use the "Summarize from here" option in the message selector to compress just part of the conversation while keeping the rest intact.
Setting Up CLAUDE.md: Your Marketing Command Center
CLAUDE.md is a special file that Claude reads at the start of every session. Think of it as your project's constitution—permanent context that doesn't need to be re-explained.
For marketing teams, this is where you document:
- Brand voice and tone guidelines
- Target audience descriptions
- Competitor names and positioning
- Content formats you use (LinkedIn posts, email sequences, landing pages)
- Commands to run your marketing tools
Creating Your Marketing CLAUDE.md
Run /init in your project folder to generate a starter file, then customize it:
# Marketing Team Context
## Brand Voice
- Tone: Professional but approachable, never corporate jargon
- We use "you" not "users" or "customers"
- Short sentences. No fluff.
## Target Audience
- Primary: Marketing managers at B2B SaaS companies, 50-200 employees
- Pain points: Too much execution work, not enough strategy time
- They've tried ChatGPT and been disappointed by generic outputs
## Content Formats
- LinkedIn: 1300 chars max, hook in first line, question CTA
- Email: Subject under 50 chars, preview text matters
- Blog: 1500-2500 words, H2 every 300 words, internal links
## Competitors
- [Competitor A]: Focuses on enterprise, expensive
- [Competitor B]: Developer-focused, technical messaging
- Our angle: Practical, no-code, results-focused
## Verification
- Always check character counts for social posts
- Run Grammarly CLI before finalizing copy: grammarly check [file]
Keep it under 300 lines. The HumanLayer team's CLAUDE.md is only 60 lines. More isn't better—it just fills your context window faster.
Hierarchical CLAUDE.md Files
You can have multiple CLAUDE.md files:
~/.claude/CLAUDE.md— Global, applies to all projects./CLAUDE.md— Project root, shared with team./campaigns/q1-launch/CLAUDE.md— Nested, campaign-specific
Claude reads all of them and prioritizes the most specific. This lets you share team standards while customizing for specific campaigns.
Essential Slash Commands for Marketers
These commands change how you work with Claude Code:
| Command | What It Does | When to Use |
|---|---|---|
/init | Generate starter CLAUDE.md | First time setting up a project |
/clear | Reset conversation context | Between unrelated tasks |
/compact | Summarize and compress context | Running low on context space |
/rewind | Undo to a previous checkpoint | Claude went in wrong direction |
/resume | Return to a previous session | Continue yesterday's work |
/rename | Name your session | Keep sessions organized |
/model | Switch between models | Sonnet 4.5 for simple, Opus 4.6 for complex |
/cost | Check token usage | Monitor spending |
The Commands You'll Use Daily
/clear — Use this constantly. Finished a campaign brief? /clear. Moving to a different project? /clear. Context pollution is the #1 cause of bad outputs.
/rewind — Press Esc twice or type /rewind to open the checkpoint menu. Every action creates a checkpoint. You can restore conversation, code, or both.
/resume — Sessions persist. Name them with /rename q1-campaign-brief so you can find them later with /resume q1-campaign-brief.
Plan Mode: Research Before Execution
Most people let Claude jump straight into generating content. This produces mediocre results because Claude doesn't have enough context.
Plan Mode separates research from execution. Claude reads files and analyzes data without making changes, then presents a plan for your approval.
How to Enter Plan Mode
Press Shift + Tab twice to cycle through modes:
- Normal Mode — Claude suggests changes, waits for approval
- Auto-Accept Mode — Claude makes changes without asking
- Plan Mode — Claude researches only, no changes
Or start a session directly in Plan Mode:
claude --permission-mode plan
/model to switch between models mid-session. Claude Sonnet 4.5 is fast and great for straightforward tasks like generating social posts or formatting content. Switch to Claude Opus 4.6 for complex work like competitive analysis, strategic planning, or anything requiring deep reasoning across multiple documents. Opus costs more tokens but produces significantly better output on nuanced tasks.
The Marketing Workflow
Here's how to use Plan Mode for a campaign:
- Enter Plan Mode. Press Shift + Tab twice.
- Explore. "Read our last 3 campaign briefs in /campaigns and our competitor positioning doc. Understand our patterns."
- Plan. "Create a detailed plan for our Q2 product launch campaign. What messaging angles should we test? What channels? What's the timeline?"
- Refine. Go back and forth until the plan is right. Press Ctrl + G to edit the plan in your text editor.
- Execute. Exit Plan Mode, then: "Implement the campaign brief from your plan."
"A good plan is really important!"
— Boris Cherny, Claude Code creator
Building Marketing Systems (Not Just Prompts)
The difference between beginners and power users: beginners ask for content, power users build systems that produce content consistently.
System 1: Queryable Interview Database
Turn scattered customer interviews into a searchable knowledge base.
Setup:
- Create a folder structure:
/research/interviews/,/research/surveys/,/research/support-tickets/ - Add your transcripts and data exports
- Initialize CLAUDE.md with context about your ICP
Query examples:
Analyze all interview transcripts and find the three most common objections prospects raise about our pricing.
What language do customers use to describe their problems before they found us? Give me exact quotes.
Find patterns in support tickets from enterprise customers. What do they struggle with most?
Claude reads across all files and synthesizes insights—something you can't do effectively in a regular chatbot with file size limits.
System 2: Content Library Audit
Analyze your entire content library for gaps and opportunities.
Setup:
- Export your blog posts from your CMS (WordPress, Webflow, etc.)
- Put them in
/content/blog-export/ - Or just give Claude your sitemap URL
Run the audit:
Analyze our blog content and create a comprehensive audit:
1. Publishing cadence by month
2. Topic distribution
3. Author breakdown
4. Which topics get the most internal links
5. Gaps in coverage compared to our competitor's blog at [competitor-url]
Create an interactive HTML dashboard with the results.
Claude generates both the analysis and an HTML file you can open in your browser—with clickable tabs, charts, and expandable sections.
System 3: Editorial Style Guide Generator
Reverse-engineer your brand voice from existing content.
Read the 15 most recent blog posts in /content/published/. Analyze them for:
- Sentence structure patterns
- Vocabulary preferences (words we use, words we avoid)
- Formatting conventions (how we use headers, bullets, bold)
- Introduction and conclusion patterns
- How we cite sources and add credibility
Create a comprehensive editorial style guide with specific examples from our content.
This gives new writers—or Claude itself—a reference for matching your voice.
System 4: Competitive Intelligence Pipeline
Build an ongoing competitive research system.
Create a competitive analysis framework:
1. Read competitor landing pages at [url1], [url2], [url3]
2. Extract: value propositions, target audience signals, pricing, proof points
3. Compare to our positioning in /strategy/positioning.md
4. Identify messaging gaps we could exploit
5. Save structured analysis to /research/competitive/[date].md
6. Update /research/competitive/summary.md with latest insights
Run this monthly. The summary file becomes your living competitive intelligence document.
Custom Commands for Repeatable Workflows
Store frequently-used prompts in .claude/commands/ to turn them into slash commands.
Create a file at .claude/commands/campaign-brief.md:
Create a campaign brief for the following:
$ARGUMENTS
Include:
1. Campaign objective and success metrics
2. Target audience segment with specific pain points
3. Key messages (primary + 2-3 supporting)
4. Channel strategy with platform-specific considerations
5. Content requirements by channel
6. Timeline with milestones
7. Budget allocation recommendation
8. Risks and mitigation strategies
Format as a structured document I can share with stakeholders.
Reference our brand guidelines in /brand/guidelines.md.
Now you can run:
/project:campaign-brief Q2 product launch, focus on enterprise segment, $50k budget, 6-week timeline
More Marketing Commands to Create
/project:social-posts— Generate platform-specific social content/project:email-sequence— Create nurture email series/project:content-repurpose— Turn one piece into multiple formats/project:competitor-check— Quick competitive scan
Skills: Teaching Claude Your Workflows
Skills are more powerful than commands. They're reusable instruction sets that Claude remembers across sessions and can include templates, reference files, and scripts.
Create a skill at .claude/skills/content-calendar/SKILL.md:
---
name: content-calendar
description: Generate monthly content calendar with platform-specific posts
---
# Content Calendar Skill
When generating a content calendar:
1. Read brand voice from @/brand/voice.md
2. Check recent posts in @/content/published/ to avoid repetition
3. Reference content themes in @/strategy/themes.md
## Output Format
Create CSV with columns:
- Date
- Platform (LinkedIn/Twitter/Email)
- Content type
- Hook (first line)
- Full post
- CTA
- Hashtags (if applicable)
- Optimal posting time
## Platform Requirements
- LinkedIn: Max 1300 characters, professional tone, question or insight CTA
- Twitter: Max 280 characters, punchy, link in thread
- Email: Subject + preview text + body, under 300 words
## Verification
Count characters for each post. Flag any that exceed limits.
Claude now knows your content calendar workflow and can apply it whenever relevant — or you can invoke it directly. Skills can even specify which subagent to use for execution and include hooks that trigger automatically before or after certain actions.
Subagents: Parallel Marketing Workflows
One of Claude Code's most powerful features for marketing teams is subagents — specialized AI assistants that can work on tasks independently and in parallel. Claude can spin up to 7 subagents simultaneously.
What does this mean in practice?
- Content repurposing: One subagent writes the LinkedIn version, another writes the Twitter thread, a third creates the email newsletter — all at the same time from the same source material.
- Competitive research: Separate subagents analyze each competitor's landing page in parallel, then Claude synthesizes all results into a single comparison matrix.
- Campaign brief generation: One subagent researches audience data, another pulls past campaign performance, a third drafts the creative brief — then everything merges into one document.
You can also create custom subagents in .claude/agents/ with specific instructions. For example, a "brand-voice-checker" agent that reviews all content against your style guide before it's finalized.
Verification: The Key to Consistent Quality
The single highest-leverage thing you can do is give Claude a way to verify its own work.
Without verification, Claude produces output that looks right but might not work. With verification, it catches its own mistakes.
Verification Methods for Marketers
| Task | Verification |
|---|---|
| Social posts | "Count characters. Flag any over platform limits." |
| Email subject lines | "Check length under 50 chars. Test for spam trigger words." |
| Landing page copy | "Compare to our top-performing page. Score on headline clarity, CTA strength, proof points." |
| Campaign briefs | "Check all required sections are present. Verify budget adds up." |
Always tell Claude what "done" looks like:
Write 10 LinkedIn posts about B2B pricing psychology.
Requirements:
- Each under 1300 characters
- Hook must be counterintuitive or surprising
- End with a question CTA
- No hashtags in the post body (add as separate line)
Verification:
- Count characters for each post
- List which posts have the strongest hooks
- Flag any that feel generic
Keyboard Shortcuts You Should Know
| Shortcut | Action |
|---|---|
| Shift + Tab | Cycle through modes (Normal → Auto → Plan) |
| Esc | Stop Claude mid-action |
| Esc + Esc | Open rewind menu |
| Ctrl + G | Edit plan in text editor |
| Shift + Enter | Add newlines in your prompt |
| Ctrl + V | Paste images (not Cmd+V on Mac) |
| @ | Reference files: @path/to/file.md |
Common Mistakes to Avoid
Mistake 1: Never clearing context. You start with a campaign brief, then ask about social posts, then email sequences. Context fills up with irrelevant information. Fix: /clear between tasks.
Mistake 2: Skipping Plan Mode for complex work. You ask Claude to "create a go-to-market plan" without any research phase. Fix: Enter Plan Mode first, have Claude read your existing materials, then plan before executing.
Mistake 3: No CLAUDE.md. You explain your brand voice every single session. Fix: Set up CLAUDE.md once, and Claude remembers forever.
Mistake 4: No verification criteria. You accept whatever Claude produces without checking. Fix: Always include verification requirements in your prompts.
Mistake 5: One session for everything. You use the same session for days, filling it with unrelated context. Fix: Scope sessions to single projects. Use /rename and /resume to switch between them.
The Mindset Shift
"Forget it's called Claude Code. Think of it as Claude Local or Claude Agent. It's a super-intelligent AI running locally, able to do anything on your computer."
— Lenny Rachitsky
The marketers getting the most value from Claude Code treat it as a thought partner, not a content generator. They:
- Build systems, not just prompts
- Invest in CLAUDE.md and skills that compound over time
- Use Plan Mode for complex work
- Clear context aggressively
- Verify everything
Start with one workflow. Maybe it's campaign briefs, or content calendars, or competitive research. Master that, then expand.
MCP Integrations: Connecting Your Marketing Stack
Claude Code supports the Model Context Protocol (MCP), which lets it connect to external tools and services. For marketers, this opens up powerful integrations:
- Slack: Have Claude post campaign updates or content drafts directly to your team channels
- Google Drive: Pull assets, documents, and data directly from shared drives
- CRM tools: Pull customer data for personalized campaign targeting
- Analytics platforms: Fetch performance data to inform your next campaign brief
MCP servers are added with a simple command: claude mcp add [server-name]. Pre-configured OAuth credentials are available for popular services like Slack, so setup takes minutes, not hours.
Like Claude Code? Meet Your Chief AI Officer
Watch a 10-minute video where I build a website using only plain English. Then try it yourself.
Get the Free Blueprint href="/blueprint" class="cta-btn">Watch the Free Setup Video →rarr;