| name | session-logger |
|---|---|
| description | Maintain persistent session memory across restarts. Appends messages to a SESSION-MEMORY.md file with automatic rotation (keeps last N messages). Use after every user message and agent response to log conversation context. Triggers on session logging, memory persistence, context recovery, session continuity, or when asked to "log this", "remember this exchange", or ensure conversation survives restarts. |
Lightweight session continuity via file-based message logging with rotation.
A Python script appends timestamped messages to SESSION-MEMORY.md and rotates old entries (default: 10 messages). Zero API cost — runs entirely locally.
python3 SKILL_DIR/scripts/log-session.py "<role>" "<message>"role: e.g.🧑 Useror🤖 Agentmessage: brief summary of the exchange
Read SESSION-MEMORY.md to recover conversation context. The file contains the last N exchanges with timestamps.
Zero config needed. Default file: ~/.openclaw/workspace/SESSION-MEMORY.md
Optional env vars:
SESSION_LOG_FILE— custom path (e.g. Obsidian vault)SESSION_MAX_MSGS— rotation size (default: 10)
File is auto-created on first run with proper template.
- Add to agent startup: read the log file before responding
- Add to agent response loop: call script after each exchange
## Последние сообщения
**[HH:MM]** 🧑 User: что-то сказал
**[HH:MM]** 🤖 Agent: что-то ответил
## Текущий контекст
- Key state info
- Active tasksThe #1 failure mode is forgetting to log. Follow this order strictly:
- Received message → log immediately (
🧑 User: ...) - Process and respond
- Response sent → log immediately (
🤖 Agent: ...)
Never defer logging to "the end of the turn" — it will be forgotten.
- Keep messages brief — summaries, not transcripts
- Log both sides (user + agent) for full context
- The script is idempotent — safe to call multiple times
- Add a checklist reminder to agent instructions: "Response not complete until logged"