← 返回
效率工具 中文

Session Rotate 80

Auto-create a new session when OpenClaw context usage reaches 80% without requiring Mem0 or file memory systems. Use when users want default OpenClaw to proa...
当 OpenClaw 上下文使用率达到 80% 时自动创建新会话,无需使用 Mem0 或文件内存系统。适用于用户希望 OpenClaw 自动管理会话的场景。
0range-x
效率工具 clawhub v1.0.1 1 版本 100000 Key: 无需
★ 0
Stars
📥 537
下载
💾 6
安装
1
版本
#latest

概述

Session Rotate 80

Overview

Trigger a standard [NEW_SESSION] message when context usage reaches 80%.

This skill is memory-system-agnostic and works in plain default OpenClaw setups.

Workflow

  1. Read current context usage from runtime status.
  2. Run scripts/context_guard.py .
  3. If threshold reached, output the new-session trigger and handoff hint.
  4. Keep old session only for short handoff, then continue in new session.

Command

python scripts/context_guard.py <used_tokens> <max_tokens> --threshold 0.8 --channel boss

Example:

python scripts/context_guard.py 220000 272000 --threshold 0.8 --channel boss

Expected Output

At or above threshold:

  • [ROTATE_NEEDED]
  • [NEW_SESSION] 上下文达到80%(used/max),自动切换新会话
  • [HANDOFF_HINT] ...

Below threshold:

  • [ROTATE_NOT_NEEDED] ratio=x.xx < 0.800

Integration Hint (Heartbeat)

In heartbeat flow, after reading context usage:

  1. Call context_guard.py.
  2. If [ROTATE_NEEDED], emit [NEW_SESSION]... directly.
  3. Stop handling new tasks in old session except handoff confirmation.

scripts/

  • scripts/context_guard.py: threshold detector and trigger emitter (no memory dependency).

版本历史

共 1 个版本

  • v1.0.1 当前
    2026-03-30 15:39 安全 安全

安全检测

腾讯云安全 (Keen)

安全,无风险
查看报告

腾讯云安全 (Sanbu)

安全,无风险
查看报告

🔗 相关推荐

productivity

Weather

steipete
获取当前天气和预报(无需API密钥)
★ 445 📥 226,325
ai-intelligence

Triple Layer Memory

0range-x
三层记忆系统自动管理长对话记忆,支持跨会话检索、结构化存储和智能压缩,提升记忆连续性与上下文管理效率。
★ 0 📥 744
productivity

Word / DOCX

ivangdavila
创建、检查和编辑 Microsoft Word 文档及 DOCX 文件,支持样式、编号、修订记录、表格、分节符及兼容性检查等功能。
★ 439 📥 147,745