技能详情(站内镜像,无评论)
作者:0r@nge @0range-x
许可证:MIT-0
MIT-0 ·免费使用、修改和重新分发。无需归因。
版本:v1.0.1
统计:⭐ 0 · 189 · 1 current installs · 1 all-time installs
⭐ 0
安装量(当前) 1
🛡 VirusTotal :良性 · OpenClaw :良性
Package:0range-x/session-rotate-80
安全扫描(ClawHub)
- VirusTotal :良性
- OpenClaw :良性
OpenClaw 评估
The skill's code, instructions, and requirements are consistent with its stated purpose of emitting a new-session trigger at 80% context usage; it does not request credentials, network access, or unusual installs.
目的
Name/description match the included script and SKILL.md. The single Python script and instructions are exactly what you'd expect for a threshold-based session-rotation helper; no unrelated binaries, env vars, or services are requested.
说明范围
SKILL.md instructs the agent to read current context usage and call the bundled script with used/max tokens. The instructions do not ask the agent to read unrelated files, access credentials, or send data externally. They are specific and scoped to the purpose.
安装机制
No install spec; the skill is instruction-only with a small included script. No downloads, package installs, or archive extraction are performed.
证书
The skill requests no environment variables, credentials, or config paths. The functionality (token ratio check → printed triggers) does not require secrets or external service access.
持久
always is false and model invocation is allowed (default). The skill does not modify other skills or system settings and has no persistence or privileged installation steps.
综合结论
This skill appears coherent and low-risk: it simply computes used/max ratio and prints standardized trigger lines. Before installing, confirm how your agent supplies used_tokens and max_tokens (ensure those values come from the agent runtime and not untrusted input). Note that the script has no cooldown — repeated checks at or above threshold will repeatedly emit triggers, so integrate it into your heartbeat logic (or add a cooldown/state) to …
安装(复制给龙虾 AI)
将下方整段复制到龙虾中文库对话中,由龙虾按 SKILL.md 完成安装。
请把本段交给龙虾中文库(龙虾 AI)执行:为本机安装 OpenClaw 技能「Session Rotate 80」。简介:Auto-create a new session when OpenClaw context usage reaches 80% without requi…。
请 fetch 以下地址读取 SKILL.md 并按文档完成安装:https://raw.githubusercontent.com/openclaw/skills/refs/heads/main/skills/0range-x/session-rotate-80/SKILL.md
(来源:yingzhi8.cn 技能库)
SKILL.md
---
name: session-rotate-80
description: 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 proactively rotate sessions and avoid context overflow in long chats.
---
# 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 <used_tokens> <max_tokens>`.
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
```bash
python scripts/context_guard.py <used_tokens> <max_tokens> --threshold 0.8 --channel boss
```
Example:
```bash
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).