โ† Back to Skills Marketplace
joelovestech

๐Ÿฆ Shrink โ€” Three-Tier Multimodal Context Optimizer

by Joe Loves Tech ยท GitHub โ†— ยท v1.2.0 ยท MIT-0
cross-platform โš  suspicious
136
Downloads
0
Stars
0
Active Installs
6
Versions
Install in OpenClaw
/install shrink
Description
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,...
Usage Guidance
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.
Capability Analysis
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.
Capability Assessment
โ„น 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.
How to Use
  1. Make sure OpenClaw is installed (local or Docker)
  2. Run the install command in chat: /install shrink
  3. After installation, invoke the skill by name or use /shrink
  4. Provide required inputs per the skill's parameter spec and get structured output
Version History
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
Metadata
Slug shrink
Version 1.2.0
License MIT-0
All-time Installs 0
Active Installs 0
Total Versions 6
Frequently Asked Questions

What is ๐Ÿฆ 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,... It is an AI Agent Skill for Claude Code / OpenClaw, with 136 downloads so far.

How do I install ๐Ÿฆ Shrink โ€” Three-Tier Multimodal Context Optimizer?

Run "/install shrink" in the OpenClaw or Claude Code chat to install it in one step โ€” no extra setup required.

Is ๐Ÿฆ Shrink โ€” Three-Tier Multimodal Context Optimizer free?

Yes, ๐Ÿฆ Shrink โ€” Three-Tier Multimodal Context Optimizer is completely free, licensed under MIT-0. You can download, install and use it at no cost.

Which platforms does ๐Ÿฆ Shrink โ€” Three-Tier Multimodal Context Optimizer support?

๐Ÿฆ Shrink โ€” Three-Tier Multimodal Context Optimizer is cross-platform and runs anywhere OpenClaw / Claude Code is available (cross-platform).

Who created ๐Ÿฆ Shrink โ€” Three-Tier Multimodal Context Optimizer?

It is built and maintained by Joe Loves Tech (@joelovestech); the current version is v1.2.0.

๐Ÿ’ฌ Comments