← Back to library

用“先约束再执行”提示词模板压缩 OpenClaw 成本

社区案例报告可显著降低 token 消耗;可执行核心是把模型、输出长度、工具使用边界写进固定提示模板,再用会话状态持续回测。

REDDITDiscovered 2026-02-13Author u/yungjeesy
Prerequisites
  • You can access OpenClaw session usage data (session_status / status card).
  • You have repeatable task types (e.g., report drafting, triage, search) for A/B comparison.
Steps
  1. Capture baseline: run 5-10 representative tasks and record token/cost per task.
  2. Introduce a constraint-first prompt block: target output length, tool budget, and stop conditions before main task text.
  3. For low-risk tasks, prefer concise mode and avoid unnecessary multi-tool fanout.
  4. Re-run the same task set and compare median token/cost; keep only templates that pass quality threshold.
  5. Schedule weekly template review to prevent prompt bloat and drift.
Commands
openclaw status
openclaw gateway status
openclaw help
Verify

Median token usage drops across the controlled task set while output acceptance rate remains stable.

Caveats
  • The reported 69% reduction is user-specific and may not generalize(需验证)。
  • Over-compressing prompts can harm reasoning quality on complex tasks.
Source attribution

This tip is aggregated from community/public sources and preserved with attribution.

Open original source ↗
Visit original post