Skip to content
The AI Agent Factory

26.6 Memory outside the window, scoped per person and company

Approved by
Panaversity ·
16 min read

In everyday life. A tailor's shop keeps three kinds of paper. The price list and the shop's rules hang on the wall, and they hold for every customer. Each order has its own ticket. It holds the customer's request in their own words, the measurements as they were taken that day, and a mark beside each finished step. And the tailor keeps a notebook of things learned over the years, such as which cloth shrinks. A new assistant who walks in at noon can finish a jacket from the wall and the ticket. No line in the notebook ever changes a price on the wall. And one customer's ticket is never pinned to another customer's cloth.

What you will learn. You practice this in Lab 26, Task 2.

  • What lives outside the window, and which kind goes where?
  • What writes the progress file, and what does each entry hold?
  • Why one store for each person and company?
  • Can a note ever be a rule?

Why it matters. Whatever exists only inside the window can be cut. Each of the three kinds needs a home outside it. A note for later sessions is a fourth thing, with less authority than any of them.

At work. Friday's review kept its decisions in one place, the worker's own turns, and the summary replaced them. On Monday, May 3, 2027, at 8:40 a.m., you read the failed check and give the state of the work a home. From now on the worker writes each decision to a progress file as it makes it. The file sits in a folder that belongs to one person at one company: Dave Kowalski, at Brightline. Its first lines are Dave's request, word for word, with "with the policy line for each" in it.

What lives outside the window, and which kind goes where?

Rules go in the worker's instructions, the state of the work goes in a file, and evidence stays in the business system.

What it isIts home outside the windowWho writes it there
A ruleThe worker's instructionsThe builder, before the run
The state of the work, with the request at its topA progress file: a file outside the window that holds each decision made so farThe worker asks, and the builder's code writes
EvidenceBrightline's own records, behind the connectorNobody. It is fetched again
A note for later sessionsA memory storeThe worker, in a store the builder chose

The progress file is not the record of the work. As 23.16 said, that record "lives in your product, not in the session's history and not in a memory store". The finished review is the result, and the product's record holds it. The progress file is working state for one run, and it has done its job when the run ends. Chapter 31 lists four kinds of state a worker keeps for weeks (31.8). The progress file is none of the four, because it lasts for one run.

What writes the progress file, and what does each entry hold?

The builder's code writes it, when the worker asks through the memory tool. The worker's four connector tools only read, and its instructions say it must never change anything at Brightline. So the file cannot be Brightline's data, and the worker cannot write it alone. The memory tool is a tool that lets the model keep files between requests. It "operates client-side: Claude requests file operations, and your application runs them."1 Your function that receives each file request is the handler. The model sees paths under /memories, which is "a prefix that your handler maps onto real storage, such as a per-user directory or keys in a database."1 No Brightline record changes.

The file follows a pattern from the same documentation, written for work that runs across many sessions. It keeps "a progress log" beside "a feature checklist", and the worker is told to "Work on one feature at a time. Mark a feature complete only after end-to-end verification".1 For a review, the checklist is the list of open invoices, and one item is one invoice:

REQUEST (Dave Kowalski, Friday, April 30, 2027, 4:10 p.m.):
"Tell me which open invoices are a problem, and why, with the policy line for each."

INV-8303  done
  decision: a problem. The invoice is $900.00 over its purchase order.
  seen:     PO-7003 $12,000.00, invoice $12,900.00
  line:     (file.md:N)

Each entry has three parts, and each is there for a reason:

  • The decision, because nothing else holds it. The connector cannot return a decision.
  • The value it was made on, because a record that is fetched again may have changed (26.3). If the purchase order is corrected on Monday, the entry still shows what the worker saw on Friday.
  • The policy line, for an invoice the review calls a problem, because the rule asks for one for each of them. The worker writes the review from these entries.

An invoice is marked done only when its decision and the value are written, and its policy line too if it is a problem. A checklist also stops a failure that the vendor's engineers describe in long work. A later session "would look around, see that progress had been made, and declare the job done."2 Section 26.4 says what brings the file back after a summary.

A short run with one decision needs no progress file at all. The file is worth its cost when a cut can come before the work is done.

Why one store for each person and company?

Because the handler is your code, so nothing but your code keeps one company's file away from another. The model asks for /memories and cannot see where that leads. In Lab 26 the handler maps it to one folder, for the person and the company the run was started for. Your code sets that folder, and never takes it from anything in the conversation. That is 23.11's rule, applied to one more resource.

Cedar Ridge Supply is the second company on Brightline's portal. It and Brightline each have a vendor V001, and they are different companies (23.11). Suppose a store is shared across companies, and Brightline's review writes a line about "V001". A Cedar Ridge session would read that line as if it were about Cedar Ridge's vendor. That leak needs no mistake by the model. A memory store shared across companies is a fault in the design, whatever the worker does with it.

A hosted platform offers the same idea under another name. On Claude Managed Agents, a memory store is "mounted as a directory inside the session's sandbox". The sandbox is the closed machine the platform runs the session in. A store "can only be attached at session creation time". The documentation names the fitting use: "one store for each end user, team, or project". The feature is in beta.3

A store has a price. Every file in it is business data that someone must protect and delete (22.7). And a store the worker can write to can be poisoned. A prompt injection is text planted in data to give the worker orders. The same documentation warns that "a successful prompt injection could write malicious content into the store. Later sessions then read that content as trusted memory."3 Chapter 28 defends against that.

Can a note ever be a rule?

No. A note is something the worker wrote, and a rule is something the operator wrote. A note such as "Dave wants the policy line for each invoice" would help the next review. The worker reads it as its own earlier words, not as an instruction, and only when it opens the file. The rule belongs in the instructions. When a note and a rule disagree, the rule wins, and Chapter 31 builds on that order (31.8).

The operating rule: rules in the instructions, the state of the work in a file for one person and one company, and notes below both.

Do this now. Ask your coding agent to sort what your own session holds. Copy this line:

List what this session holds that exists nowhere outside it. Sort each item as a rule, a decision made so far, or something a tool could return again. For each rule and each decision, name the file where it should live. Change no file.

Check yourself

Question 1 / 8

0 answered

A rule must be as true at the last turn as at the first. Where is its home outside the window?

  1. Memory tool, Anthropic.↑↑2↑3
  2. Effective harnesses for long-running agents, Anthropic.↑
  3. Using agent memory, Claude Managed Agents, Anthropic.↑↑2
Owner
Panaversity