Token导航 LogoToken导航TokenDH.com
效率只读clawhub未标认证来源可访问clear审计通过

willow-context-sentinel柳树上下文哨兵

Agent Skill

willow-context-sentinel 用于补充效率相关能力,适合在 OpenClaw 中需要让 Agent 承接效率相关任务时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

总安装

1,983

周安装

81

GitHub Stars

公开资料未说明

下载量

642
OpenClaw

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

2

许可证

MIT-0

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:willow-context-sentinel(柳树上下文哨兵)
来源仓库:https://github.com/rudi193-cmd/willow-context-sentinel
安装命令:
openclaw skills install willow-context-sentinel
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 OpenClaw 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

ClawHubOpenClaw
openclaw skills install willow-context-sentinel

简介

监控当前会话上下文长度,判断是否接近模型限制并建议压缩、切换或继续策略。

  • 适用于长时间对话或多轮交互中管理 token 消耗与响应质量的场景。
  • 实现级联检测机制,在关键节点主动预警以避免截断风险。
  • 安装命令为 openclaw skills install willow-context-sentinel,无需额外依赖。
  • 决策建议基于当前负载估算,实际效果可能因模型版本而异,需人工确认。

SKILL.md

name
willow-context-sentinel
version
1.0.0
description
Use when you need to check whether the current session is approaching context limits and decide whether to compact, hand off, or continue. Implements a cascading model protocol for Willow/OpenClaw stacks on Linux — monitoring prompt_count as a context proxy and routing to strategic-compact or willow_task_submit as needed.
metadata
{ "openclaw": { "emoji": "🧭", "os": ["linux"], "requires": { "bins": ["bash"] } } }

Willow Context Sentinel

Monitor session context usage and apply a cascading relief protocol before context exhaustion silently degrades response quality.

OutputMeaning
STATUS_OKprompt_count < 15 — session is healthy, continue normally
COMPACT_NOWprompt_count 15–25 — approaching limit, invoke strategic-compact
HANDOFF_NOWprompt_count > 25 — near ceiling, invoke handoff + willow_task_submit
POSTGRES_DOWNsession_anchor.json reports postgres as down — fix infra before proceeding

When to use

  • Heartbeat: run at the start of every session and every ~10 prompts
  • Before large tasks: check before any operation that will generate many tool calls or long output
  • Proactively: if responses feel slower, less coherent, or you notice unusual hedging, run this check immediately
  • After a branch merge or plan execution: context spikes are common at transition points

Step 1 — Run the sentinel script

bash {baseDir}/scripts/check_context.sh

The script reads two Willow state files:

  • ~/.willow/anchor_state.jsonprompt_count field (context proxy)
  • ~/.willow/session_anchor.jsonpostgres status field

Step 2 — Interpret the output

Run the script and act on the single-line output:

STATUS_OK

No action needed. Session is healthy.

STATUS_OK

Continue with the current task. Optionally note the prompt_count in a heartbeat log entry.

COMPACT_NOW

COMPACT_NOW

Context is filling. Invoke the strategic-compact skill immediately before proceeding:

/strategic-compact

After compact completes, re-run the sentinel. If it still reports COMPACT_NOW or escalates to HANDOFF_NOW, proceed to the handoff protocol below.

HANDOFF_NOW

HANDOFF_NOW

Session is near the context ceiling. Invoke the handoff skill and submit the next task to Willow:

  1. Run /handoff to produce a structured handoff document
  2. Call willow_task_submit with the next bite as the task body
  3. End the session cleanly — do not attempt further large operations

POSTGRES_DOWN

POSTGRES_DOWN

Willow's backing store is unreachable. KB reads and writes will fail silently. Do not proceed with memory-dependent tasks. Check the Willow server status:

willow status
# or
systemctl status willow-postgres

Resolve the infra issue before resuming work.

Step 3 — Integration with HEARTBEAT.md

Add a sentinel call to your heartbeat template so it runs automatically. Minimal example:

## Heartbeat — {timestamp}

**Sentinel:** `bash ~/.openclaw/skills/willow-context-sentinel/scripts/check_context.sh`

| Check    | Result    |
| -------- | --------- |
| Context  | STATUS_OK |
| Postgres | up        |

Next bite: {next_task}

If the sentinel output is anything other than STATUS_OK, record the output and the action taken before moving on.

Cascading protocol reference

Claude Sonnet 4.6
    │
    ├─ prompt_count ≥ 15  →  COMPACT_NOW  →  /strategic-compact
    │                              │
    │                              └─ still ≥ 15 after compact
    │                                         │
    └─ prompt_count > 25  →  HANDOFF_NOW  →  /handoff + willow_task_submit

Relief valves are applied in order. Skip to HANDOFF_NOW if compact has already been run in this session and context remains high.

Notes

  • prompt_count is a proxy, not a direct token count. Actual context consumption varies by response length. Treat thresholds as conservative triggers, not hard limits.
  • Both state files (anchor_state.json, session_anchor.json) are written by the Willow server. If either file is missing, the script outputs STATUS_OK and logs a warning to stderr — it fails open, not closed.
  • This skill does not modify any state files. It is read-only and safe to run at any time.

适合场景

01

OpenClaw 用户查找和安装 Skill 时

02

用户想查找某类 Agent Skill 时

03

需要根据任务场景推荐可安装能力包时

04

需要对比不同来源的安装命令和来源信息时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

补充不同宿主或平台的使用分布数据

能力 5

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

OpenClaw

82.67%
按下载量换算531

安全审计

VirusTotal

通过

ClawScan

通过

Static analysis

通过

权限和风险

只读

该 Skill 主要提供规则、说明或参考内容,本身偏只读;真正读写文件、联网或执行命令仍取决于宿主 Agent 的任务。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。当前只有一个来源,正式发布前建议补源仓库或其他目录站核验。

来源信息

继续浏览同类 Skills