r/openclaw • Pro User • 4d ago

Help Anyone using openclaw ontop of Claude code - how do you handle compaction?

What are your experiences with compaction being handled by the underlying Claude code harness as opposed to open claw? Any tips?

it’s been a struggle to get something usable.

5 Upvotes

7 comments sorted by

•

u/AutoModerator 4d ago

Welcome to r/openclaw Before posting: • Check the FAQ: https://docs.openclaw.ai/help/faq#faq • Use the right flair • Keep posts respectful and on-topic Need help fast? Discord: https://discord.com/invite/clawd

I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.

7

u/_mindyourbusiness Active 4d ago

Running this setup daily across several agents. What made it usable for us:

  1. Don't rely on compaction to keep anything important. When Claude Code compacts, it summarizes the conversation, but it doesn't write any of your notes to disk first. So any standing instruction from chat gets written to AGENTS.md or a memory file the same turn, not "later".
  2. Keep a handoff file. The agent rewrites memory/handoff-latest.md (open threads, pending approvals, promised follow-ups with dates, ticket keys; facts only, no transcript) before any planned reset or once context passes ~60%. The first thing it does after a compaction or new session is read that file.
  3. Load memory explicitly at session start. We had a period where USER.md/MEMORY.md weren't being injected, so AGENTS.md now tells the agent to read them itself on the first turn of a direct chat.
  4. Keep the main chat session light. Long jobs go to isolated scheduled runs or subagents, so the main context doesn't fill up with tool output and compact mid-task.
  5. Keep AGENTS.md short and move detail to files the agent reads on demand. A bloated bootstrap eats the window before you start.

With those in place, compaction mostly stops mattering, because nothing lives only in the conversation.

1

u/otterquestions Pro User 4d ago

Thanks!!

1

u/kaijurules 4d ago

We keep a handoff note like that too, and ours gets replaced in full every time, never appended to. Anything left sitting in it gets read as still open after a compaction, so a thread that closed two days ago comes back unless the rewrite drops it.

2

u/Elton_Lau Member 4d ago

Following

2

u/LogicalConceptpart 4d ago

What helped me most was not letting both layers compact. Pick one to own it. If Claude Code is auto compacting underneath while OpenClaw is also trying to manage context, you end up with summaries of summaries and the agent slowly forgets what it was doing.

1

u/nontrollusername 4d ago

Use DAG memory structure, people have geeked out more then me to explain it, but it works