Agent and inline assist

Agent and inline assist

Set up Codex, use the full Agent workspace or a bounded inline request, and know when a change is saved to disk.

Set up Codex

Agent features require Codex CLI 0.144.1 or newer. Install Codex, authenticate it, and run Red's offline prerequisite check:

Shell
codex login
red --agent-check --strict

Red starts codex app-server --stdio when the first Agent session needs it. If startup fails, Red keeps your prompt so you can fix the setup and retry.

Use the Agent workspace

  1. 1
    Open Agent.

    Press Space A or run :Agent.

  2. 2
    Write the request.

    Press Enter to send. Use Alt+Enter, Shift+Enter, or Ctrl+J for a newline.

  3. 3
    Follow the work.

    The transcript streams the response and groups tool activity for the turn. Press Ctrl-c to interrupt.

  4. 4
    Inspect the result.

    Agent file writes pass through Red's revision-checked editor tools and are saved to disk. Use :AgentHistory to inspect attributed transactions.

Press Alt+m in the Agent pane or run :AgentModel to choose the model and reasoning effort for that conversation. This doesn't change your global Codex settings.

The pane docks on the left, between the file tree and the editor, and sizes itself to the terminal. On a terminal too narrow to share, it covers the screen while you use it. With the pane focused, Ctrl-w L moves it to the right; Red remembers the side for each workspace. The row under the composer lists Alt-s sessions, Alt-n new, and Alt-c clear.

When the agent edits a file you've changed but not saved, Red asks before saving your changes. Agent edits change only the lines they need, so your cursor stays on its text, and one u undoes the whole edit.

Continue a previous conversation

Quitting Red doesn't end the conversation. The next time you open Red in the same workspace, the pane picks up the same Codex thread. Run :AgentNew to start fresh instead. Only one Red at a time drives a workspace's conversation; a second editor opened in the same workspace starts its own thread.

Press Alt-s in the Agent pane or run :AgentSessions to browse previous sessions. The tabs under the search field choose what's listed:

TabLists
RedRed sessions started in this workspace
This workspaceEvery Codex session started in this workspace
All CodexEvery interactive Codex session

Press Tab or Shift-Tab to switch tabs. Type to search session titles; Red then searches conversation text, which takes longer. Press Alt-p to peek at the selected session's latest exchange and Enter to continue it. A Red session from this workspace resumes in place; any other session continues in a new thread that starts from its recent history. Esc returns to your conversation and its unsent draft.

If Codex stops in the middle of a reply, the pane keeps what already streamed and holds queued follow-ups. Choose Retry the message, Ask Codex to continue where it stopped, or Leave it here, or run :AgentRecover. Edits the interrupted turn made stay applied.

Ask about the current code

Press Space i for inline assist. In Normal mode, Red targets the enclosing function when syntax information is available and otherwise uses the current line. Visual and Visual Line modes use the exact selection. Visual Block isn't supported.

An exact edit can apply immediately while its original popup remains in the foreground. The result is one unsaved, undoable editor transaction. Background results and wider same-file proposals wait for review. In the diff, press a to apply or d to decline; Enter opens the review but doesn't approve it.

Understand the boundary

Agent threads run with a read-only Codex sandbox and no native shell or direct file-edit path. Red supplies bounded tools for workspace files, open-buffer state, diagnostics, navigation, annotations, and revision-checked edits. Reads use the latest Red buffer contents, including unsaved changes.

Paths must remain inside the physical workspace. Red rejects traversal, symlinks, special files, protected paths, stale revisions, and unsafe writes. Secret-like paths are excluded unless you set allow_sensitive_paths = true under [agent].

Configured MCP servers and Codex features are disabled unless you name them in enabled_mcp_servers or enabled_codex_features.

Return to earlier work

Press Space H or run :InlineHistory to browse inline prompts, answers, ready edits, and applied changes. Press Space N to reopen the latest completed inline result.

Agent conversation state and inline history participate in Red's recovery snapshots. After a restart, Red resumes a persisted Codex thread when possible. If it can't, the old transcript remains visible as archived context and the next prompt begins a new session. To return to an older Agent conversation, see Continue a previous conversation.