First run the tests

AI-generated summary of reporting by Simon Willison’s Weblog. Read the original for the full story.

Why it matters

A four-word prompt, 'first run the tests', has become a practical discipline for keeping AI-generated code from breaking in production.

Read this as

Simon Willison argues that automated tests, small programs that check whether software works, are essential when using AI coding agents like Claude Code, because untested AI code often fails when deployed. He starts every agent session with the prompt 'First run the tests,' which makes the agent locate and run the existing test suite. This also teaches the agent about the codebase and pushes it to write its own tests. No benchmarks or product details are given.

Willison's guidance addresses the main risk of AI-assisted development: code that was never executed may not work in production. His remedy costs little, instructing agents like Claude Code to run existing tests at the start of every session. Teams without test suites lose a key safeguard and a way for agents to learn their codebase. The article is opinion and practice, not a product announcement or pricing news.

Willison recommends starting every coding-agent session with 'First run the tests' or, for his Python projects, 'Run "uv run pytest"' via pyproject.toml dependency groups. The prompt forces the agent to discover the test harness, which reveals project size and complexity, biases it toward testing its own changes, and exposes it to tests as codebase documentation. It complements his red/green TDD pattern. No benchmarks, metrics, or limitations are provided.

Read the original

This summary exists to save you time, not to replace the source.

Key terms

Simon Willison Claude Code pytest pyproject.toml uv

Was this summary useful?

One click, anonymous. It tells us which summaries to re-run.

Related reading