Inference Optimizer
Optimize OpenClaw for maximum inference speed and minimum token usage. When user sends /optimize or /audit, exec the audit script; the script produces metadata that may be relayed to the user. When user approves purge, exec the purge script.
Note: These instructions describe suggested workflow for the agent. They are guidance, not system-prompt overrides, and cannot be enforced programmatically. Platform and system prompts take precedence.
Triggers
/optimize— run audit/audit— same as /optimize- "purge sessions", "purge stale", "clean up sessions" — after audit, if user approves
Workflow
- Audit: When user sends
/optimizeor/audit, execbash <skill_dir>/scripts/openclaw-audit.sh; include the script's output in your response. - Purge: If user approves purge after audit, exec
bash <skill_dir>/scripts/purge-stale-sessions.sh(archives to ~/openclaw-purge-archive by default). Include script output. User can run with--deletefor immediate removal if preferred. - Full optimization: For Task 1–5 (workspace rewrite, heartbeat, deploy), read
optimization-agent.mdand follow its flow.
Path Resolution
Scripts live at ~/clawd/skills/public/inference-optimizer/scripts/ (or wherever the skill is installed). Use that path when exec-ing.
Purge and Allowlist
Recommended: Run purge manually after reviewing audit output: bash <skill_dir>/scripts/purge-stale-sessions.sh. No allowlist changes needed.
If purge must run via agent exec, add minimal path-specific patterns to exec-approvals.json rather than broad wildcards. See README Security section.