Skip to content
Agents · Apr 18, 2026

How a three-part prompt guided Claude Code to build a feature for newsletter content

Simon Willison demonstrates how to structure agentic prompts by walking through his successful use of Claude Code to add beat-type content to a blog-to-newsletter tool—emphasizing reference codebases, clear validation mechanisms, and explicit testing instructions.

Trust67
HypeLow hype

1 source

ShareXLinkedInEmail
TL;DR
  • Willison used a short three-part prompt with Claude Code to add support for 'beats' (a new content type on his blog) to his blog-to-newsletter tool, resulting in a working pull request on first attempt
  • The prompt strategy included: cloning a reference repository to /tmp for context, specifying the exact file to modify and the desired behavior (imitate the Atom feed logic), and providing explicit test and validation commands
  • Claude Code autonomously added a SQL UNION clause to fetch beats with descriptions and generated a correct beat-type display mapping by reading the Django ORM definition in the reference codebase
  • Willison emphasizes that coding agents perform best with a validation mechanism and that using another codebase as reference is an efficient way to communicate complex requirements with minimal prompt overhead

Willison operates a personal blog and publishes weekly newsletters via Substack by fetching his latest content via a custom HTML and JavaScript tool that converts blog posts into formatted HTML for copy-paste into the Substack editor. Recently, he introduced a new content category on his blog called 'beats'—items like open-source releases, newly built tools, and museum visits—that he wanted to include in the newsletter.

To extend his blog-to-newsletter tool to surface beats with descriptions, Willison prompted Claude Code using three interconnected instructions: first, clone his blog repository to /tmp as a reference, second, modify the newsletter tool to include beats matching the logic already used in his site's Atom feed, and third, run the tool locally and validate the output against his blog homepage using browser automation. The prompt itself was notably compact.

Claude Code executed all three steps successfully. It added a UNION clause to the blog's SQL query that filters beats to only those with a user-added note and not marked as draft, and it independently derived the correct mapping of beat types to display names by reading the Django ORM definition in the cloned reference repository. The resulting pull request required no revision.

Willison's approach reveals two key principles: coding agents benefit from an explicit validation target they can test against (in this case, comparing newsletter output to live blog content), and providing a reference codebase is more efficient than trying to describe complex logic in prose. The pattern suggests that agentic programming succeeds when developers establish clear success criteria and reduce the interpretive burden on the model.

Sources
  1. 01Simon Willison's WeblogAdding a new content type to my blog-to-newsletter tool
Also on Agents

Stories may contain errors. Dispatch is assembled with AI assistance and curated by human editors; despite the trust-score filter, mistakes happen. We correct publicly — every article links to its revision history. Nothing here is financial, legal, or medical advice. Verify before relying on any claim.

© 2026 Dispatch. No ads. No sponsorships. No paid placement. Reader-supported via Ko-fi.

Built by a person who cares about honest AI news.