The Bleeding Edge

// Content pipeline · May 24, 2026

Content Pipelines

An AI-built newsletter and podcast publishing system

ai-builtpodcastpythonclaude-code
Content Pipelines hero

Updated 28 September 2026. This case study was written in May. Three things have changed since then, and are corrected below. Newsletters are now read over IMAP instead of OAuth. The Substack email-to-draft step never worked. The source repository is private. The project's current state, proof and starter prompts are on the Research Content Pipeline page.

What this is

A Python pipeline that runs every Friday at 04:00 CET on a self-hosted GitHub Actions runner. It reads 18 AI newsletter subscriptions from one Gmail inbox over IMAP, calls claude -p headless to draft a weekly briefing plus deep-dive articles plus three newsletter formats, pushes everything to the site, and emails both hosts a run report.

This very site is the front-end for that pipeline. The episode briefings you see at /episodes and the articles at /articles are produced by the pipeline — not hand-written. The Friday morning sequence is: pipeline runs, content lands on disk, git push fires Vercel auto-deploy, you get a Slack-style email saying it's live.

What AI does

Claude (via the claude -p CLI in headless mode) does the heavy editorial work — synthesizing the week's newsletter intake into a structured briefing, expanding flagged stories into deep-dive articles with three different role-lensed framings (CEO, CIO/CTO, AI transformation lead), and re-cutting the briefing into three distinct newsletter formats (executive roundup, devices weekly, LLM weekly). Each generation is a separate prompt template living in friday-pipeline/prompts/.

What I did

Built the orchestrator. Picked Python stdlib for everything I could (tomllib, pathlib, subprocess, smtplib, dataclasses) to keep the dependency surface tiny. Designed the editorial-as-code constraint — voice, role lenses, format rules all live as markdown the pipeline reads. Hardened the failure-stop policy: any uncaught exception aborts before publishing, on the theory that a missed Friday is fine but a half-published one is not.

What surprised me

The cost. The pipeline runs through my Claude Code Max subscription via subprocess to the claude CLI — no API key, no per-token billing. Total marginal cost per weekly run: $0. The scheduled runner is a machine I already own, so that's free too.

One thing that didn't work: the original design emailed each newsletter to Substack as a draft. The pipeline reported success every week, but in September we found that no draft had ever arrived, because the address it sent to only takes replies. The lesson: a success message from your own code isn't proof. Check the destination.

The runner-up surprise was the reliability problem. Markdown produced by an LLM is structurally similar to markdown produced by a human, but the failure modes are different: stray horizontal rules being mistaken for frontmatter closers, line endings flipping between platforms, slugs accidentally double-prefixed. The defensive validators in the markdown writers were not optional.

// Media