360 Secure SkillHub
360 安全技能中心

Caveman Input Compression

把工作区 Markdown 引导文件(SOUL.md、IDENTITY.md、USER.md 等)改写为极简“caveman”文体,降低每次会话加载的输入 token。覆盖前创建 .original.md 备份,备份已存在则中止,超过 500KB 的文件被拒绝。AGENTS.md、HEARTBEAT.md、MEMORY.md 需环境变量开启。模型按 claude CLI、MiniMax、Deep…

分类:效率
ether-btc
ether-btc
热度 36.45
最近更新 2026-05-11 17:42:28

安装

发给 Agent
帮我安装这个技能:npx secure-skills-cli add ether-btc/caveman-compress
兼容性
通用兼容
联网要求
需要联网
数据出网
必须出网
Metadata
name
caveman-compress
description
Compress workspace bootstrap files into caveman-speak to reduce input tokens on every session load. Creates .original.md backups before overwriting.
triggers
["/caveman:compress <filepath>","compress memory file","caveman compress"]
deactivation
null
persistence
none

Caveman Input Compression Skill

Identity

Compress natural language workspace files into caveman-speak (~45% fewer input tokens). Creates .original.md backup before overwriting.

Supported Files

Always safe to compress:

  • SOUL.md ✅
  • IDENTITY.md ✅
  • USER.md ✅

Feature-flagged (requires env var set):

  • AGENTS.md 🔒 (CAVEMAN_COMPRESS_AGENTS=1)
  • HEARTBEAT.md 🔒 (CAVEMAN_COMPRESS_HEARTBEAT=1)
  • MEMORY.md 🔒 (CAVEMAN_COMPRESS_MEMORY=1)

Security

  • No shell=True in subprocess calls
  • No user content as shell arguments
  • Files >500KB rejected
  • .original.md backup created before overwrite
  • Aborts if backup already exists (prevents accidental overwrite)

API Fallback Chain

Models tried in order:

  1. claude CLI (desktop auth) - Primary
  2. MiniMax (OpenAI-compatible) - Requires MINIMAX_BASE_URL + MINIMAX_API_KEY
  3. DeepSeek (OpenAI-compatible) - Requires DEEPSEEK_API_KEY

Uses subprocess + curl, no OpenAI SDK required.

Usage

# Compress a specific file
python3 -m skills.caveman_compress.scripts.compress /home/pi/.openclaw/workspace/SOUL.md

# Dry run (no write, just preview)
python3 -m skills.caveman_compress.scripts.compress --dry-run /home/pi/.openclaw/workspace/SOUL.md

# Feature flags (environment variables)
CAVEMAN_COMPRESS_AGENTS=1 /home/pi/.openclaw/workspace/scripts/caveman-enable.sh

Model Override

Set COMPRESSION_MODEL env var to use specific model:

COMPRESSION_MODEL=deepseek32 python3 -m skills.caveman_compress.scripts.compress SOUL.md

Default: deepseek32 (cheap, fast)

References