GenAI Unplugged

GenAI Unplugged

Claude Code Content System: Full AI System Pipeline From Research to Publish

Build a complete Claude Code content pipeline - research, draft, review, repurpose - for ~$1.50 per article. Full architecture, real outputs from a real test run, and the drop-in scaffold.

Dheeraj Sharma's avatar
Dheeraj Sharma
Apr 30, 2026
∙ Paid

I built four pieces in this Claude Code masterclass or full course series. They all work. AND they're not connected.

In Lesson 1, we built a content multiplier. In Lesson 2, the four-layer extension stack with CLAUDE.md, skills, hooks. In Lesson 3, MCP servers connected to live data. In Lesson 4, three agents running in parallel.

Each lesson solved one problem. They were still four pieces sitting in separate folders. Today we snap them together into one integrated content pipeline that handles topic research, drafting, review, and platform-specific repurposing while I focus on creating. (If you've seen my content multiplication approach using n8n, this is the Claude Code version. Fewer moving parts. Same output.)

By the end of this article, you'll have a complete system architecture you can replicate, real outputs from a real test run on my pipeline, the monthly cost numbers, the actual time savings, and the honest list of things I still do manually because automation isn't the right answer for them.

This is Lesson 5 of the Claude Code Masterclass. The capstone practical lesson.

👋 Julley, I'm Dheeraj, an AI systems builder.

I build production-grade AI systems at work by day and ship my own products by night, 9 and counting, including SubflowAI and the Content OS Agents Toolkit. This newsletter is the bridge between those two worlds. Every system, every build, documented step by step.


Join 1,800+ builders getting the exact AI setups, prompts, and workflows that actually work in your business.

SUBSCRIBE

Claude Code Masterclass - Full Course

  1. AI Content Multiplication System

  2. The Claude Code Extension Stack

  3. MCP Servers and Automation Hooks

  4. Build a 3-Agent AI Research Team

  5. The Full AI Content System Pipeline ← You are here

  6. Create a Claude Code Plugin

  7. Claude Code Channels (Telegram, Discord)


The assembly line that assembled itself

Think about the difference between a woodworker who has a great saw, a great drill, and great sandpaper in three different sheds versus one who has them all in the same workshop, arranged in order of operations.

Same tools. Same quality. But the second woodworker doesn't spend 20 minutes walking between sheds for every project. The tools are positioned so the output of one step feeds directly into the next.

That's what this lesson does. We're not building new tools. We're positioning the ones we already have so they work as a single workflow, with skills as the labels on each station and CLAUDE.md as the floor plan.


The complete architecture

Six layers. Every component is there for a reason.

Six-layer architecture: CLAUDE.md feeds context to four user-invocable skills, each connecting to its own agent with separate context, plus MCP servers, hooks, and a headless trigger panel

Layer 1: CLAUDE.md

Project memory. Loaded at every session start. Holds the file conventions, brand voice rules, and slug derivation logic that every skill and agent in the project relies on.

Layer 2: Skills

Four user-invocable slash commands. /research $TOPIC, /draft $TOPIC, /review, /repurpose $PATH. Six lines of markdown each. Discoverable via / in any session. Pass arguments through $ARGUMENTS.

Layer 3: Agents

Four specialists with separate context windows. Researcher (Sonnet), Writer (Sonnet + brand-voice preloaded), Reviewer (Sonnet, permissionMode: plan), Multiplier (Sonnet, three-platform output).

Each agent has a tool list scoped to its job. The reviewer literally cannot edit, because disallowedTools: Edit is enforced by the system prompt regardless of what your prompt says.

Layer 4: MCP servers

External intelligence wired only to the researcher. Perplexity for search. Firecrawl for clean page extraction. Notion for content calendar (optional). The other three agents do not need internet access, so they do not get it.

Layer 5: Hooks

Deterministic, fire on every Edit/Write regardless of permission mode. block-dangerous.sh (PreToolUse on Bash) blocks rm -rf and git push --force. format-on-save.sh (PostToolUse) runs prettier on saved markdown.

quality-check.sh (PostToolUse) flags forbidden phrases ONLY on drafts/*-draft.md files longer than 1,000 words. The dual guard is the fix for the writer-hook feedback loop, more on this below.

Layer 6: Headless mode

The same skills you run interactively also run from outside the terminal via claude -p. Three patterns I actually use, covered in detail below.


Skills, not just agents: why wrap a slash around the work

Lesson 4 already showed you the researcher, writer, and reviewer agents running directly. So why wrap them in manual invocable slash-skills (previously Claude Slash commands)?

Three reasons that stack:

  1. Discoverability. Type / in Claude Code and the skill list pops up. New project, fresh context, you don't need to remember the agent's name or its preferred prompt. Skills surface their description line so the choice is obvious.

  2. $ARGUMENTS parameterization. A skill (slash commands) takes whatever follows the slash command and injects it as $ARGUMENTS in the body. /research Claude Code hooks tutorial and /research n8n vs Make pricing route through the same scaffolding. Direct agent invocations need you to write the framing each time.

  3. Shareable. A .claude/skills/research/SKILL.md file is six lines of markdown. Drop it in any teammate's project, the skill works. Direct prompt patterns live in your head.

The agents from Lesson 4 are still doing the heavy lifting. The skills are the doorbell, not the house.

Share GenAI Unplugged


Permission modes: control without surprises

Three modes Claude Code exposes:

  • default asks permission for bash commands, file edits, and external tool use. Use it for normal interactive work.

  • acceptEdits auto-approves file edits, still asks for bash commands. Use it for trusted pipeline runs where you don't want to click approve on every save.

  • plan is read-only, cannot edit anything. Use it for research and exploration, and bake it into the reviewer agent's frontmatter so the reviewer cannot rewrite what it's reviewing.

  • auto-mode (released March 2026) is a “safer” alternative to manual approval, using an AI classifier to automatically approve safe, routine actions (like file reads) while blocking risky ones (like mass deletions). It serves as an intermediate, configured with autoMode settings, between constant manual prompts and risky, total skip-permissions, enabling faster autonomous coding.

I start every project, feature or major bug fix in plan-mode. My general setup sits in acceptEdits for most of the day. When running the full pipeline on a trusted project, I switch to auto-mode. The reviewer’s agent file pins permissionMode: plan so it can’t drift even if I forget.

The hooks from Layer 5 are an extra layer. Even in acceptEdits, the dangerous-command hook still blocks rm -rf and git push --force because hooks fire regardless of permission mode. Modes control consent. Hooks enforce policy.


Commercial break: Claude Code Builder cohort

The founding batch of my Claude Code cohort starts in July on Maven. Four weeks, six sessions. Learn to build the AI system with me.

Only 12 Seats. When they’re gone, the founding price ($797) closes and Cohort 2 opens at $1,597.

Use code GENAI20 for 20% off. Expires July 9. Check the Syllabus →


Headless mode: Claude Code without the terminal

The -p flag turns Claude Code into a non-interactive command. Pipe a prompt in, get the output back, no chat session.

echo "Research the topic 'AI content workflows'" | claude -p

That single change opens up scheduling, automation, and event-driven patterns. Three I actually run:

Pattern 1: Cron-driven competitor scrape (every Monday 8am)

#!/bin/bash
# weekly-research.sh
cd /path/to/your/project

echo "Use the researcher agent to check what our top 3 competitors
published this week. Save a summary to
drafts/weekly-intel-$(date +%Y-%m-%d).md" | claude -p \
  >> logs/weekly-research.log 2>&1

Cron line: 0 8 * * 1 /path/to/weekly-research.sh. Five minutes of compute, replaces my Monday-morning ritual of opening seven tabs.

Pattern 2: n8n webhook to draft trigger

When a new row drops into my Notion content calendar, n8n catches the webhook, pulls the topic, and pipes it into Claude Code:

echo "/research $TOPIC && /draft $TOPIC" | claude -p \
  --permission-mode acceptEdits

Twenty minutes later there's a draft sitting in drafts/ waiting for me to read. n8n stays as the event glue (it's better at scheduling and webhooks). Claude Code does the writing (it's better at writing).

Pattern 3: GitHub Action that runs (/review) on a PR

Every pull request to my content repo runs:

- name: Review draft
  run: |
    git diff origin/main HEAD -- 'drafts/*.md' \
      | xargs -I {} echo "/review {}" \
      | claude -p \
      > review-output.md
- uses: peter-evans/create-or-update-comment@v4
  with: { body-path: review-output.md }

PR comment is posted before I even open the tab. The reviewer agent already has permissionMode: plan, so it can't accidentally push a fix it shouldn't.

The pattern across all three: events from outside Claude Code, work done by the same skills you'd run interactively, output deposited where the next system in your stack expects it.


/repurpose, not /distribute

A naming callout that matters more than it sounds.

/repurpose generates platform-specific copy. A LinkedIn post. An X thread. Three Substack Notes. It writes them to distribution/{slug}/*.md. That is repurposing.

/repurpose does NOT push that copy to LinkedIn, X, or Substack. It does not log into anything. It does not schedule. That is distribution. Distribution is a separate problem that needs API tokens, scheduling, error handling, retry logic, and a way to track what shipped vs what's queued.

I built and ship a real distribution engine. It uses n8n + each platform's posting API and runs on a schedule with retry logic. The build for that is a separate article in the future, likely n8n-driven, possibly Claude-Code-orchestrated. Not this lesson.

This lesson stops at the point where the platform-specific copy is sitting on disk in three files. You take it from there with whatever publishing flow you already have, or wait for the distribution-engine article to drop.

My Social Media Distribution n8n Workflow

That distribution engine is a future post. What ships in this article is everything up to the moment the platform-specific copy lands on disk: the four skills, four agents, three hooks, three headless wrappers, the example run files, all wired together.


Building all four pipeline skills, the four agents, the three hooks, the three headless wrappers, and the state-conventions document from scratch takes about 3 hours of plumbing plus another hour of debugging interaction-point bugs before you get a clean end-to-end run. The four lessons before this one are the build instructions if you want to learn every layer by hand.

The project scaffold is the convenience layer for people who want to skip the plumbing and start running the pipeline today. PluggedIn unlocks the full folder, the example run files, and the headless wrappers, all ready to drop into your project.

Get PluggedIn


The data flow of AI Content System

A skill body that says "the most recent research brief in drafts/" is only useful if the convention behind it is unambiguous. Mine is boring on purpose.

Data flow: a topic enters /research, becomes a brief, becomes a draft, becomes a review, splits into three distribution outputs. File-naming rules below.

Slug derivation: lowercase the topic, hyphenate spaces, strip non-alphanumeric, truncate to 60 chars. Claude Code hooks tutorial becomes claude-code-hooks-tutorial. /draft derives the same slug from its argument and looks for drafts/{slug}-research.md. Same input means same slug means correct file every time.

The CLAUDE.md file at the project root spells out this convention as a rule the skills can rely on. Without it, /draft would either ask "which research brief?" every time (kills the keystroke advantage) or silently pick the wrong file (kills the trust advantage).

The immutability rule matters more than people think. Once the next stage has run against a *-research.md or *-draft.md, do not modify it. Re-run the upstream skill instead. This is what keeps the pipeline reproducible across sessions, across team members, and across re-runs three weeks later when you've forgotten what you did the first time.


Real outputs from my own pipeline

These are not mockups. I ran the full pipeline against the topic Claude Code hooks tutorial while writing this article. Every file below was generated by the scaffold project that ships with this lesson. The full versions are in the scaffold's examples/ folder. Excerpts here.

What /research produced (865 words, 8 citations, 5 minutes)

drafts/claude-code-hooks-tutorial-research.md:

## Existing coverage

- Anthropic official docs (docs.anthropic.com/en/docs/claude-code/hooks).
  Reference, not tutorial. Full event schema, matchers, JSON I/O.
- DataCamp tutorial (datacamp.com/tutorial/claude-code-hooks, 2026-01-19).
  Most-shared standalone tutorial. Covers 10 events, beginner-friendly.
  Significantly outdated: official docs now list 25+ events.
- GitHub: disler/claude-code-hooks-mastery. Most-cited practitioner repo.
  Documents 8 events with JSON payloads and exit code behavior.

## Competitor gaps

- Event count is wrong everywhere. DataCamp says 10. The scaffold reference
  card says 17. Official docs (April 2026) list 25+, including PostToolBatch,
  PermissionDenied, CwdChanged, FileChanged, WorktreeCreate, Elicitation.
  No published tutorial reflects the current state.
- The writer/hook feedback loop pitfall is undocumented. This is the bug
  where a quality-check hook fires on every intermediate save, Claude
  rewrites the file to fix the warning, which triggers the hook again.
  No developer-focused tutorial covers it because it only bites content
  pipelines.

The researcher agent caught a real, current factual error in the most-shared tutorial (DataCamp says 60s timeout, the docs say 600s) and built the brief around correcting it. That contradiction became the angle for the draft.

What /draft produced (2,908 words, 8 minutes)

drafts/claude-code-hooks-tutorial-draft.md opened with:

Working with a map of a country that's already been redrawn.

Most published tutorials on Claude Code hooks list 10 events. The current Anthropic docs list 25 plus. The DataCamp tutorial that ranks for the keyword tells you the default timeout is 60 seconds. It is 600. Three different numbers for the same thing, and only one of them is current.

The writer agent picked up the contradiction the researcher flagged and turned it into the hook formula. No "in today's fast-paced world" intro. Specific numbers in the first three sentences.

What /review produced (1,437 words, 3 minutes)

drafts/claude-code-hooks-tutorial-review.md returned:

Score: 9/10
Recommendation: NEEDS MINOR REVISION

Top 3 fixes:
1. Six [VERIFY: ...] markers in the event-list section. Writer flagged
   uncertainty about whether `mcp_tool` is the exact official type name.
   Resolve before publish.
2. Key takeaway bullets are missing the bold lead phrase pattern.
3. No dedicated troubleshooting block at the end. Add or merge into pitfalls.

BLOCKERS: None.

The reviewer caught the writer's honest VERIFY markers (a feature, not a bug, the writer flags uncertainty rather than fabricating), missed the bold-lead-phrase convention, and noticed a structural gap. Three concrete fixes I could apply in 10 minutes.

What /repurpose produced (4 minutes, three files)

distribution/claude-code-hooks-tutorial/linkedin.md:

25+ Claude Code hook events. Most tutorials cover 10.

The DataCamp tutorial from January 2026 lists 10 events. The scaffold I shipped last month said 17. Anthropic's official docs as of April 2026 list 25+. Three different numbers. Only one is current.

distribution/claude-code-hooks-tutorial/notes.md (one of three):

Most hook tutorials answer the wrong question.

They tell you WHAT the hook should do. Format the file. Block the command. Flag the phrase. Easy.

The expensive question is WHEN.

The multiplier picked the contrarian angle out of the draft (one note), the number-driven angle (LinkedIn), and the personal-pain story (X thread).

Twenty minutes of compute. ~$1.00 of API spend. Four files I would have spent three hours producing manually. And the hook in each piece was sharper than what I usually write on a good day, because the multiplier had the entire 2,908-word draft to mine for the strongest line.

Leave a comment


What it costs

Eight articles a month through the full pipeline:

Cost per article through the full pipeline: about $1.50. Check Anthropic's current pricing for the latest rates.

The number that matters is the second-order one. At $1.50 per article, "should I run the pipeline on this?" stops being a cost decision and becomes a quality decision.


Why this matters

Two months of running this system, comparing to the manual workflow it replaced:

  • Articles per month

    • Before: 4-5

    • After: 8

  • Time per article (research → distribution)

    • Before: 3-4 hours

    • After: ~45 minutes

  • Self-assessed content quality

    • Before: Variable (6-10/10)

    • After: Consistent 8+/10

  • Distribution per article

    • Before: Often skipped

    • After: Always generated

  • Monthly tool cost

    • $20 (Claude Pro subscription)

  • Hours on content per month

    • Before: 16-20

    • After: 8-10

The biggest impact isn’t any single number. It’s the consistency. Before the system, my output varied based on whether I remembered the brand rules, whether I was tired, whether I cut the research phase to save time.

Now every article goes through the same research, writing, review, and repurpose pipeline. The floor is higher, even on a bad day.


What NOT to automate

Not everything belongs in the pipeline. Here's the matrix I actually use:

I built a dedicated competitive-analysis agent for the gap-finding cell. The "final pick" cell is non-negotiable. Topic selection is the only place in the pipeline where I want a human reading reader feedback, scanning the calendar, and choosing what's next.

The frame: automation handles the reproducible work. Research, first drafts, formatting, quality checks, repurposing mechanics. The strategic and creative work stays manual.

That's not a limitation of the system. That's the design.


When the pipeline fights itself: three interaction-point pitfalls

The first time I ran the full pipeline end-to-end, the writer agent and the quality-check hook got into a feedback loop. Hook flags a phrase, Claude Code feeds it back to the writer, writer rewrites, hook flags a different phrase. Six rounds on a single paragraph before I caught it.

The fix was two lines of bash in the hook:

WORD_COUNT=$(wc -w < "$FILE_PATH" 2>/dev/null || echo "0")
if [ "$WORD_COUNT" -lt 1000 ]; then
  exit 0
fi

The hook now ignores intermediate saves and only audits when the file is long enough to be a real draft. Two more pitfalls I've since hit at the same kind of seam:

Race conditions in parallel runs

When /research and a separate background task both write to drafts/, "the most recent file" depends on filesystem timestamps that can collide on fast disks. Fix: each skill writes with a slug prefix, and /draft looks for *-research.md matching the explicit topic argument, not just "most recent of any file".

Memory drift across sessions

Agent memory (memory: project in the frontmatter) is wonderful when it remembers your voice. It's a problem when it remembers a stale rule. After a CLAUDE.md change, manually clear the relevant memory file once, or you spend a week wondering why the writer keeps using a phrase you removed from the brand guide three days ago.

The lesson under all three: when you combine systems, the bugs live in the handoffs, not inside any one component. The hook is correct. The writer is correct. The interaction is the bug.


Everything inside this Content Pipeline System folder

That's the system. Now here's what you'll walk away with if you keep reading.

The complete content-pipeline-scaffold/ folder. Drop it into any directory, set three API keys, edit one brand-voice file, and you're running the full research → draft → review → repurpose loop in 15 minutes.

Here's what's in the folder:

The brain

  • CLAUDE.md - 200 lines of project memory. Pipeline state conventions, slug derivation rules, brand voice principles, cost expectations, and the explicit list of what this scaffold does NOT do (no publishing, no topic selection, no replacement for human editing). Every skill and agent reads this file at session start.

Four Claude skill files

  • .claude/skills/research/SKILL.md - /research $TOPIC with $ARGUMENTS scaffolding

  • .claude/skills/draft/SKILL.md - /draft $TOPIC wired to the writer agent with brand-voice preloaded

  • .claude/skills/review/SKILL.md - /review wired to the reviewer with permissionMode: plan baked in

  • .claude/skills/repurpose/SKILL.md - /repurpose $PATH for explicit-path safety

  • .claude/skills/brand-voice-check/SKILL.md - auto-invocable, fires on every Write

Four Claude agent files

  • .claude/agents/researcher.md - Sonnet + Perplexity + Firecrawl MCP

  • .claude/agents/writer.md - Sonnet, brand-voice skill preloaded, memory: project

  • .claude/agents/reviewer.md - Sonnet, permissionMode: plan, disallowedTools: Edit

  • .claude/agents/multiplier.md - Sonnet, three-platform output spec

Three production hooks

  • .claude/hooks/block-dangerous.sh - PreToolUse on Bash, blocks rm -rf, git push --force, drop table, fork bombs

  • .claude/hooks/format-on-save.sh - PostToolUse on Edit/Write, runs prettier on .md files in drafts/ and distribution/

  • .claude/hooks/quality-check.sh - PostToolUse on Edit/Write, the dual-guard hook (file matches drafts/*-draft.md AND word count >= 1,000) that fixes the writer/hook feedback loop

The wiring

  • .claude/settings.json - connects hooks, sets permission defaults, allowlists the project paths

  • .mcp.json - Perplexity, Firecrawl, Notion server stubs (env-var based, ready to copy your keys into)

Two starter templates

  • templates/brand-voice.md - the only file you must edit. Voice rules, hook formulas, forbidden patterns, article structure

  • templates/research-profile.md - optional, but turns the researcher into your researcher (your tracked topics, your trusted sources, your filters)

Three headless wrappers

  • headless/weekly-research.sh - cron-ready Monday competitor scrape with logging

  • headless/n8n-headless-trigger.md - n8n recipe: Notion row → /research + /draft via claude -p

  • headless/github-action-review.yml - GitHub Action that posts /review as a PR comment

Real example outputs

  • examples/claude-code-hooks-tutorial-research.md - 865-word brief with 8 citations

  • examples/claude-code-hooks-tutorial-draft.md - 2,908-word draft

  • examples/claude-code-hooks-tutorial-review.md - full review report (9/10 score, 25 checklist items)

  • examples/distribution/claude-code-hooks-tutorial/linkedin.md + x-thread.md + notes.md

These are the files I generated while writing this article. They are the proof above, in the ## Real outputs section. Open them in the scaffold and trace through what each agent did at each stage.

Plus the README - a 5-step install guide, troubleshooting, cost tables, and a section on what the scaffold does NOT do (so you do not ship it expecting features it does not have).

What you’ll feel after implementing

Article 1 will feel like a faster way to type the same prompt. Article 5 will feel like having a research partner. Article 30 will feel like having a system that catches what you would have missed on a tired Friday.

Get PluggedIn

You have the architecture, the data flow, the cost, and the proof. The drop-in scaffold that makes it run is one click away.

Get PluggedIn

See what’s included →


What you need to run it

Anthropic API key (or Pro / Max subscription). Perplexity API key (free tier is 1,000 requests/month, enough for ~50 articles). Firecrawl API key (free tier 500 pages/month, enough for ~100 articles). 15 minutes for installation. ~30 minutes to customize templates/brand-voice.md to your voice.

You don't need n8n. You don't need a separate scheduler. You don't even need the Notion MCP unless you want to wire your content calendar in. The pipeline runs against any topic you type, on any project you drop the scaffold into.


How to Set Up Your AI Content System (Step by Step)

Step 1: Download the full system

The full content-pipeline-scaffold/ folder is below. Drop it into any directory. Every file is ready to use. Three keys. One file to edit. Everything else drops in.

This post is for paid subscribers

Already a paid subscriber? Sign in
© 2026 Dheeraj Sharma · Privacy ∙ Terms ∙ Collection notice
Start your SubstackGet the app
Substack is the home for great culture