← 返回
AI智能 中文

https://github.com/ckpxgfnksd-max/prompt-compressor-openclaw

Saves 20-40% of LLM tokens by teaching the agent to write compressed responses, compressed memory logs, and compressed pre-compaction summaries. Works via SO...
通过教导智能体编写压缩回复、压缩记忆日志及压缩预整合摘要,节省 20-40% 的 LLM Token。通过 SO... 运作。
ckpxgfnksd-max
AI智能 clawhub v0.2.0 1 版本 99823.9 Key: 无需
★ 1
Stars
📥 547
下载
💾 10
安装
1
版本
#latest

概述

Prompt Compressor

Saves tokens on turns 2+ by making all agent output compressed from the start.

How it works

This is NOT a hook (hooks require newer OpenClaw versions). Instead, it works by adding instructions to SOUL.md that make the agent:

  1. Write compressed responses — no filler, no hedging, lead with answers
  2. Write compressed MEMORY.md — one fact per line, no narrative
  3. Write compressed daily logs — decisions only, not discussions
  4. Compress pre-compaction flushes — facts not paragraphs

The savings compound: compressed responses → compressed history → compressed compaction summaries → fewer tokens on every subsequent turn.

Install

Append the contents of soul-snippet.md to the user's SOUL.md:

cat {baseDir}/soul-snippet.md >> ~/.openclaw/SOUL.md

Or if using a workspace SOUL.md:

cat {baseDir}/soul-snippet.md >> <workspace>/SOUL.md

Then start a new session (/new) so the updated SOUL.md loads.

When user asks to compress a specific prompt

Apply these rules manually to their text:

Remove

  • Greetings: "Hello", "Hi", "Hey", "Good morning"
  • Sign-offs: "Thanks", "Best regards", "Cheers"
  • Hedging: "Could you please", "I was wondering if", "Would you be able to"
  • Filler: "just", "really", "very", "basically", "actually", "literally", "honestly"
  • Padding: "I think that", "In my opinion", "It is worth mentioning"

Shorten

  • "due to the fact that" → "because"
  • "in order to" → "to"
  • "with regard to" → "about"
  • "take into consideration" → "consider"
  • "come up with" → "create"
  • "figure out" → "determine"
  • "a large number of" → "many"
  • "at this point in time" → "now"
  • "for the purpose of" → "to"
  • "it is important to note that" → "note:"
  • "it would be a good idea to" → remove entirely

Normalize

  • "yeah", "yep", "yup" → "yes"
  • "nah", "nope" → "no"

Never touch

  • Code blocks, inline code, URLs, quoted strings, numbers, file paths, ALL_CAPS

Rules

  • When installing, ALWAYS append to SOUL.md, never overwrite it
  • Tell the user to run /new after installation so the new SOUL.md loads
  • Show a before/after example so the user sees the difference

版本历史

共 1 个版本

  • v0.2.0 当前
    2026-03-30 01:04 安全 安全

安全检测

腾讯云安全 (Keen)

安全,无风险
查看报告

腾讯云安全 (Sanbu)

安全,无风险
查看报告

🔗 相关推荐

ai-intelligence

Nano Banana Pro

steipete
使用 Nano Banana Pro (Gemini 3 Pro Image) 生成或编辑图像。支持文生图、图生图及 1K/2K/4K 分辨率,适用于图像创建、修改及编辑请求,使用 --input-image 指定输入图像。
★ 417 📥 115,182
ai-intelligence

ontology

oswalpalash
类型化知识图谱,用于结构化智能体记忆与可组合技能。支持创建/查询实体(人员、项目、任务、事件、文档)及关联...
★ 712 📥 243,773
ai-intelligence

Self-Improving + Proactive Agent

ivangdavila
自我反思+自我批评+自我学习+自组织记忆。智能体评估自身工作、发现错误并持续改进。
★ 1,358 📥 318,233