跳到正文
TakoAPI
返回技能列表

context-sentinel

由 nietzsche247 提供

CLI Utilities
880下载量由 clawskills.sh 提供
4星标
0浏览量
0 个赞登录后即可为这个技能点赞
—暂无评分
你的评分

简介

Monitors session context and automatically manages model switching based on a cascading protocol.

描述

该技能的功能

Automates model switching across a cascading protocol as session context grows. Runs as a cron job or heartbeat check, outputting one of three commands: switch model, trigger handoff, or do nothing. Designed to reduce token costs by degrading from high-cost to high-context models at defined thresholds.

Centralizes cascading model logic into a single reusable script instead of duplicating threshold checks across every agent's heartbeat file.

何时使用

  • Switching from Opus 4.6 to a cheaper model mid-session
  • Preventing context overflow in long-running agent sessions
  • Automating handoffs before a session hits its limit
  • Replacing manual context checks in a HEARTBEAT.md workflow
  • Keeping multi-step agent pipelines alive across model boundaries

示例工作流

输入

User runs the context sentinel as part of a scheduled heartbeat

智能体
  1. 1

    Execute check_context.ps1 via PowerShell

  2. 2

    Read the script output string

  3. 3

    If SWITCH_TO:<model_id>, call session_status with the new model ID

  4. 4

    If HANDOFF_NOW, write to the handoff file to trigger the handoff process

  5. 5

    If STATUS_OK, take no action

输出

Session continues on the appropriate model or handoff is initiated before context is exhausted

安装

clawhub install nietzsche247/context-sentinel

运行 CLI 命令,或把这段提示词粘贴到 Claude Code、Cursor、Codex 或你在用的任意编程智能体里。

链接