context_compact
Condense older session entries into a single summary to free context budget, keeping recent entries untouched. Preview with dry_run first.
Instructions
Fold older entries into a single summary to free budget, keeping the most recent entries verbatim. Call this when context_status or context_append warns that the session is over budget. Pinned entries are never compacted. The originals are kept on disk and can be recovered, so this is safe to run. Use dry_run first to see what would happen.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| dry_run | No | Report what would be compacted without doing it | |
| session_id | Yes | Session identifier. Reuse the same string across a task to accumulate memory. | |
| keep_recent | No | How many of the newest entries to leave untouched (default 10) | |
| target_tokens | No | Rough size of the summary produced (default 400) |