Automatically logs every conversation message to workspace/chat/YYYY-MM-DD.md. Creates new files if needed, always appends never overwrites.
A minimal skill for logging conversation messages to daily Markdown files.
Automatically log every user message and assistant reply to a daily Markdown file.
workspace/chat/YYYY-MM-DD.md[HH:MM:SS]
User: <message>
Assistant: <reply>
The agent should manually log each conversation turn using this logic:
const fs = require('fs');
const path = require('path');
const os = require('os');
// Get workspace path
const workspace = process.cwd(); // or your workspace path
const chatDir = path.join(workspace, 'chat');
// Create directory if it doesn't exist
if (!fs.existsSync(chatDir)) {
fs.mkdirSync(chatDir, { recursive: true });
}
// Get current date for filename
const now = new Date();
const dateStr = now.toISOString().split('T')[0]; // YYYY-MM-DD
const timeStr = now.toTimeString().split(' ')[0]; // HH:MM:SS
const logFile = path.join(chatDir, `${dateStr}.md`);
// Format log entry
const userMsg = /* get user message */;
const assistantMsg = /* get assistant reply */;
let logEntry = `\n[${timeStr}]\n`;
if (userMsg) {
logEntry += `User: ${userMsg}\n`;
}
if (assistantMsg) {
logEntry += `Assistant: ${assistantMsg}\n`;
}
// Append to file
fs.appendFileSync(logFile, logEntry);
[14:30:00]
User: Hello, how are you?
Assistant: I'm doing well, thank you for asking!
[14:32:15]
User: What's the weather like today?
Assistant: Let me check the weather for you.
workspace/chat/YYYY-MM-DD.md
Example:
C:\Users\user\OpenClawWorkspace\chat\2026-03-07.md
To use this skill:
chat/ directory structure to your workspaceSKILL.md - This fileREADME.md - ClawHub package readmeMIT
ZIP package — ready to use