opencode icon indicating copy to clipboard operation
opencode copied to clipboard

feat: configurable compaction

Open maxeonyx opened this issue 2 months ago • 9 comments

This will help to address the many issues about compaction

Closes #3031

I have had great success using this version with a custom "handover" compact prompt.

example: override /compact with compact.md

This will now affect auto-compaction.

~/.config/opencode/command/compact.md

---
description: my custom compact
compact: true
---

Provide a detailed summary focusing on ...

example: custom command /handover

~/.config/opencode/command/handover.md

---
description: handover to new agent
compact: true
---

Produce a handoff note from this conversation ...

example: set auto-compact to use /handover

~/.config/opencode/opencode.json

{
  "compaction": {
    "command": "handover"
  }
}

I have spent a lot of time making this PR as small and well integrated as possible, as I'm relying on it for my day-to-day work.

maxeonyx avatar Nov 10 '25 00:11 maxeonyx