# PROJECT: chat-logger-plugin ## Purpose Provide a lightweight log of recent conversation turns so other hooks (notably mem0-auto-capture) can retrieve the previous assistant reply when storing a new user memory. ## Scope - Capture the last two turns (user + assistant) on `agent_end` - Resolve and cache `sessionKey` when available - Write JSON lines to `/tmp/openclaw-chat.log` ## Integration notes - mem0-auto-capture reads the log and uses `messages[1]` when `role === "assistant"`. - If the session key is missing or unknown, the hook will fall back to the latest assistant message globally. ## Operational notes - Keep `workspace/chat-logger-plugin` as the source of truth. - Ensure the gateway is restarted after edits.