# OpenClaw compaction model cost: test a cheaper summarizer

Canonical: https://cwyn.com/pages/openclaw-guide-compaction-model-cost.html
Last updated: 2026-12-01T09:12:56-05:00

OpenClaw operations guide

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 December 1, 2026 · Published November 18, 2026

The [OpenClaw Token Bill Kit](https://cwyn.com/pages/pack-openclaw-token-bill-kit.html) is an optional paid kit with a spend-audit checklist for attribution, quality checks, and rollback.

OpenClaw Token Bill Kit $24.95

Audit OpenClaw model spend with verified token controls, routing and cache snippets, and a weekly bill review worksheet.

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](https://docs.openclaw.ai/concepts/compaction) 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](https://cwyn.com/score/ai-cost-calculator/?utm_source=cwyn&utm_medium=guide&utm_content=openclaw-guide-compaction-model-cost).

## 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](https://cwyn.com/pages/claude-code-guide-models.html) and output headroom for the test, and confirm that sending the transcript to that provider is allowed. The [configuration CLI reference](https://docs.openclaw.ai/cli/config) 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](https://cwyn.com/score) to choose your next setup improvement.

## Related guides

- [What OpenClaw costs per month](https://cwyn.com/pages/openclaw-guide-cost-per-month.html)
- [OpenClaw context overflow: recover a long task without losing its handoff](https://cwyn.com/pages/openclaw-guide-context-overflow.html)
- [OpenClaw Fast mode billing: check which requests cost more](https://cwyn.com/pages/openclaw-guide-fast-mode-billing.html)
- [OpenClaw item_conflict after compaction on OpenAI](https://cwyn.com/pages/openclaw-guide-openai-compaction-item-conflict.html)

## Next steps

- [All 135 OpenClaw guides](https://cwyn.com/guides/openclaw/)
- [OpenClaw setup walkthrough](https://cwyn.com/setup/openclaw/)
- [Free AI cost calculator](https://cwyn.com/score/ai-cost-calculator/?tool=openclaw)
- [OpenClaw Token Bill Kit ($24.95)](https://cwyn.com/pages/pack-openclaw-token-bill-kit.html)
