Part 1 of 6 · 1 min read
Overview
Module 3 shrank a long history by summarising it, and module 4 pulled stored memories back in by search. Both keep text in or near the window. A third option is to keep the big data outside the window altogether, in a file, and put only a short pointer in the window. A tool result can be dropped from the window and fetched again, but only if the tool can be run again with the same result; a file makes that unconditional. The data is saved once, the stub names the path, and the agent can read it again without calling the tool a second time. This module builds that, measures what it saves, and shows the limit of the other file habit, the scratchpad.
About the example, and what is real
Everything runs offline in code/mini-workspace. Real: the workspace uses real files in a real directory; path confinement (including symlinks), atomic writes, capped reads and grep are real code, tested against real escape attempts. Imitated: the agent. It is deterministic: it flags lines that start with RESULT, writes nothing else to notes, and picks which file to grep by matching the question's topic to the stub's first line. A model makes those choices with errors. The tool outputs are generated logs of about 1,000 tokens with one flagged line and one unflagged detail. Tokens use the rough counter from module 1. No real model is called, so the numbers describe how designs compare here, not how a real agent behaves.