Scratchpad
Give the agent a writable scratch space for intermediate notes, plans, and computations — keeps internal working state out of the user-visible response.
Intent & Description
🎯 Intent
Give the agent a writable scratch space for intermediate notes that informs later turns but does not pollute the user-visible response.
📋 Context
A long task benefits from the agent writing things down as it goes — intermediate computations, plans, lists of unresolved questions, candidate options under consideration. None of this scratch work should be visible to the user; it’s the agent’s internal working surface.
💡 Solution
Provide a tool or convention for writing to a scratchpad (a section of the prompt, a tool call, a file). The agent reads from and writes to it across turns. The user-visible response is separate. The scratchpad is purged at task completion or expires with the session.
Real-world Use Case
- Long tasks benefit from intermediate notes that should not appear in user output.
- The agent needs to carry computations or unresolved questions across multiple turns.
- A separate writable space (tool, file, prompt section) can be added to the runtime.
Source
📌 TL;DR
Give the agent a separate writable space for working notes — internal reasoning persists across turns without bleeding into user output.
Advantages
- Intermediate work persists across turns without cluttering the user-facing output.
- Useful for chain-of-thought style reasoning that should remain internal.
Disadvantages
- Token cost grows with scratchpad size — large scratchpads eat context budget.
- Scratchpad becomes shadow state if not purged on task completion — carries stale information into future tasks.