Every AI session starts with a blank slate.
The context window fills up. The session resets. Everything you built together β context, decisions, in-progress work β is gone.
Unless you designed around it.
The Wrong Way to Handle Session Resets
The instinct is to manually copy-paste summaries. Or clear files and reload them. Or re-explain everything at the start of each conversation.
That doesn’t scale.
Manual handoffs miss things. They compress context incorrectly. And they put the cognitive burden on you β the human β instead of the system.
The right mechanism in OpenClaw is /δΌ ζΏ (handoff). It runs a structured pipeline: reads active memory, writes a handoff document, archives what’s no longer needed. The next session picks up from there.
Manually clearing files doesn’t trigger this pipeline. The state doesn’t transfer. The agent starts over.
I learned this the hard way.
The File Architecture
My agent’s memory lives in a structured directory:
workspace/
βββ SOUL.md # Identity, principles, behavior rules β never changes
βββ USER.md # Who I am, preferences, constraints β rarely changes
βββ MEMORY.md # Active rules, project state, current priorities
βββ BOOTSTRAP.md # Session startup sequence
βββ KNOWLEDGE/
β βββ session-handoff.md # Current status, in-progress tasks, latest numbers
βββ archive/ # Completed handoffs, no longer in active context
Not every file gets read every session. That’s intentional.
Required vs. On-Demand
Loading everything every session wastes context. Most of it isn’t relevant to what you’re doing right now.
The system distinguishes two tiers:
Always read on startup:
SOUL.mdβ who the agent isUSER.mdβ who the user isMEMORY.mdβ current active rulessession-handoff.mdβ where we left off
Read only when triggered:
| File | When to read |
|---|---|
quant-derivatives/plan.md | Any trading system task |
quant-derivatives/devlog.md | Debugging or reviewing changes |
blog-dayou/plan.md | Writing or publishing posts |
.learnings/LEARNINGS.md | Before risky or repeated operations |
pre-action-checklist.md | Before deletions, live publishes, cron changes |
The agent reads what it needs. Nothing more.
New Project Startup Standard
Every new project gets three files on day one:
PROJECTS/project-name/
βββ plan.md # Goal, phases, success criteria
βββ devlog.md # Append-only log of every significant change
βββ archive.md # Decisions made, reasoning preserved
plan.md keeps the agent oriented. devlog.md means you never lose the thread of what changed and why. archive.md captures decisions so they don’t have to be re-litigated in every session.
The Core Insight
The agent doesn’t have memory.
It has files.
State lives in files, not in the context window. The context window is ephemeral. Files persist.
When the session resets, the agent reads the files. It reconstructs state. It picks up where it left off.
This only works if the files are kept current. Which means: after every significant action, write to the relevant file. Not at the end of the week. Not before the session closes. Immediately.
The agent that writes everything down forgets nothing.
The agent that relies on context forgets everything.
This content is for informational purposes only and does not constitute financial or investment advice. Cryptocurrency trading involves significant risk of loss. Trade responsibly.