Browse documentation

Compact task context

Make a deliberate context checkpoint without losing task history.

Task context compaction is an append-only checkpoint, not deletion of task history or a change to workflow state. After a compaction the default view contains the latest baseline and activity after its cutoff; rp task show <number> --full still reads the complete retained timeline.

Compact what you actually read

Use rp --json task show <number> to read the current context and obtain its task-scoped context.cursor. Write a concise Markdown baseline, then submit it with rp task compact <number> --cursor <cursor> --file <path>. Do not fetch a newer cursor while submitting an older summary: entries after your actual snapshot must remain in the visible delta. If the baseline has changed, fetch a new snapshot and deliberately reconcile rather than forcing a conflicting checkpoint. Browser compaction also freezes its displayed context and cursor together.

The context API reports characters, bytes, entry count and a rough token estimate. At 20,000 projected characters it warns; at 32,000 it refuses the user-authored write until you compact or explicitly override that one action with the supported force option. Force does not bypass authentication, text validation or workflow gates. rp task submit --push runs a non-mutating preflight for prospective text before pushing, but a later concurrent change may still block submission. A compaction does not fan out mention, Bell, Email or Desktop notifications.

Closing without merging is an exception: the browser and rp task close can record a required close reason without compaction or an override. Notes and API requests that combine closing with a title update still follow the usual rules.