Feature: Allow /compact to accept a natural-language hint for selective context retention
What variant of Codex are you using?
CLI
What feature would you like to see?
<html>
<body>
<!--StartFragment--><!-- obsidian --><p>Currently, <code>/compact</code> summarizes the entire conversation indiscriminately — it treats all context equally and produces a single compressed summary. This means the user has no way to tell the compactor which pieces of context are critical (and should be preserved in detail) versus which are disposable (and can be aggressively condensed or dropped entirely).</p>
<p>I'd like <code>/compact</code> to accept an optional free-form, natural-language argument that guides the summarization. For example:</p>
<pre><code>/compact focus on the auth refactor decisions and the new DB schema; discard the earlier linting discussion and test output
</code></pre>
<pre><code>/compact keep the API endpoint signatures and error handling patterns; everything else can be summarized briefly
</code></pre>
<p>The argument would be appended to (or incorporated into) the compaction prompt so the model knows what the user considers important before it produces the summary.</p>
<h3 data-heading="Problem">Problem</h3>
<p>After 2–3 compactions in a long session, critical context is often lost because the compactor doesn't know what matters most to the user (related: #14347, #5957). Users currently have no mechanism to influence <em>what</em> gets retained and <em>what</em> gets dropped. The compactor's one-size-fits-all approach means:</p>
<ul>
<li>Important architectural decisions may be condensed away while verbose tool output is preserved.</li>
<li>Repeated compactions compound the information loss unpredictably.</li>
<li>Users who <em>know</em> what they need going forward cannot communicate that knowledge.</li>
</ul>
<h3 data-heading="Proposed behavior">Proposed behavior</h3>
Syntax | Behavior
-- | --
/compact (no argument) | Current behavior — unchanged
/compact <natural-language hint> | The hint is injected into the summarization prompt to bias retention/discard
<p>The hint should be treated as a soft directive — the compactor still produces a valid summary, but prioritizes retaining the topics/artifacts the user mentioned and aggressively condenses or omits the rest.</p>
<h3 data-heading="Additional information">Additional information</h3>
<p>This would pair well with the existing compaction prompt in <code>codex-rs/core/templates/compact/prompt.md</code>. One minimal implementation approach: concatenate the user hint as an additional instruction paragraph before sending the conversation to the summarization model.</p><!--EndFragment-->
</body>
</html>
Additional information
_No response_
This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗