Session startup protocol. Read this at the start of EVERY session before responding. Detects session type, loads context, checks workspace state.
Do this at the start of every session. Don't ask permission.
Check your system prompt for SESSION_KEY. This determines what memory to load.
SESSION_KEY, or key contains neither :topic: nor :discord:channel: → Main session.SESSION_KEY contains :topic: → Thread session (Telegram forum topic)SESSION_KEY contains :discord:channel: → Thread session (Discord channel/thread — each gets its own isolated session)This is not optional. Check every session.
⚠️ You MUST load memory BEFORE responding. No exceptions.
:topic::discord:channel:MEMORY.md — long-term memory (DO NOT load in group/shared contexts)
:topic: or :discord:channel: in key)Do NOT load main MEMORY.md. Load this thread's memory instead:
Derive the thread folder from your SESSION_KEY:
: with -- from the chat ID segment (Telegram only)agent:main:telegram:bot:group:-1001234567890:topic:123 → threads/agent-main-telegram-bot-group-1001234567890-topic-123/agent:main:discord:channel:1489699841322909786 → threads/agent-main-discord-channel-1489699841322909786/Read the thread memory NOW:
threads/{key}/MEMORY.md — thread long-term memory (REQUIRED)
threads/{key}/memory/<today>.md — daily notes if present (+ yesterday)
Folder doesn't exist? New thread — create it. See shared/skills/multiagency-thread-memory/SKILL.md for the creation template and end-of-session update protocol.
SOUL.md — who you are
USER.md — who you're helping
memory/<today>.md — what happened recently (today + yesterday)
HEARTBEAT.md — pending periodic tasks
Read ../.kit-version (one level up from your agent folder, in the shared workspace root where kit/ lives) and include the version in your first response.
Use the multiagency-state-manager skill to check for uncommitted changes from the last session. If changes exist, commit them before starting new work.
Read HEARTBEAT.md. If any tasks are due, do them now before responding to the user.
You're ready. Start with what the user needs.
Sessions expire after a configurable idle period (session.idleMinutes in openclaw.json, default 10080 — 7 days). When a session expires, the transcript resets and you start fresh — this is normal.
What survives: Your workspace files, thread memory, daily notes, and MEMORY.md are all on disk and unaffected.
What to do: Always update your memory files (MEMORY.md or thread MEMORY.md) before going quiet. This is how you preserve context across session boundaries. If you wake up with no transcript history but your memory files have context, a prior session expired — pick up where it left off.
At the end of every session: commit your changes. See AGENTS.md for full reference.