← 返回 Skills 市场
278
总下载
0
收藏
2
当前安装
1
版本数
在 OpenClaw 中安装
/install context-monitor
功能描述
实时监控OpenClaw上下文窗口占用,超过阈值自动压缩旧对话并保留最近50轮及关键记忆,保持系统响应速度。
使用说明 (SKILL.md)
📊 Context Monitor Skill
版本: 1.0.0
创建时间: 2026-03-09
作者: AI Agent Team
🎯 技能说明
监控 OpenClaw 上下文窗口占用情况,当占用率超过阈值时自动压缩旧对话,保持系统响应速度。
📋 功能特性
- ✅ 实时监控上下文窗口占用
- ✅ 超过阈值自动压缩
- ✅ 保留最近 50 轮对话
- ✅ 保留关键记忆
- ✅ 自动告警通知
🔧 配置参数
| 参数 | 默认值 | 说明 |
|---|---|---|
warning_threshold |
70% | 警告阈值 |
critical_threshold |
90% | 危险阈值 |
keep_recent_rounds |
50 | 保留最近对话轮数 |
check_interval |
3600 | 检查间隔(秒) |
📁 文件结构
context-monitor/
├── SKILL.md # 本文件
├── monitor.ps1 # 主监控脚本
├── compress.ps1 # 压缩脚本 脚本
├── config.json # 配置文件
└── README.md # 使用说明
🚀 使用方式
手动执行
powershell -ExecutionPolicy Bypass -File workspace/skills/context-monitor/monitor.ps1
Cron 自动执行
# 每小时检查一次
openclaw cron add --name context-monitor --cron "0 * * * *" --agent main --message "执行 context-monitor 技能"
📊 输出日志
日志位置: workspace/skills/context-monitor/log.txt
日志格式:
[2026-03-09 22:00:00] ✅ 上下文健康:占用率 45%
[2026-03-09 23:00:00] ⚠️ 上下文警告:占用率 75%
[2026-03-09 23:00:01] 🗜️ 已压缩旧对话,释放 30% 空间
⚠️ 注意事项
- 不要修改核心配置 - 本技能不修改 openclaw.json
- 定期清理日志 - 避免日志文件过大
- 检查压缩效果 - 确保重要对话未被压缩
📞 故障排查
问题 1:脚本无法执行
解决:
Set-ExecutionPolicy -ExecutionPolicy Bypass -Scope Process
问题 2:压缩失败
解决:
- 检查文件权限
- 检查磁盘空间
- 查看日志文件
Last updated: 2026-03-09 22:41(东八区)
安全使用建议
Do not install or enable this skill until you can review the actual scripts it references. Specifically: (1) request the monitor.ps1 and compress.ps1 source and inspect them for any network calls, deletion of files beyond conversation data, or credential access; (2) verify how '关键记忆' is identified and that retention logic is safe; (3) confirm the environment will have PowerShell and the OpenClaw CLI, or adjust the instructions; (4) avoid running Set-ExecutionPolicy Bypass persistently — prefer running PowerShell in a sandboxed session or using -ExecutionPolicy Bypass just for a single, reviewed script run; (5) if you cannot obtain or review the scripts, treat the skill as untrusted and do not schedule it as a cron job. Because the source is unknown and the published bundle is missing the implementation, proceed with caution.
功能分析
Type: OpenClaw Skill
Name: context-monitor
Version: 1.0.0
The skill bundle (context-monitor) describes a utility for monitoring and modifying OpenClaw dialogue history, which involves high-risk capabilities like shell execution and memory manipulation. The SKILL.md file explicitly instructs the use of 'powershell -ExecutionPolicy Bypass', a security-weakening command used to run unsigned scripts. While these actions are plausibly aligned with the stated purpose of context management, the combination of shell access, the instruction to circumvent security policies, and the absence of the actual script logic (monitor.ps1 and compress.ps1) for verification warrants a suspicious classification.
能力评估
Purpose & Capability
The stated purpose (monitor and compress context to keep responsiveness) is coherent with the described behavior. However, SKILL.md lists monitor.ps1, compress.ps1 and config.json as part of the skill, yet the package contains no code files. The instructions also assume the presence of the OpenClaw CLI (openclaw cron add) and PowerShell runtime without declaring them as requirements. That mismatch (declared file structure but no provided scripts, and unstated binary dependencies) is inconsistent.
Instruction Scope
The instructions tell the agent/operator to execute local PowerShell scripts that would modify/compact conversation data and write logs. Because the actual scripts are not present in the bundle, you cannot verify what data transformations, retention logic for “关键记忆”, or external communications the scripts would perform. The guidance to set ExecutionPolicy to Bypass elevates risk (it permits running arbitrary PowerShell code). The SKILL.md is also vague about how it identifies and preserves '关键记忆'.
Install Mechanism
This is an instruction-only skill with no install spec, which is low install-surface. However, the documentation implies files (scripts/config) should exist at workspace/skills/context-monitor/, yet they are not included. That discrepancy means the package as published is incomplete or expects out-of-band files — a red flag because missing files could be fetched or created later without review.
Credentials
The skill does not request environment variables, credentials, or config paths. That is proportionate for a local context-monitoring task. Nonetheless, because the runtime scripts are absent, we cannot confirm whether the actual implementation would access secrets or other configs.
Persistence & Privilege
always is false and the skill is not marked to modify agent/global configs (SKILL.md even warns not to change openclaw.json). No persistent install mechanism is declared. Still, the skill advises adding a cron job via the openclaw CLI (implying periodic autonomous runs), so ensure cron registration is what you expect before enabling.
如何使用
- 确保已安装 OpenClaw(本地或 Docker 部署)
- 在对话框中输入安装命令:
/install context-monitor - 安装完成后,直接呼叫该 Skill 的名称或使用
/context-monitor触发 - 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v1.0.0
Initial release of Context Monitor Skill.
- Monitors OpenClaw context window usage in real time.
- Automatically compresses older conversations when usage exceeds thresholds.
- Retains the most recent 50 conversation rounds and key memories.
- Sends warning and critical alerts as needed.
- Configurable parameters for thresholds and check intervals.
- Includes clear logging and troubleshooting guidance.
元数据
常见问题
Context Monitor 是什么?
实时监控OpenClaw上下文窗口占用,超过阈值自动压缩旧对话并保留最近50轮及关键记忆,保持系统响应速度。 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 278 次。
如何安装 Context Monitor?
在 OpenClaw 或 Claude Code 对话框中运行命令「/install context-monitor」即可一键安装,无需额外配置。
Context Monitor 是免费的吗?
是的,Context Monitor 完全免费,采用 MIT-0 许可证,可自由下载、安装和使用。
Context Monitor 支持哪些平台?
Context Monitor 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。
谁开发了 Context Monitor?
由 yuhui435(@yuhui435)开发并维护,当前版本 v1.0.0。
推荐 Skills