Skip to content

A long session often produces a small set of useful facts, decisions, and plans. The harness can lose that text when it compacts the window. Local memory lets the agent save structured notes as files that outlast a compaction and carry into the next session.

Turn on notes with extraction.enabled = true in the mount config.

With notes on:

  • The agent learns how to write a note, and saves one with a tool or a command.
  • Stash asks the agent for a note after a long stretch of new work, so the important part is saved before the window fills.
  • When no source keeps a copy of the notes, each session starts with a list of the notes of earlier sessions. After a compaction or a resume, the agent also learns where its own notes are.

Each note is one Markdown file in local/memories/. An integration that supplies a session ID puts the note in a folder for that session. Saving the same topic again in the same folder replaces the note.

A note has a title line and up to four sections, each at most once:

SectionWhat goes in it
## Key factsAn exact fact, when it’s true, and how it was found.
## WorkflowsA procedure worth reusing.
## DecisionsWhat was decided, and why.
## DiagnosisThe chain from symptom to cause, and each hypothesis with its status.

Notes don’t count against the cache budget, and they never expire. Subagents and later sessions read them like any other file.

Create stash.toml:

mount_point = "/tmp/ops-context"
[extraction]
enabled = true

Then create the ops mount:

Terminal window
stash create ops --config stash.toml
stash status ops

If the mount already exists, apply the config with stash update instead. Repeat stash status ops until it shows state: ready.

Save the mitigation plan for INC-4412 from a shell:

Terminal window
stash note save ops --topic "inc-4412 mitigation plan" <<'EOF'
INC-4412: checkout p99 latency, mitigation is to roll back deploy 2026-11-20.3
## Key facts
- p99 latency rose from 300 ms to 1.4 s after deploy 2026-11-20.3
(true when: us-east-1; evidence: latency dashboard and deploy history)
## Decisions
- Roll back before debugging, because the error budget is spent
(decided by: person; revisit if: rollback does not lower p99)
## Diagnosis
- hypothesis [open]: the new connection pool size starves the payment client
EOF
# Typical output:
# Saved /tmp/ops-context/local/memories/inc-4412-mitigation-plan.md