← 返回 Skills 市场
Trunkate AI
作者
trunkate-ai
· GitHub ↗
· v0.20.0
· MIT-0
319
总下载
1
收藏
0
当前安装
9
版本数
在 OpenClaw 中安装
/install trunkate-ai
功能描述
Semantically optimizes context history and large text blocks via the Trunkate AI API. Use when: (1) Conversation history approaches token limits, (2) Reading...
安全使用建议
This skill appears to do what it says: it will read your agent's conversation history and send a filtered version to https://api.trunkate.ai (or an override URL) using the TRUNKATE_API_KEY. Before installing or enabling its PreRequest hook globally: (1) Review the code (you have it) to confirm the filtering patterns meet your privacy needs — regex-based redaction can miss secrets. (2) Prefer a scoped/limited API key and test with non-sensitive data. (3) Consider pointing TRUNKATE_API_URL to a proxy or staging instance to inspect requests. (4) Do not enable the PreRequest hook across all agents/projects until you are comfortable that sending session history to the external service is acceptable. If you need higher assurance, run the scripts in an isolated environment and verify what is transmitted.
功能分析
Type: OpenClaw Skill
Name: trunkate-ai
Version: 0.20.0
The skill implements a proactive hook (hooks/openclaw/pre_request.py) that automatically sends the agent's entire conversation history to an external API (api.trunkate.ai) before every request. While scripts/activator.py attempts to redact secrets locally using regex, this is an incomplete safeguard for sensitive data exfiltration. Furthermore, the skill uses the OPENCLAW_ACTION:SET_HISTORY directive to silently overwrite the agent's memory with content returned from the remote API, creating a significant risk for remote prompt injection and unauthorized manipulation of the agent's state without user awareness.
能力评估
Purpose & Capability
Name/description (semantic context optimization) match the code and runtime requirements: python3, a single API key (TRUNKATE_API_KEY), and scripts that read and optimize session history via POST /optimize. The requested env var is proportional to the skill purpose.
Instruction Scope
SKILL.md and hooks instruct the agent to run a PreRequest hook (hooks/openclaw/pre_request.py -> scripts/activator.py) that reads the agent history file (OPENCLAW_HISTORY_PATH), filters out protected blocks locally, posts filtered text to the external Trunkate API, then restores protected content and emits OPENCLAW_ACTION:SET_HISTORY. This is consistent with context-pruning behavior but means full session history (with placeholders for protected blocks) is transmitted to a third party — evaluate whether that data is acceptable to send.
Install Mechanism
No packaged install step is required by the registry (instruction-only skill). The repository files are plain Python and requirements.txt only depends on requests. Manual install guidance references a GitHub repo; there are no downloads from untrusted URLs or installers that extract arbitrary archives.
Credentials
Only TRUNKATE_API_KEY is required (plus optional TRUNKATE_* variables). The activator also reads OpenClaw-provided env vars (OPENCLAW_CURRENT_TOKENS, OPENCLAW_HISTORY_PATH, etc.), which is expected. However, the PreRequest hook passes os.environ.copy() to the subprocess, so any environment secrets present on the host will be available to the skill's code at runtime (the code does attempt to redact secrets before sending). Consider limiting what env vars you expose to the skill and using a scoped API key.
Persistence & Privilege
always:false (not force-included). The skill is designed to be configured as a PreRequest hook that runs invisibly before LLM calls — this is coherent with its purpose but is a high-impact, always-on behavior if you add it to hooks. Do not enable as a global PreRequest hook until you trust the endpoint and filtering behavior.
如何使用
- 确保已安装 OpenClaw(本地或 Docker 部署)
- 在对话框中输入安装命令:
/install trunkate-ai - 安装完成后,直接呼叫该 Skill 的名称或使用
/trunkate-ai触发 - 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v0.20.0
trunkate-ai v0.20.0
- Updated scripts/activator.py and scripts/trunkate.py (details not shown).
- Updated CHANGELOG.md and version.txt to reflect the new version.
- No user-facing changes are documented in SKILL.md; all usage and integration instructions remain the same.
- Internal updates may include bug fixes or improvements in script logic.
v0.19.0
trunkate-ai 0.19.0
- Updated scripts/activator.py and scripts/trunkate.py, likely with improvements or bug fixes.
- Updated CHANGELOG.md and version.txt for version tracking.
- No changes to user-facing skill description or operation; primary focus is internal maintenance and version update.
v0.18.0
trunkate-ai 0.18.0
- Added explicit version and author fields to SKILL.md.
- Updated SKILL.md structure for wider compatibility (bins/os fields at top level).
- Improved metadata consistency in SKILL.md, matching recent OpenClaw standards.
- No feature or API logic changes; documentation and packaging updates only.
v0.17.0
trunkate-ai v0.17.0
- Documentation updates in SKILL.md to clarify usage, integration, and best practices.
- No changes to feature set, logic, or dependencies.
- Version number updated in version.txt.
v0.16.0
trunkate-ai 0.16.0
- Updated documentation to clarify "Smart Buffer" context management and introduce percentage-based budgets (e.g., "20%") for pruning.
- Added support for "[KEEP] ... [/KEEP]" tags and "Atomic Blocks" to ensure 100% preservation of critical context.
- Improved instructions on optimization strategies and the semantic preservation hierarchy.
- Refined environment variable descriptions; `TRUNKATE_THRESHOLD` documentation and options removed in favor of more flexible budget syntax.
- Miscellaneous editorial updates for step-by-step clarity and more precise quick reference guidance.
v0.15.0
Major update: Adds event-driven hooks and richer documentation for fully automated, context-aware text optimization.
- Introduced proactive PreRequest and OnError hooks for automated, silent context management and emergency context pruning.
- Added new scripts (`activator.py`, `error_detector.py`, `trunkate.py`) for threshold logic, error handling, and core API integration.
- Expanded documentation with comprehensive usage guides, integration examples, and technical references.
- Replaced `README.md` with in-depth, structured `SKILL.md` emphasizing use cases, hook configuration, and preservation strategies.
- Added customizable optimization rules and example assets for granular control over protected content.
- Removed legacy script structure; all logic now lives under standardized workflow with event-based architecture.
v0.14.0
- Added instructions to sign up at trunkate.ai and generate an API key before installation.
- Clarified installation steps in SKILL.md by breaking them into numbered items.
- No breaking changes to functionality; documentation improvements only.
v0.13.0
- Updated installation instructions to use the OpenClaw system and "clawhub install" for easier setup.
- Added guidance on setting the TRUNKATE_API_KEY in the correct .env file for persistent authentication.
- Revised usage examples to show agent-native optimization through OpenClaw commands, reflecting deeper integration.
- Clarified that the OpenClaw plugin hooks directly into the official Trunkate Python backend.
v0.12.0
- Added SKILL.md with detailed description, installation steps, and usage examples for Trunkate AI.
- Clarified system requirements, including environment variables and dependencies.
- Provided quick commands for optimizing text with optional token budget and model selection.
- Documented usage patterns for standard and budget-constrained optimization scenarios.
元数据
常见问题
Trunkate AI 是什么?
Semantically optimizes context history and large text blocks via the Trunkate AI API. Use when: (1) Conversation history approaches token limits, (2) Reading... 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 319 次。
如何安装 Trunkate AI?
在 OpenClaw 或 Claude Code 对话框中运行命令「/install trunkate-ai」即可一键安装,无需额外配置。
Trunkate AI 是免费的吗?
是的,Trunkate AI 完全免费,采用 MIT-0 许可证,可自由下载、安装和使用。
Trunkate AI 支持哪些平台?
Trunkate AI 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(linux, darwin)。
谁开发了 Trunkate AI?
由 trunkate-ai(@titus-choi)开发并维护,当前版本 v0.20.0。
推荐 Skills