Yes — in general, a long coding session gets more expensive per message because the model has more conversation/tool history to read.
OpenClaw does auto-compaction, so it won’t grow forever: older turns get summarized and recent turns stay intact. But before/around compaction, long sessions can absolutely cost more, especially if there are big tool outputs, logs, file dumps, or repeated code listings.
For cheapest steady coding, I’d use this pattern:
- Keep one director session for decisions + current plan.
- Use short worker sessions for specific tasks, then end/reset them.
- Start
/new when switching to a new unrelated bug/feature.
- Use
/compact after a meaningful milestone if you want to keep the session but shrink context.
- Avoid pasting huge logs/code unless needed; ask the agent to inspect files directly.
- Keep tasks narrow: “fix this one server bug” beats “continue developing the bot”.
So: don’t stay in one giant coding thread forever. Use sessions like work branches: keep the planning thread, reset worker threads often.
Docs: https://docs.openclaw.ai/concepts/compaction