Composer prompt refinement with optional selectable memory/context attachments

Open 💬 0 comments Opened Jul 3, 2026 by thodupunuriarun

What variant of Codex are you using?

Codex App and composer-based workflows. This could also apply to CLI/TUI composer flows.

What feature would you like to see?

I would like Codex to support a composer-level prompt refinement workflow with two explicit modes:

  1. Rewrite only
  2. Rewrite + suggest context

The goal is to help users turn a rough prompt into a clearer task before sending, while keeping control over whether additional memory or knowledge-base context is included.

Proposed behavior

When the user writes a rough prompt in the composer, Codex could offer a Refine action with two options:

1. Rewrite only

Rewrite the prompt for clarity using only:

  • the current draft
  • the current session/thread context

This mode should not search or attach external memories, prior sessions, project notes, uploaded docs, or knowledge-base entries.

2. Rewrite + suggest context

Search for potentially relevant context from sources such as:

  • Codex memories
  • prior sessions/past work
  • project notes
  • imported ChatGPT context
  • uploaded docs
  • knowledge-base entries

Codex should then show suggested context as removable chips/cards before sending. Each suggested item should show:

  • source
  • short preview
  • relevance label, such as High relevance, Possibly relevant, or Loosely related

The user should be able to include, exclude, or edit the suggested context before the refined prompt is produced.

The final refined prompt should use only the selected context.

UX note

To keep the composer lightweight, the context-selection UI should appear only after the user chooses Rewrite + suggest context. The default composer should not become cluttered with memory controls, chips, previews, or extra panels unless the user asks for context suggestions.

Optional refinement instruction

The user should optionally be able to give a short instruction for how to refine the prompt, for example:

  • “make this shorter”
  • “turn this into an implementation task”
  • “add acceptance criteria”
  • “preserve technical details”
  • “do not expand scope”
  • “make this suitable for a bug report”
  • “ask clarifying questions if context is missing”

This should be optional, not required. The refinement feature should not become another prompt-writing burden.

Why this matters

This solves two common problems:

  1. The user writes a rough prompt and wants help making it clear before sending.
  2. Codex may need relevant prior context, but automatic memory injection can be too silent or too broad.

This feature keeps the user in control. Codex can suggest context, but the user decides what is actually attached.

Non-goals and guardrails

  • Do not auto-inject large memories silently.
  • Do not search all memories or all project history by default.
  • Do not make this mandatory before every send.
  • Preserve exact technical literals such as file paths, commands, flags, branch names, API names, quoted text, and code snippets unless the user explicitly asks to rewrite them.
  • Do not treat this as a replacement for scoped memory storage.

Related issues

This seems complementary to:

  • #19758 for topic-based memory and relevance-loaded memory topics

I also left a related comment on #19758 with the same composer-level framing: https://github.com/openai/codex/issues/19758#issuecomment-4874480352

The distinction is that this request is specifically about the composer UX layer: refining a draft prompt, optionally with user-selected memory/context attachments, before the message is sent.

View original on GitHub ↗