Back to Examples

The Scratchpad Discipline Pattern

Why every serious agent session should start by writing to scratch/ and how to do it well.

PatternsBeginnermarkdown
Example Code
Rule: Before you touch any source file or run any command that has side effects, create or update scratch/current.md with:

- The user request (verbatim)
- Your current understanding / assumptions
- The plan (even if rough)
- What you will do first

This externalizes reasoning, makes recovery trivial when the agent gets confused, and gives humans full visibility.

Many of the highest-performing teams treat the scratch directory as sacred.

When to use this

Why every serious agent session should start by writing to scratch/ and how to do it well.