openclaw-optimizerOpenClaw Optimizer
Comprehensive workspace analysis for OpenClaw users. Audit your current setup for cost inefficiencies, identify performance bottlenecks, recommend configuration improvements, and generate optimization reports with actionable recommendations.
Key Features
- •Cost analysis and spending reports
- •Performance bottleneck detection
- •Configuration optimization suggestions
- •Resource usage monitoring
- •Security and compliance checks
Common Use Cases
- →Reduce unnecessary tool subscriptions
- →Optimize workflow performance
- →Audit security configurations
- →Plan infrastructure scaling
Custom Workflow Integration
This skill can be customized for your specific workflow as part of an SMF Works services engagement. Whether you need custom automation rules, integrations with your existing tools, or specialized configurations for your team, we can tailor this skill to fit your exact requirements.
Explore ServicesInstallation
# Install the skill (via TUI or CLI)
smfw install openclaw-optimizer
# Get help
smfw run openclaw-optimizer --help
💡 Tip: Install via the OpenClaw TUI skill manager for an interactive experience, or use the CLI command above.
Setup Guide
OpenClaw Optimizer — Setup Guide
Estimated setup time: 5 minutes
Difficulty: Easy
Tier: Pro — requires SMF Works Pro subscription ($19.99/mo)
What You'll Need
| Requirement | Details | Cost |
|---|---|---|
| SMF Works Pro subscription | smfworks.com/subscribe | $19.99/mo |
| Python 3.8+ | Built into macOS 12+, available on Linux | Free |
| OpenClaw | Installed and authenticated | Free |
| smfworks-skills repository | Cloned via git | Included |
| OpenClaw workspace | ~/.openclaw/workspace/ must exist | — |
Step 1 — Subscribe and Authenticate
openclaw auth status
If not subscribed: smfworks.com/subscribe
Step 2 — Get the Repository
git clone https://github.com/smfworks/smfworks-skills ~/smfworks-skills
Step 3 — Navigate and Verify
cd ~/smfworks-skills/skills/openclaw-optimizer
python3 main.py help
Verify Your Setup
Run a quick audit:
python3 main.py audit
You should see a workspace analysis with size, file count, and recommendations. If you see Error: SMF Works Pro subscription required, complete Step 1 first.
What the Optimizer Analyzes
The optimizer reads (never writes) these locations:
| Location | What it analyzes |
|---|---|
~/.openclaw/workspace/ | Workspace total size and breakdown |
~/.openclaw/workspace/MEMORY.md | Long-term memory file size |
~/.openclaw/workspace/memory/ | Daily memory files count and age |
~/.smf/skills/ | Installed skills count and sizes |
Understanding Warning Thresholds
| Item | Good | Warning | Critical |
|---|---|---|---|
| MEMORY.md | < 8 KB | 8–15 KB | > 15 KB |
| Daily memory files | < 30 | 30–60 | > 60 |
| Installed skills | < 10 | 10–20 | > 20 |
| Workspace total | < 2 MB | 2–5 MB | > 5 MB |
These thresholds represent the point where workspace bloat starts to noticeably impact agent performance.
Schedule Monthly Audits
Add to crontab:
crontab -e
0 9 1 * * python3 /home/yourname/smfworks-skills/skills/openclaw-optimizer/main.py report >> /home/yourname/logs/optimizer.log 2>&1
Troubleshooting
Error: SMF Works Pro subscription required — Subscribe at smfworks.com/subscribe.
Workspace not found — Verify ~/.openclaw/workspace/ exists: ls ~/.openclaw/workspace/
Audit shows all green — nothing to optimize — Your workspace is in good shape. Run again monthly to stay on top of it.
Next Steps
Setup complete. See HOWTO.md for walkthroughs on running audits, analyzing context bloat, applying recommendations, and scheduling automated checks.
How-To Guide
OpenClaw Optimizer — How-To Guide
Prerequisites: SMF Works Pro subscription active. Setup complete (see SETUP.md).
Table of Contents
- How to Run a Full Workspace Audit
- How to Analyze Context Bloat
- How to Analyze Your Skills
- How to Apply Optimization Recommendations
- How to Generate and Save a Report
- Automating with Cron
- Combining with Other Skills
- Troubleshooting Common Issues
- Tips & Best Practices
1. How to Run a Full Workspace Audit
What this does: Checks all dimensions of your OpenClaw workspace — size, context files, skills, memory — and produces a summary with recommendations.
When to use it: Monthly, or when you notice your agent responding more slowly than usual.
Steps
Step 1 — Navigate to the skill.
cd ~/smfworks-skills/skills/openclaw-optimizer
Step 2 — Run the full audit.
python3 main.py audit
Output:
🔍 OpenClaw Workspace Audit
══════════════════════════════════════════════
Workspace: /home/user/.openclaw/workspace
Total size: 847 KB
Files: 34
📊 Context Analysis
MEMORY.md: 24 KB ⚠️ Large — consider pruning old entries
SOUL.md: 8 KB ✅
AGENTS.md: 12 KB ✅
memory/: 156 KB (18 daily files)
🔧 Skills Analysis
Installed skills: 23 ⚠️ High count
🔴 Issues Found: 3
💡 Recommendations
1. [HIGH] Prune MEMORY.md — 24 KB → target <10 KB
2. [MEDIUM] Archive old daily memory files
3. [LOW] Remove config-backup.tar.gz from workspace
Report saved to: ~/.smf/optimizer-reports/report-2024-03-15.txt
Step 3 — Prioritize the HIGH recommendations first.
Result: A clear, prioritized list of what to fix.
2. How to Analyze Context Bloat
What this does: Focuses specifically on files that get loaded into your agent's context window, making it slower or less focused.
When to use it: When your agent seems slower than usual or gives generic responses.
Steps
Step 1 — Run context analysis.
python3 main.py analyze --context
Output:
📊 Context Analysis
Files loaded into agent context:
MEMORY.md: 24 KB ⚠️ Large
SOUL.md: 8 KB ✅
AGENTS.md: 12 KB ✅
USER.md: 2 KB ✅
IDENTITY.md: 1 KB ✅
TOOLS.md: 3 KB ✅
Total context: 50 KB
Recommendation:
MEMORY.md is the largest file (24 KB).
Target: < 10 KB
Action: Remove entries older than 90 days, keep only the most relevant memories
Step 2 — Prune MEMORY.md if recommended.
nano ~/.openclaw/workspace/MEMORY.md
Remove:
- Entries about completed projects you no longer need
- Outdated preferences or context
- Duplicate information
- Very old dated entries
Result: Smaller context → faster, more focused agent responses.
3. How to Analyze Your Skills
What this does: Shows how many skills are installed and which ones are largest.
python3 main.py analyze --skills
Output:
🔧 Skills Analysis
Installed skills: 23
Total skills size: 4.2 MB
Largest skills:
email-campaign: 52 KB
booking-engine: 48 KB
report-generator: 44 KB
form-builder: 41 KB
⚠️ High skill count (23) — Consider removing skills you don't use regularly.
Each installed skill adds context loading overhead.
4. How to Apply Optimization Recommendations
What this does: Shows your current recommendations in priority order.
python3 main.py recommend
Applying each type of recommendation:
Prune MEMORY.md
nano ~/.openclaw/workspace/MEMORY.md
# Review entries, delete stale ones, save
Target: Keep only facts that are:
- Still accurate and relevant
- Not duplicated elsewhere
- Timeless rather than dated
Archive old daily memory files
mkdir -p ~/.openclaw/workspace/memory/archive
# Move files older than 30 days:
cd ~/.openclaw/workspace/memory
for f in $(ls *.md | head -n -30); do mv "$f" archive/; done
Remove unused skills
python3 ~/smfworks-skills/skills/skill-manager/main.py --list
python3 ~/smfworks-skills/skills/skill-manager/main.py --remove skill-name
Remove large non-text files from workspace
ls -lh ~/.openclaw/workspace/
# Identify files > 100KB that shouldn't be there
# Move them: mv large-file.tar.gz ~/Backups/
5. How to Generate and Save a Report
When to use it: To track your workspace health over time, or share the audit with someone helping you configure OpenClaw.
python3 main.py report
Output:
📄 Report generated: ~/.smf/optimizer-reports/report-2024-03-15.txt
View the report:
cat ~/.smf/optimizer-reports/report-2024-03-15.txt
Compare to previous report:
diff ~/.smf/optimizer-reports/report-2024-02-01.txt ~/.smf/optimizer-reports/report-2024-03-15.txt
6. Automating with Cron
Example: Monthly report on the 1st
0 9 1 * * python3 /home/yourname/smfworks-skills/skills/openclaw-optimizer/main.py report >> /home/yourname/logs/optimizer.log 2>&1
Example: Weekly context check on Mondays
0 8 * * 1 python3 /home/yourname/smfworks-skills/skills/openclaw-optimizer/main.py analyze --context >> /home/yourname/logs/context-check.log 2>&1
7. Combining with Other Skills
OpenClaw Optimizer + OpenClaw Backup: Back up before making changes based on optimizer recommendations:
python3 ~/smfworks-skills/skills/openclaw-backup/main.py
python3 ~/smfworks-skills/skills/openclaw-optimizer/main.py recommend
# Apply recommendations
OpenClaw Optimizer + Skill Manager: Remove unused skills found by the analyzer:
python3 ~/smfworks-skills/skills/openclaw-optimizer/main.py analyze --skills
python3 ~/smfworks-skills/skills/skill-manager/main.py --list
python3 ~/smfworks-skills/skills/skill-manager/main.py --remove unused-skill
8. Troubleshooting Common Issues
Error: SMF Works Pro subscription required
Fix: Subscribe at smfworks.com/subscribe and re-authenticate.
Audit shows high skill count but I use all of them
Fix: The threshold is a guideline. If you actively use all your skills, the warning is informational. Focus on other recommendations.
MEMORY.md keeps growing back quickly
Fix: Your agent is writing a lot to memory. Review AGENTS.md to adjust what gets captured in daily notes vs. MEMORY.md. Quality over quantity — not everything needs to be in MEMORY.md.
Large files appear in workspace that I don't recognize
Fix: Your agent or a skill may have created them. Check timestamps: ls -lat ~/.openclaw/workspace/ | head -10. If it's a backup or log file, move it out of the workspace.
9. Tips & Best Practices
Run monthly, not obsessively. Your workspace isn't going to bloat overnight. Monthly audits catch issues before they become real problems without adding maintenance overhead.
Back up before applying recommendations. Always run OpenClaw Backup before making significant changes to MEMORY.md or removing skills.
MEMORY.md quality beats quantity. A 5 KB MEMORY.md with the 20 most important facts about you is far more useful to your agent than a 25 KB file with 200 semi-relevant notes. Prune ruthlessly.
Treat the skill count warning as a signal, not a rule. If you have 25 skills but only use 5 regularly, consider removing the other 20. If you actively use all 25, the overhead is the cost of that capability.
Save reports for trend tracking. Keeping monthly reports lets you see if your workspace is growing faster than expected and identify what's driving the growth.
