← Back to library

Reddit 实战:会话“失忆 + 输入 token 暴涨”时的降载与记忆稳态方案

问题/场景:长会话中出现上下文漂移、输入 token 不断抬升。前置条件:已启用 memory 与 cron/heartbeat。实施步骤:先定位高消耗会话,再把长期信息沉淀到 MEMORY.md、把周期检查移到 heartbeat/cron,最后定期轮换活跃会话。关键命令:`openclaw status`、`openclaw gateway status`。验证:同类任务输入 token 曲线回落且记忆命中更稳定。风险:过度清理会切断必要上下文。

REDDITDiscovered 2026-02-15Author u/slippery_sausage69
Prerequisites
  • OpenClaw is already running with writable workspace memory files (MEMORY.md + memory/*.md).
  • You can inspect session usage and adjust heartbeat/cron behavior.
Steps
  1. Identify high-token sessions first: compare recent heavy turns and isolate recurring prompts that keep re-sending large context.
  2. Move stable facts (identity, preferences, long-lived decisions) into MEMORY.md; keep daily noise in memory/YYYY-MM-DD.md.
  3. Batch periodic checks through HEARTBEAT.md or cron jobs instead of repeated ad-hoc asks inside one long chat thread.
  4. For bloated threads, start a fresh session for new work chunks while preserving only required carry-over context as concise notes.
Commands
openclaw status
openclaw gateway status
Verify

Over 24h, repeated tasks show lower average input tokens and memory recall answers remain consistent with stored notes.

Caveats
  • Community report is symptom-driven; exact token savings depend on model/provider and task style(需验证).
  • If you rotate sessions too aggressively, hidden dependencies may be lost; keep explicit handoff summaries.
Source attribution

This tip is aggregated from community/public sources and preserved with attribution.

Open original source ↗
Visit original post