← 返回 Skills 市场
geoshan

Context Compactor

作者 geoshan · GitHub ↗ · v1.0.0 · MIT-0
cross-platform ⚠ suspicious
308
总下载
0
收藏
0
当前安装
1
版本数
在 OpenClaw 中安装
/install subagent-context-compactor
功能描述
上下文压缩代理,采用分层压缩策略,基于内存使用触发机制。处理HOT/WARM/COLD三层数据,优化token使用。当用户需要压缩对话上下文、优化内存使用、管理会话历史、减少token消耗时使用此技能。特别适用于长时间对话、复杂任务处理、需要保留重要历史信息的场景。
安全使用建议
This package is largely coherent with a context-compression agent, but review a few things before installing: - Inspect integration.py and api_server.py to confirm whether any HTTP endpoints are exposed and whether they require authentication (Flask-based APIs often default to no auth). An unauthenticated API could leak conversation memory or compressed data. - Search the code for any outbound network calls (requests, urllib, socket, or subprocess calls that curl/wget) to ensure data is not silently sent to external hosts. If you find any external endpoints, verify they are legitimate and appropriate. - Confirm the service only reads OpenClaw workspace paths you expect (~/.openclaw/workspace). If you need tighter control, run the skill in an isolated environment (container or VM) or adjust file permissions and configuration to limit accessible paths. - Because SKILL.md suggests cloning a repository but the package already contains code, avoid running any git clone or install commands from untrusted URLs; use the included files instead or obtain the upstream source from a known homepage. Lack of a homepage / unknown source lowers trust and is why this is flagged. - If you allow the skill to auto-start or add cron/heartbeat entries, ensure you understand and control that integration (review heartbeats, cron entries) and monitor logs (logs/ directory) for unexpected behavior. If you want, I can scan integration.py and api_server.py for network calls and any hard-coded hosts/keys, or point out exact lines to review for authentication and outbound requests.
功能分析
Type: OpenClaw Skill Name: subagent-context-compactor Version: 1.0.0 The 'subagent-context-compactor' bundle is a legitimate utility designed to manage and optimize LLM conversation history within the OpenClaw ecosystem. It implements a tiered storage strategy (HOT/WARM/COLD) and uses a local SQLite database to track message importance and compression history. While the code (specifically in integration.py and monitor.py) accesses sensitive session data located in the user's OpenClaw workspace (~/.openclaw/workspace/), this behavior is strictly aligned with its stated purpose of context compaction. The included Flask API server (api_server.py) binds only to the local loopback interface (127.0.0.1), and there is no evidence of data exfiltration, unauthorized persistence, or malicious intent.
能力评估
Purpose & Capability
Name/description, configuration, and included code (compactor.py, hierarchical_compactor.py, monitor.py, integration.py, api_server.py, control scripts) align with a Context Compactor that monitors session memory, classifies HOT/WARM/COLD and compresses or archives items. No unrelated cloud credentials, binaries, or config paths are requested.
Instruction Scope
SKILL.md and scripts instruct the agent to monitor ~/.openclaw/workspace memory files, run background monitor/integration services, write logs and a local SQLite DB, and add cron/tasks or heartbeat entries. Those actions are consistent with the stated purpose but grant the skill read access to the user's OpenClaw workspace and persistent write access (logs, DB). The SKILL.md suggests cloning from a repository URL but the package already contains code; the placeholder git clone line is vague and could encourage fetching remote code if followed.
Install Mechanism
There is no remote install spec; the package is instruction-and-code-only and uses a small Python dependency (Flask) declared in requirements.txt. No external downloads, URL shorteners, or archive-extract steps were found in the provided files.
Credentials
The skill asks for no environment variables or external credentials (primary credential none). It does read files under the user's OpenClaw workspace (~/.openclaw/workspace/memory) which is appropriate for a memory-aware compactor, but that access could expose sensitive conversation history. config.json includes auto_start_with_openclaw:true, meaning it is designed to be started automatically if integrated—this increases its access surface.
Persistence & Privilege
The skill runs background processes (monitor, integration), persists a SQLite DB and logs, and includes start/stop scripts. 'always' is false and it does not force-enable itself in the registry, but its files and config indicate it is intended to be integrated (auto-start) with OpenClaw; that persistent presence is reasonable for a monitoring/self-managing service but should be reviewed by the operator.
如何使用
  1. 确保已安装 OpenClaw(本地或 Docker 部署)
  2. 在对话框中输入安装命令:/install subagent-context-compactor
  3. 安装完成后,直接呼叫该 Skill 的名称或使用 /subagent-context-compactor 触发
  4. 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v1.0.0
Initial native agent release with hierarchical compression and memory-based triggers. - Migrated from plugin/JS implementation to standalone Python agent with API server and monitoring tools - Introduced HOT/WARM/COLD three-level context compression strategy - Automatic compaction triggered by token usage, message counts, timer, or manual command - New monitoring and reporting scripts for compression status and resource usage - Added configuration files for compression thresholds and strategies - Removed previous JS/TypeScript plugin files; all logic is now in Python and shell scripts
元数据
Slug subagent-context-compactor
版本 1.0.0
许可证 MIT-0
累计安装 0
当前安装数 0
历史版本数 1
常见问题

Context Compactor 是什么?

上下文压缩代理,采用分层压缩策略,基于内存使用触发机制。处理HOT/WARM/COLD三层数据,优化token使用。当用户需要压缩对话上下文、优化内存使用、管理会话历史、减少token消耗时使用此技能。特别适用于长时间对话、复杂任务处理、需要保留重要历史信息的场景。 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 308 次。

如何安装 Context Compactor?

在 OpenClaw 或 Claude Code 对话框中运行命令「/install subagent-context-compactor」即可一键安装,无需额外配置。

Context Compactor 是免费的吗?

是的,Context Compactor 完全免费,采用 MIT-0 许可证,可自由下载、安装和使用。

Context Compactor 支持哪些平台?

Context Compactor 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。

谁开发了 Context Compactor?

由 geoshan(@geoshan)开发并维护,当前版本 v1.0.0。

💬 留言讨论