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 is
  • USER.md β€” who the user is
  • MEMORY.md β€” current active rules
  • session-handoff.md β€” where we left off

Read only when triggered:

FileWhen to read
quant-derivatives/plan.mdAny trading system task
quant-derivatives/devlog.mdDebugging or reviewing changes
blog-dayou/plan.mdWriting or publishing posts
.learnings/LEARNINGS.mdBefore risky or repeated operations
pre-action-checklist.mdBefore 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.