I built a Codex patch that lets Astra decide when to compact

by

I noticed GPT-6 Astra was good at identifying when it had finished a phase and no longer needed the raw tool output, so I built a Codex patch that lets it request compaction itself.

The model writes a checkpoint with the relevant decisions, constraints and next steps. The patch runs native compaction, carries that checkpoint forward verbatim, and resumes the task.

In one conversation covering two PRs: 767 tool calls, 18 completed compactions, and 90.9k median input tokens per tool call—roughly 39–47% below the estimated 150–170k median with compaction at 236k. All 18 completed handoffs preserved the checkpoint exactly and continued working.

I’ve shared it with everyone on my team. So far, they report no noticeable drop in output quality and their quota draining more slowly!

Code and installation instructions:

26 views

Add a comment

Replies

Best

Helps me save an insane amount of tokens when using Astra.