← 返回 Skills 市场
joelovestech

🦐 Shrink — Three-Tier Multimodal Context Optimizer

作者 Joe Loves Tech · GitHub ↗ · v1.2.0 · MIT-0
cross-platform ⚠ suspicious
136
总下载
0
收藏
0
当前安装
6
版本数
在 OpenClaw 中安装
/install shrink
功能描述
Replace base64 images in session history with context-aware text descriptions, reducing image token cost by 96-99%. Use when: (1) user says /shrink, /shrink,...
安全使用建议
This skill generally does what it claims: it finds base64 images in OpenClaw session JSONL files, sends the images plus surrounding conversation to an Anthropic vision model, and replaces the raw image blocks with three-tier text descriptions. Before installing or running it, consider the following: (1) Privacy: images and the surrounding messages (possibly containing PII, passwords, keys, or IPs) are sent to an external API. If that is unacceptable, do not run this skill or run it on copies of sessions with sensitive content removed. (2) Credentials on disk: the script may read auth-profiles.json to auto-discover Anthropic tokens for agents — review those files and prefer setting ANTHROPIC_API_KEY in the environment to prevent disk scanning. (3) Backups & testing: always run the --dry-run and keep .bak backups enabled; inspect the JSON output before committing. (4) Redaction: the '--redact' option relies on the remote model to remove secrets — that does not guarantee secrets are never transmitted. If you need strong guarantees, perform local redaction before using the skill. (5) Scope and restart: the skill writes session files in-place and can restart the gateway (global impact) — be prepared for brief downtime and confirm interactive prompts will be enforced in your deployment. (6) Code review: because this is an instruction-only install with a shipped script, review scripts/shrink.py yourself (or run in an isolated environment) to validate behavior and endpoints. If you want lower risk, run it only against targeted session files via --session-file or use an isolated agent account with no sensitive data.
功能分析
Type: OpenClaw Skill Name: shrink Version: 1.2.0 The "shrink" skill is a utility designed to optimize OpenClaw session history by replacing large base64 image strings with concise, AI-generated text descriptions using the Anthropic Vision API. The core script (`scripts/shrink.py`) handles image processing, deduplication, and session file modification with safety features like automatic backups and optional PII redaction. All behaviors, including credential access to `auth-profiles.json` and the instruction to restart the gateway in `SKILL.md`, are transparently documented and strictly aligned with the tool's stated purpose of context optimization.
能力评估
Purpose & Capability
Name/description align with required capabilities: the skill needs an Anthropic key and must read/write OpenClaw session JSONL to replace images. Requesting ANTHROPIC_API_KEY and performing vision calls is consistent. Minor mismatch: SKILL.md claims fleet-wide auth auto-discovery across agents, but the code's key discovery is more conservative (defaults to 'main' or skips disk scanning when ANTHROPIC_API_KEY is set).
Instruction Scope
The runtime instructions (and code) read session JSONL files, extract up to N preceding messages, and send images plus conversation context to the Anthropic vision API. Sending surrounding conversation (potential PII, secrets, or other sensitive content) to an external API is required for the feature but is a significant privacy surface. The SKILL.md also instructs optionally restarting the gateway and writing modified JSONL files in place — both are destructive/impactful operations that should be explicitly confirmed by the user. The redaction option delegates redaction to the remote model rather than performing local redaction, which may not guarantee removal of secrets before transmission.
Install Mechanism
No install spec (instruction + shipped script) — lowest install risk. The single included script uses standard libraries and requests; nothing in the manifest indicates downloading remote archives or running unknown installers.
Credentials
Declared requirement is a single ANTHROPIC_API_KEY which is proportional. However, the skill will also read ~/.openclaw/agents/*/agent/auth-profiles.json to discover additional Anthropic tokens if an env key is not set, which may expose other stored tokens. That disk access to auth-profiles.json (and session JSONLs) is broad relative to a trivial 'image shrink' utility and could surface credentials for other agents; the code's behavior (skip disk scan if env key present) partially mitigates this but the SKILL.md wording suggests broader scanning than the code implements.
Persistence & Privilege
The skill does not request always:true and is user-invocable only. It will modify session files in place (with .bak backups by default) and can optionally run 'openclaw gateway restart' to apply changes immediately. Those are expected for this functionality but are high-impact actions — allowlisting/autonomous invocation combined with write-and-restart capability increases risk if misused. The SKILL.md says restart is user-initiated only; ensure interactive prompts are enforced in the deployment environment.
如何使用
  1. 确保已安装 OpenClaw(本地或 Docker 部署)
  2. 在对话框中输入安装命令:/install shrink
  3. 安装完成后,直接呼叫该 Skill 的名称或使用 /shrink 触发
  4. 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v1.2.0
Add --redact flag: compliance-ready PII/secret/all redaction during extraction
v1.1.3
Remove last deflate references, restrict credential scope
v1.1.2
Fix remaining Deflate reference, add shrimp emoji
v1.1.1
Rebrand to Shrink, 3-tier extraction, security review fixes, shrimp branding
v1.1.0
Rename to shrink, address security review, restrict credential scope, add privacy docs
v1.0.0
Initial release: Three-Tier Extraction™, dedup, auth failover, fleet scanning
元数据
Slug shrink
版本 1.2.0
许可证 MIT-0
累计安装 0
当前安装数 0
历史版本数 6
常见问题

🦐 Shrink — Three-Tier Multimodal Context Optimizer 是什么?

Replace base64 images in session history with context-aware text descriptions, reducing image token cost by 96-99%. Use when: (1) user says /shrink, /shrink,... 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 136 次。

如何安装 🦐 Shrink — Three-Tier Multimodal Context Optimizer?

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

🦐 Shrink — Three-Tier Multimodal Context Optimizer 是免费的吗?

是的,🦐 Shrink — Three-Tier Multimodal Context Optimizer 完全免费,采用 MIT-0 许可证,可自由下载、安装和使用。

🦐 Shrink — Three-Tier Multimodal Context Optimizer 支持哪些平台?

🦐 Shrink — Three-Tier Multimodal Context Optimizer 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。

谁开发了 🦐 Shrink — Three-Tier Multimodal Context Optimizer?

由 Joe Loves Tech(@joelovestech)开发并维护,当前版本 v1.2.0。

💬 留言讨论