---
slug: "Scratchpad"
name: "Scratchpad"
type: "Memory"
layer: "Mind"
ref: "Scratchpad#626c"
sema_id: "sema:Scratchpad#mh:SHA-256:626c5a0a716ab29b51e68429d41e99619201af48d17975d89636b55b8dc852f5"
tags: ["Mind","Memory"]
updated: 2026-11-11
mindscape: "bootstrap"
index_url: https://mindscape.pages.dev/bootstrap/index.json
url: https://mindscape.pages.dev/bootstrap/Scratchpad/
related: ["Reflexion"]
---

# Scratchpad

Working memory for intermediate reasoning steps

Layer: Mind · Category: Memory

## Mechanism

A designated working memory region where the agent can write intermediate calculations, partial results, and notes-to-self during multi-step reasoning. Unlike the main output, scratchpad content is explicitly for the agent's own use and may be hidden from the final response. Prevents context pollution while enabling complex reasoning. It provides the persistence layer for chain-of-thought, storing the intermediate states of the reasoning process.

## Invariants

- Bounded by `max_size`, which every scratchpad declares.
- Persistence: contents survive across reasoning steps within a task.
- Separation: scratchpad content is distinct from final output.

## Failure modes

- Scratchpad leak: internal working notes reach user-facing output.
- Bound reached mid-reasoning: content must be dropped or summarised to continue, so earlier working is lost while the reasoning that depended on it continues.

## Data schema

```json
{
  "type": "object",
  "required": [
    "content",
    "max_size"
  ],
  "properties": {
    "content": {
      "type": "string",
      "description": "Working memory contents"
    },
    "max_size": {
      "type": "integer",
      "description": "Maximum allowed size in tokens"
    },
    "owner_id": {
      "type": "string",
      "description": "Agent that owns this scratchpad"
    }
  }
}
```

## Builds on

—

## Used by

- [Reflexion](https://mindscape.pages.dev/bootstrap/Reflexion.md) (Mind; References)

## Identity

- Sema ID: `sema:Scratchpad#mh:SHA-256:626c5a0a716ab29b51e68429d41e99619201af48d17975d89636b55b8dc852f5`
- Ref: `Scratchpad#626c`
- Supersedes:
  - `sema:Scratchpad#mh:SHA-256:e805c332532cf4a435c48cc87d4db771e1645bb52c47d00dce318e2619ca6749`

## Links

- [Pattern page](https://mindscape.pages.dev/bootstrap/Scratchpad/)
- [View in the interactive graph](https://mindscape.pages.dev/bootstrap/#Scratchpad)
- [JSON](https://mindscape.pages.dev/bootstrap/Scratchpad.json)
- [Index of all patterns](https://mindscape.pages.dev/bootstrap/index.json)
