OpenClaw operations guide

OpenClaw compaction model cost: test a cheaper summarizer

Short answer. Measure what OpenClaw spends summarizing long chats, then test a separate compaction model against cost and task-continuity checks. Compaction shortens the history supplied on future turns. Summarizing that history can itself use model tokens. If the summary calls are expensive, test changing the summarizer while keeping the model that answers the user fixed.

Last updated · Published

The OpenClaw Token Bill Kit is an optional paid kit with a spend-audit checklist for attribution, quality checks, and rollback.

By CWYN · Reviewed November 18, 2026 for OpenClaw 2026.11.5

Compaction shortens the history supplied on future turns. Summarizing that history can itself use model tokens. If the summary calls are expensive, test changing the summarizer while keeping the model that answers the user fixed.

1. Identify which runtime owns compaction

Find the active session runtime and context engine. The compaction reference documents agents.defaults.compaction.model for built-in model-based summarization. Native Codex and Claude CLI have their own compaction policies, and some built-in provider routes use a server-side compaction endpoint. A focused manual /compact can take a different path from automatic maintenance.

2. Record a baseline with a disposable transcript

Create a test transcript with a task, a prior decision, a constraint, and an unfinished step. Compact it in a test profile using the same runtime as the affected chat. Record the summary model if the run exposes it, request timing, input and output usage where available, and whether the next reply retains those facts. Match the call to the intended provider account and billing window before assigning a cost.

Estimate your own monthly bill with the free AI cost calculator.

3. Change only the test summarizer

In the test profile, set agents.defaults.compaction.model to an authorized, available provider/model-id. Use a model with enough context and output headroom for the test, and confirm that sending the transcript to that provider is allowed. The configuration CLI reference explains how to inspect and validate the setting. The documented explicit override does not inherit the session’s model fallback chain.

4. Compare cost and the summary’s retained facts

Repeat the same transcript and compaction trigger in a fresh test chat. Verify which model handled the summary and which handled the reply. Where the provider exposes comparable charges, compare the total for summary attempts and retries as well as the next turn. Check the saved decision, constraint, and next step explicitly. Treat missing usage records as an unknown cost and a missing constraint as a failed test.

5. Verify the trigger you use in production

If you rely on automatic maintenance, trigger it in the isolated profile and verify its actual route before adopting the setting. Adopt the change only if the measured cost and handoff quality meet your criteria. Restore the previous value, or remove the added override if it was originally absent, if calls fail or the summary loses needed details.

Get your free CWYN Score to choose your next setup improvement.

Next steps