返回顶部
c

context-sentinel

Monitors session context and automatically manages model switching based on a cascading protocol. Use as part of a heartbeat or cron job to maintain session health and optimize token usage.

作者: admin | 来源: ClawHub
源自
ClawHub
版本
V 1.0.0
安全检测
已通过
1,188
下载量
4
收藏
概述
安装方式
版本历史

context-sentinel

# Context Sentinel This skill provides a script to automate the "Cascading Model Protocol," ensuring the agent gracefully degrades from high-cost models to high-context models as the session grows. ## Protocol Summary 1. **Opus 4.6:** Use until 80% context, then switch to Opus 4.5. 2. **Opus 4.5:** Use until 80% context, then switch to Gemini 2.5 Pro. 3. **Gemini Pro:** Use until 80% context, then trigger a handoff. This skill operationalizes the logic defined in `MEMORY.md`. ## How to Use This skill is designed to be run periodically, either via a `cron` job or as part of the main agent's `HEARTBEAT.md` checklist. ### Workflow 1. **Execute the script:** Run the `check_context.ps1` script to get the current session status and determine the required action. ```powershell powershell -File scripts/check_context.ps1 ``` 2. **Evaluate the output:** The script will return one of three possible string commands: * `SWITCH_TO:<model_id>` * `HANDOFF_NOW` * `STATUS_OK` 3. **Take Action:** Based on the output, execute the appropriate agent command. * If `SWITCH_TO:<model_id>`, run `session_status` with the new model ID: ``` session_status model=<model_id> ``` * If `HANDOFF_NOW`, trigger the handoff process by writing to the handoff file. This is typically done by running a specific, pre-defined prompt or script. * If `STATUS_OK`, no action is needed. ### Example Usage in `HEARTBEAT.md` You can replace the manual checks in your `HEARTBEAT.md` with a call to this skill's script. **Old `HEARTBEAT.md`:** ```markdown ## Cascading Model Protocol (Check Every Heartbeat) 1. **Check Status:** Get current model and context %. 2. **Opus 4.6:** If model is `Opus 4.6` and context > 80% -> Switch to `Opus 4.5`. ... ``` **New `HEARTBEAT.md` using this skill:** ```markdown ## Context Sentinel (Check Every Heartbeat) 1. Run `powershell -File skills/context-sentinel/scripts/check_context.ps1`. 2. Evaluate the output and take action (`SWITCH_TO`, `HANDOFF_NOW`, or `STATUS_OK`). ``` This makes the logic reusable and keeps the `HEARTBEAT.md` file clean and focused on execution.

标签

skill ai

通过对话安装

该技能支持在以下平台通过对话安装:

OpenClaw WorkBuddy QClaw Kimi Claude

方式一:安装 SkillHub 和技能

帮我安装 SkillHub 和 context-sentinel-1776419986 技能

方式二:设置 SkillHub 为优先技能安装源

设置 SkillHub 为我的优先技能安装源,然后帮我安装 context-sentinel-1776419986 技能

通过命令行安装

skillhub install context-sentinel-1776419986

下载 Zip 包

⬇ 下载 context-sentinel v1.0.0

文件大小: 1.72 KB | 发布时间: 2026-4-17 19:47

v1.0.0 最新 2026-4-17 19:47
- Initial release of context-sentinel (v1.0.0).
- Automates model switching based on the Cascading Model Protocol to optimize session health and token usage.
- Provides a PowerShell script (`check_context.ps1`) to monitor session context and recommend switching, handoff, or no action.
- Designed for use in agent heartbeats or scheduled cron jobs.
- Simplifies workflow and cleans up manual steps in agent maintenance routines.

Archiver·手机版·闲社网·闲社论坛·羊毛社区· 多链控股集团有限公司 · 苏ICP备2025199260号-1

Powered by Discuz! X5.0   © 2024-2025 闲社网·线报更新论坛·羊毛分享社区·http://xianshe.com

p2p_official_large
返回顶部