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:
- Write compressed responses — no filler, no hedging, lead with answers
- Write compressed MEMORY.md — one fact per line, no narrative
- Write compressed daily logs — decisions only, not discussions
- 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---2name: prompt-compressor3description: Saves 20-40% of LLM tokens by teaching the agent to write compressed responses, compressed memory logs, and compressed pre-compaction summaries. Works via SOUL.md instructions — no hooks, no extra process, no dependencies. Also provides explicit compression when the user asks to compress a prompt. Use when the user asks about reducing token costs, optimizing API spend, compressing prompts, or making the agent more efficient.4---56# Prompt Compressor78Saves tokens on turns 2+ by making all agent output compressed from the start.910## How it works1112This is NOT a hook (hooks require newer OpenClaw versions). Instead, it works by adding instructions to SOUL.md that make the agent:13141. **Write compressed responses** — no filler, no hedging, lead with answers152. **Write compressed MEMORY.md** — one fact per line, no narrative163. **Write compressed daily logs** — decisions only, not discussions174. **Compress pre-compaction flushes** — facts not paragraphs1819The savings compound: compressed responses → compressed history → compressed compaction summaries → fewer tokens on every subsequent turn.2021## Install2223Append the contents of `soul-snippet.md` to the user's SOUL.md:2425```bash26cat {baseDir}/soul-snippet.md >> ~/.openclaw/SOUL.md27```2829Or if using a workspace SOUL.md:3031```bash32cat {baseDir}/soul-snippet.md >> <workspace>/SOUL.md33```3435Then start a new session (`/new`) so the updated SOUL.md loads.3637## When user asks to compress a specific prompt3839Apply these rules manually to their text:4041### Remove42- Greetings: "Hello", "Hi", "Hey", "Good morning"43- Sign-offs: "Thanks", "Best regards", "Cheers"44- Hedging: "Could you please", "I was wondering if", "Would you be able to"45- Filler: "just", "really", "very", "basically", "actually", "literally", "honestly"46- Padding: "I think that", "In my opinion", "It is worth mentioning"4748### Shorten49- "due to the fact that" → "because"50- "in order to" → "to"51- "with regard to" → "about"52- "take into consideration" → "consider"53- "come up with" → "create"54- "figure out" → "determine"55- "a large number of" → "many"56- "at this point in time" → "now"57- "for the purpose of" → "to"58- "it is important to note that" → "note:"59- "it would be a good idea to" → remove entirely6061### Normalize62- "yeah", "yep", "yup" → "yes"63- "nah", "nope" → "no"6465### Never touch66- Code blocks, inline code, URLs, quoted strings, numbers, file paths, ALL_CAPS6768## Rules6970- When installing, ALWAYS append to SOUL.md, never overwrite it71- Tell the user to run `/new` after installation so the new SOUL.md loads72- Show a before/after example so the user sees the difference