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.
1 source
- 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.
- Jul 19, 2026 · AWS — Machine Learning Blog
AWS launches Amazon Quick, an agentic AI assistant for sales workflows
Trust78 - Jul 18, 2026 · Latent Space — swyx
Lila Sciences details autonomous lab producing 10 trillion scientific reasoning tokens to train AI scientist
Trust72 - Jul 17, 2026 · VentureBeat — AI
Survey finds 71% of enterprises say fewer than a quarter of their deployed agents are multi-step workflows
Trust74