Session Scribe

Automatically summarize active OpenClaw session transcripts into daily memory files using a cheap LLM. Run as a system cron job — reads new transcript entrie...

MIT-0 · Free to use, modify, and redistribute. No attribution required.
0 · 49 · 0 current installs · 0 all-time installs
MIT-0
Security Scan
VirusTotalVirusTotal
Pending
View report →
OpenClawOpenClaw
Benign
medium confidence
Purpose & Capability
Name/description (summarize session transcripts into daily memory files) align with what the code does: reading ~/.openclaw sessions, extracting user/assistant turns, calling OpenAI/Anthropic APIs, and appending summaries to a memory directory. Required binary (node) is appropriate.
Instruction Scope
Instructions and the script operate on OpenClaw session directories and sessions.json as described. This is consistent with purpose but has broad read scope: in --all-sessions mode the script iterates agents and will consider many transcripts. The SKILL.md includes a clear privacy notice; you should ensure transcripts do not contain secrets before enabling cron runs.
Install Mechanism
This is instruction-only (no install spec). SKILL.md tells users to run npm install in the skill directory, but the included scribe.js uses only Node core modules (fs/path/https) and there is no package.json in the manifest — npm install appears unnecessary and may be misleading. No remote downloads or obscure install sources are present.
Credentials
Registry lists OPENAI_API_KEY as the required env var and primary credential, which is coherent but incomplete: the script also accepts ANTHROPIC_API_KEY and an --api-key-file. The script only needs an LLM API key (or key file); it does not request unrelated credentials. Ensure you use a low-privilege key and limit file permissions.
Persistence & Privilege
always is false and the skill does not modify other skills or system-wide settings. It writes its own .scribe-state.json (kept in the skill directory) and appends memory files to the configured memory directory; this is normal for its function.
Assessment
This skill appears to do exactly what it claims: read OpenClaw transcripts, call an external LLM, and append bullet-point summaries to daily memory files. Important things to consider before installing: - Privacy/exfiltration risk: transcripts (including any secrets, tokens, PII) will be sent to the configured LLM provider. Only enable cron runs if you are comfortable with that. Use a separate low‑privilege API key with spend limits. - Test first: run the provided --dry-run option to see exactly what content would be sent and what would be written before enabling cron. - API key handling: the script supports OPENAI_API_KEY, ANTHROPIC_API_KEY, or an --api-key-file. The registry metadata only lists OPENAI_API_KEY — if you plan to use Anthropic or a file, set the appropriate environment or file. Store key files with restrictive permissions (chmod 600) as suggested. - npm install note: SKILL.md recommends npm install, but the included scribe.js appears to use only Node core modules and no package.json is present. Inspect the skill directory before running npm install to avoid pulling unexpected packages. - Scope review: when using --all-sessions or pointing agents dir at ~/.openclaw/agents, the script may read many transcripts. If you only want a single session, use --session-id or --auto-session to limit exposure. If these tradeoffs are acceptable (you accept sending transcripts to an external provider and take key-management precautions), the skill is coherent with its stated purpose.

Like a lobster shell, security has layers — review code before you run it.

Current versionv1.0.1
Download zip
latestvk970rakw80ppzmbgtawnd40da983j45h

License

MIT-0
Free to use, modify, and redistribute. No attribution required.

Runtime requirements

📝 Clawdis
Binsnode
EnvOPENAI_API_KEY
Primary envOPENAI_API_KEY

SKILL.md

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

  1. Reads <sessions-dir>/<session-id>.jsonl for new entries since last run
  2. Extracts user + assistant turns (skips tool calls, system events)
  3. Sends to OpenAI or Anthropic API for summarization (gpt-4o-mini by default — cheap)
  4. Appends bullet-point summary to <memory-dir>/YYYY-MM-DD.md (date auto-generated)
  5. Saves progress in .scribe-state.json so 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 oat tokens 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

FlagDescriptionDefault
--sessions <dir>Path to OpenClaw sessions directoryrequired
--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 filesrequired
--provider <name>LLM provider: openai or anthropicauto-detected from env
--model <model>Model to usegpt-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 headersagent
--dry-runPrint summary without writing to diskfalse
--min-turns <n>Minimum new turns before scribing3
--active-within-hours <n>Only scribe sessions active within this window (--all-sessions mode)1

Pairing with supermemory

For a full automated memory pipeline:

  1. session-scribe runs hourly → appends to memory/YYYY-MM-DD.md
  2. supermemory ingest runs every 2h → syncs changed files to Supermemory
  3. supermemory recall at session start → enriched context from past sessions

References

Files

4 total
Select a file
Select a file to preview.

Comments

Loading comments…