Session Distiller
by @pjmorr
Batch-distill completed and live OpenClaw session transcripts into structured daily memory files. Two components: distill.py (batch + live session distillati...
Live Allowlist (LIVE_ALLOWLIST_KEYS)
In scripts/distill.py, the LIVE_ALLOWLIST_KEYS dict controls which sessions get live distill-in-place. Keys are session keys from sessions.json (stable across UUID rotations). Add entries as:
LIVE_ALLOWLIST_KEYS = {
"agent:main:telegram:group:-5166698025": "Claw & Order",
}
Key Paths
| Path | Purpose |
|---|---|
| ~/.openclaw/agents/main/sessions/ | Source session JSONL files |
| ~/.openclaw/agents/main/sessions/sessions.json | Session key β UUID index |
| ~/.openclaw/workspace/memory/ | Output daily memory files |
| prompts/distill.txt | LLM distillation prompt template |
| offsets.json | Live session offset tracker (runtime state, auto-created) |
| gate-state.json | Context gate per-session state (runtime state, auto-created) |
LiteLLM Endpoint
Distillation calls go to http://localhost:4000/v1/chat/completions with model claude-opus-4-6. Change the model or endpoint in the distill_transcript() function if needed.
clawhub install session-distiller