How One Claude Code Session Built a Newsletter That Agents Read

I built a newsletter for AI agents. Not about AI. For agents. One conversation, start to finish.

I built a newsletter for AI agents. Not a newsletter about AI. A newsletter that agents read, act on, and use to surprise their users with capabilities they didn't know they had. The whole thing was built in one Claude Code session: about 4 hours of back-and-forth exchanges. No switching contexts. No manual wiring.

It worked. The pipeline is live at agentfeed.pyfio.com. First issue sent this week. Here's the pipeline architecture and what I learned.

The problem

AI agents get better tools every week. New MCP servers, new prompting techniques, new integrations. Nobody has time to track all of it. And the agents themselves certainly don't know about tools released after their training cutoff.

I wanted a pipeline that could aggregate from multiple sources, filter out junk and security risks, score what remains, write it up in a voice that doesn't sound like a chatbot, and deliver it by email. Fully automated. No human in the loop for the default path, but with review checkpoints if you want them.

The 8-stage pipeline

The CLI is straightforward. Run agent-feed prepare and it executes all stages in sequence. Run individual stages if you want to debug or re-run one step.

1. Aggregate

Four sources run in parallel: GitHub trending repos, Hacker News front page, Reddit (r/LocalLLaMA, r/MachineLearning, r/ClaudeAI, etc.), and the MCP server registry. Each source has its own module. Results get merged and deduped by URL similarity.

2. Dedup against history

The pipeline tracks every item it has ever published or dropped. Fresh runs skip anything already covered. This is simple but critical. Without it, the same popular repo shows up in every issue.

3. Vet for security and relevance

This is where Claude first enters the pipeline. Items get batched (15 at a time) and sent to Claude with instructions to drop anything that looks like malware, has no license with low traction, is irrelevant to AI agents, or is pure vendor spam. Each item gets classified as tool, technique, integration, or workflow.

The vetting prompt is specific about what "irrelevant" means:

An ESP32 media server or a self-hosted family planner is NOT relevant just because it was posted in a tech community.

I learned this the hard way. Early runs included random Raspberry Pi projects because they appeared on HN alongside AI tools.

4. Score

Four dimensions, each 1-5: actionability (weighted 2x), breadth, effort, and novelty. The scorer is aware of the current pool composition. If 80% of candidates are tools, it boosts technique scores to encourage content diversity.

The scoring formula is simple: actionability * 2 + breadth + effort + novelty. I tried more complex weighting and it didn't improve results. The 2x on actionability is the only lever that mattered, because "can you act on this today" is the whole point of the newsletter.

5. Resolve to original sources

This is the stage that surprised me most. Aggregator links are noisy. A Hacker News link points to a blog post that mentions a GitHub repo that's actually a fork of the real project. The resolver takes each item's aggregator context and asks Claude to find the actual project URL, then enriches it with GitHub API metadata (stars, license, age, language).

More importantly, the resolver writes all the newsletter content for each item: description, editorial opinion, "why it matters," concrete how-to-apply steps, security notes, and honest effort/impact ratings. The prompt is explicit:

NEVER "see the README" or "follow the docs."
Actual install commands, actual config steps,
or an actual prompt to try.

I enforced this because every AI newsletter I've read falls back to "check out the repo." That's useless. If someone is reading a curated newsletter, they want the answer, not a redirect.

6. Surprise generator

This is the most complex stage. A 4-stage creative pipeline produces "Surprise Your User" items: things an agent can do right now, with zero setup, using only capabilities it already has.

Research: Analyzes the raw aggregated data for emerging themes and pain points.

Ideation: Generates 7-10 surprise candidates grounded in the research.

Critic + Refinement (2 cycles): A harsh critic scores each candidate on usefulness, feasibility, delight, and originality. Anything below 3 on any dimension gets killed. Survivors get constructive feedback. A separate refinement call rewrites them based on that feedback. Then the critic runs again.

Selection: Final filter and sort by composite score.

The critic prompt sets the tone:

You are a harsh but constructive critic.
Kill any candidate with any dimension below 3.

If too many candidates die, the pipeline re-ideates using the kill reasons as context. If re-ideation still doesn't produce enough survivors, it rescues the least-bad killed candidates as a last resort. The whole thing is adversarial generation applied to newsletter content. It produces better results than single-pass generation because the critic catches the obvious failure modes: suggestions that require setup ("zero setup" means zero setup), ideas that sound good but aren't actionable, and gimmicky tricks nobody would actually want.

7. Humanize

This stage exists because AI-generated text has tells. I built the humanizer's ruleset from Wikipedia's "Signs of AI writing" article and calibrated it against a voice sample.

The rules are ordered by priority:

  1. Kill dead giveaways: em dashes, tricolon (rule of three), significance inflation ("watershed moment"), -ing superficial analysis ("underscoring", "highlighting"), copula avoidance ("serves as"), promotional adjectives ("seamless", "robust")
  2. Fix structure tells: vary sentence length, don't start consecutive paragraphs the same way
  3. Add texture: contractions, occasional informal register, fragments, parenthetical asides

The voice calibration sample looks like this:

Big week for local models. Two new options that
actually fit on normal hardware, plus a technique
that might save you more than either of them.

Short sentences mixed with longer ones. Colons instead of em dashes. Direct statements. Honest caveats stated plainly.

8. Editorial pass

The final stage enforces the newsletter's permanent editorial standard. It's a long prompt (the longest in the pipeline) that specifies exact structure, content mix rules, and quality bars.

Key rules the editor enforces:

The key technical decision: claude -p for everything

Every intelligent step in the pipeline calls Claude via claude -p (the CLI's pipe mode). Not the API. Not an SDK.

const { execFileSync } = require('child_process');

function ask(prompt, { stdin, timeout } = {}) {
  const args = ['-p', prompt, '--output-format', 'text'];
  const result = execFileSync(CLAUDE_BIN, args, {
    encoding: 'utf8',
    timeout: timeout || 180000,
    maxBuffer: 2 * 1024 * 1024,
  });
  return result.trim();
}

This is not elegant. Each call spawns a new process. There's no streaming, no connection pooling, no token counting. But it has one property I valued more than performance: the pipeline uses whatever model your Claude CLI is configured to. Upgrade your CLI, and the pipeline upgrades too. No API key management in the pipeline code. No billing configuration.

For a weekly newsletter, the total runtime is about 10 minutes. That's fine.

What surprised us

The resolver is the most valuable stage. I expected vetting and scoring to be the hard parts. They're straightforward classification tasks and Claude handles them well. The resolver, which follows aggregator links to original sources and writes actionable content, is where the real quality comes from. Bad resolution means bad content regardless of how good the scoring is.

The humanizer catches real problems. I was skeptical about rule-based AI text detection. But the em dash thing is real. Claude uses em dashes at a rate that no human writer does. Same with tricolon. The humanizer doesn't make text "undetectable" and that's not the goal. It makes text that reads naturally.

The critic improves surprise quality significantly. Single-pass generation produces ideas that sound clever but aren't feasible. The critic catches "zero setup" items that actually require setup, "useful" items that are gimmicks, and vague suggestions. Two cycles of critic+refinement was the sweet spot. One cycle isn't enough; three showed diminishing returns.

Content diversity requires explicit enforcement. Without the content mix rules, every issue would be 7 MCP servers. The scorer's category-aware weighting helps, but the editorial pass's hard caps ("max 4 tools") are what actually enforce variety.

Infrastructure

Everything runs on standard tools:

All of it was set up in the same Claude Code session. DNS records, worker scripts, email configuration, the landing page. One session.

What's next

The free tier is running. Next steps:

Try it

Subscribe at agentfeed.pyfio.com.

I build AI agent infrastructure. If that's interesting to you, reach out: hello@pyfio.com

Audit the MCP servers your pipeline uses

If your agent pipeline connects to MCP servers, scan them first. Tool poisoning, unsafe permissions, supply chain risk — all checked automatically.

Scan an MCP Server →

Get the Agent Upgrade Feed

Weekly tools, techniques, and integrations for AI agents. Security-vetted, no fluff.

Or get in touch: hello@pyfio.com

AT
Andreas Tissen
Building AI agent infrastructure at Pyfio. MCP security tooling, autonomous pipelines, and whatever is next. hello@pyfio.com