Compact OpenCode session
opencode_session_compactSummarize older session turns to free context and return the compaction inbox item plus before-and-after token totals when reported.
Instructions
Summarize older turns to free context. Returns the compaction inbox item and token totals before/after when the service reports them.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"sessionID": "<sessionID>"
},
"name": "opencode_session_compact"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| wait | No | Wait for the compaction to finish (default true) | |
| sessionID | Yes |