compact_conversation
Folds a long agent conversation transcript into a Consolidated State Ledger to reduce context bloat when token budgets warn or before starting a new subtask.
Instructions
On-demand context compaction: folds a long agent conversation transcript into a compact Consolidated State Ledger. Use when tokensafe:context_budget reports warning/critical, when the context window feels heavy, or before starting a new subtask inside the same session. The transcript path comes from your host session (hook payload transcript_path / session start context).
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": {
"transcript_path": "<transcript_path>"
},
"name": "compact_conversation"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| invocation_num | No | Optional: current turn number (default 3; folding requires >= 3 turns) | |
| transcript_path | Yes | Path to the JSONL transcript of the current session |