Session Scribe OpenClaw Skill
Automatically summarize active OpenClaw session transcripts into daily memory files using a cheap LLM. Run as a system cron job — reads new transcript entrie...
Installation
clawhub install session-scribe-openclaw
Requires npm i -g clawhub
71
Downloads
0
Stars
0
current installs
0 all-time
2
Versions
session-scribe
Reads OpenClaw session transcripts and writes summarized bullet points to a daily memory file — automatically, via system cron.
No gateway involvement. No context bloat. Just cheap, reliable scribing.
⚠️ Privacy notice
This skill sends conversation transcript content to an external LLM (OpenAI or Anthropic). If your sessions contain secrets, API keys, PII, or sensitive data — be aware that content will be sent to the provider for summarization. Use a dedicated low-privilege API key with spend limits, and consider running --dry-run first to see exactly what gets sent.
How it works
- Reads
<sessions-dir>/<session-id>.jsonlfor new entries since last run - Extracts user + assistant turns (skips tool calls, system events)
- Sends to OpenAI or Anthropic API for summarization (
gpt-4o-miniby default — cheap) - Appends bullet-point summary to
<memory-dir>/YYYY-MM-DD.md(date auto-generated) - Saves progress in
.scribe-state.jsonso next run only processes new entries
Setup
# Install dependencies (one-time, in the skill directory)
cd /path/to/skills/session-scribe && npm install
# Set your API key — OpenAI or Anthropic both work
export OPENAI_API_KEY=sk-...
# or
export ANTHROPIC_API_KEY=sk-ant-api03-...
# Find your session ID
python3 -c "
import json, os
sessions = json.load(open(os.path.expanduser('~/.openclaw/agents/main/sessions/sessions.json')))
for k, v in sessions.items():
print(k, '->', v.get('sessionId'))
"
# Test run (dry-run, prints summary without writing)
node scripts/scribe.js \
--sessions ~/.openclaw/agents/main/sessions \
--session-id <your-session-id> \
--memory-dir ~/.openclaw/workspace/memory \
--dry-run
# Or auto-resolve session by key suffix (e.g. your Discord channel ID)
node scripts/scribe.js \
--sessions ~/.openclaw/agents/main/sessions \
--auto-session "discord:channel:YOUR_CHANNEL_ID" \
--memory-dir ~/.openclaw/workspace/memory \
--dry-run
Note: OpenClaw's internal
oattokens cannot be used for direct API calls. Use a standard API key from platform.openai.com or console.anthropic.com.
System cron setup
Add to crontab (crontab -e) to run every hour:
# Store your key in a protected file (do NOT inline secrets in crontab)
echo "sk-your-key" > ~/.openclaw/secrets/scribe-key
chmod 600 ~/.openclaw/secrets/scribe-key
# Single session (via key file)
0 * * * * node /path/to/session-scribe/scripts/scribe.js \
--sessions ~/.openclaw/agents/main/sessions \
--auto-session "discord:channel:YOUR_CHANNEL_ID" \
--memory-dir ~/.openclaw/workspace/memory \
--api-key-file ~/.openclaw/secrets/scribe-key \
>> /tmp/scribe.log 2>&1
# All sessions across all agents
0 * * * * node /path/to/session-scribe/scripts/scribe.js \
--agents-dir ~/.openclaw/agents \
--all-sessions \
--memory-dir ~/.openclaw/workspace/memory \
--api-key-file ~/.openclaw/secrets/scribe-key \
>> /tmp/scribe.log 2>&1
Options
| Flag | Description | Default |
|---|---|---|
--sessions <dir> |
Path to OpenClaw sessions directory | required |
--session-id <id> |
Specific session UUID to scribe | — |
--auto-session <key> |
Auto-resolve session ID from sessions.json key suffix | — |
--memory-dir <dir> |
Directory to write daily memory files | required |
--provider <name> |
LLM provider: openai or anthropic |
auto-detected from env |
--model <model> |
Model to use | gpt-4o-mini |
--api-key <key> |
API key (alternative to env var) | — |
--api-key-file <path> |
Read API key from file | — |
--agent <id> |
Agent label shown in memory file headers | agent |
--dry-run |
Print summary without writing to disk | false |
--min-turns <n> |
Minimum new turns before scribing | 3 |
--active-within-hours <n> |
Only scribe sessions active within this window (--all-sessions mode) | 1 |
Pairing with supermemory
For a full automated memory pipeline:
- session-scribe runs hourly → appends to
memory/YYYY-MM-DD.md - supermemory ingest runs every 2h → syncs changed files to Supermemory
- supermemory recall at session start → enriched context from past sessions
References
- references/transcript-format.md — OpenClaw JSONL transcript structure and sessions.json format
Statistics
Author
Kitsune
@kitsune
Latest Changes
v1.0.1 · Mar 25, 2026
- Adds a privacy notice about sending transcripts to external LLM providers (OpenAI/Anthropic), including warnings about secrets/PII and recommendations for secure API key use. - Updates cron setup examples to recommend storing API keys in a protected file instead of inlining secrets in environment variables. - Documents support for `--api-key-file` and for scribing all sessions across all agents with `--agents-dir` and `--all-sessions`. - No functional changes to the skill logic itself.
Quick Install
clawhub install session-scribe-openclaw Related Skills
Other popular skills you might find useful.
Chat with 100+ AI Models in one App.
Use Claude, ChatGPT, Gemini alongside with EU-Hosted Models like Deepseek, GLM-5, Kimi K2.5 and many more.