Install
openclaw skills install prompt-slimmerAudit and slim down OpenClaw workspace files (SOUL.md, AGENTS.md, TOOLS.md, IDENTITY.md, USER.md, HEARTBEAT.md, MEMORY.md) to reduce system prompt token usag...
openclaw skills install prompt-slimmerAudit and optimize OpenClaw workspace files to reduce system prompt token overhead without losing information.
Every workspace file (SOUL.md, MEMORY.md, etc.) is injected into the system prompt on every API call. A 50K-char workspace means ~12K tokens sent with every single message — even a simple "hi". At Opus pricing ($15/1M input tokens), that's $0.18 per message just for workspace overhead.
Run the audit:
1. Measure all workspace files (chars + lines)
2. Analyze each section for frequency-of-use
3. Identify redundancies across files
4. Generate slim-down plan with before/after estimates
5. Execute (with user approval) and verify
Content needed in every session: core identity, active relationships, behavioral rules, critical safety constraints.
Content needed sometimes: completed projects, historical records, detailed technical specs, one-time learnings. Retrieved via memory_search when relevant.
Content needed only for specific tasks: workflow steps, code templates, platform-specific guides. Lives in SKILL.md files, loaded only when the skill triggers.
OpenClaw injects all .md files in the workspace root into the system prompt — not just the standard files. Scan for "ghost files": old reports, task materials, research notes, or temp files sitting in the workspace root.
cd <workspace_dir>
echo "=== All .md files in workspace root ==="
for f in *.md; do
[ -f "$f" ] && echo "$f: $(wc -c < "$f") chars"
done
echo "=== Standard files ==="
echo "SOUL.md AGENTS.md TOOLS.md IDENTITY.md USER.md HEARTBEAT.md MEMORY.md BOOTSTRAP.md GARDEN.md"
Any .md file NOT in the standard list is a ghost file candidate. Move completed task files, old research, and temp notes to memory/archive/ or a subdirectory (subdirectories are not injected).
Real example: One instance had 15K in standard files but 31K in two ghost files (an old promotion review + research report) — removing them saved 63% instantly.
cd <workspace_dir>
for f in SOUL.md AGENTS.md TOOLS.md IDENTITY.md USER.md HEARTBEAT.md MEMORY.md; do
[ -f "$f" ] && echo "$f: $(wc -c < "$f") chars, $(wc -l < "$f") lines"
done
For each file, extract ## headings and measure each section's size. Then classify:
| Category | Criteria | Action |
|---|---|---|
| 🟢 Keep | Referenced every session, identity-critical | Keep as-is |
| 🟡 Slim | Useful but verbose, can be compressed | Rewrite concisely |
| 🔴 Archive | Completed/paused projects, historical records | Move to memory/archive/ |
| ⚫ Deduplicate | Same info in multiple files | Keep in one place, remove others |
Common duplication patterns:
Rule: Information lives in the most specific location. If a skill covers it, remove from MEMORY.md.
memory/archive/projects.md (or topic-specific files)Details: see memory/archive/projects.md or just a 1-line summaryAfter slimming, verify:
memory_search can find archived contentTypical bloat sources:
cron list can fetch this liveTarget: MEMORY.md should be < 5,000 chars for a well-maintained instance.
Typical bloat sources:
Target: HEARTBEAT.md should be < 3,000 chars.
Be careful here. SOUL.md is identity-critical. Don't optimize away personality.
Usually already lean. Check for:
Usually already lean. Check for:
| Workspace Size | Before | After | Typical Savings |
|---|---|---|---|
| Light (<20K) | 20K | 15K | 25% |
| Medium (20-50K) | 35K | 18K | 50% |
| Heavy (50K+) | 60K | 22K | 63% |
At Opus pricing ($15/1M input, $1.50/1M cached):
| Savings | Chars Saved | Tokens Saved | $/message saved | $/day (100 msg) |
|---|---|---|---|---|
| 25% | 5K | ~2K | $0.03 | $3 |
| 50% | 25K | ~10K | $0.15 | $15 |
| 63% | 38K | ~15K | $0.23 | $23 |
With prompt caching, savings are ~90% less but still meaningful for cache-miss turns.