Agent
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:
codex login
red --agent-check --strictRed 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
- 1Open Agent.
Press Space A or run :Agent.
- 2Write the request.
Press Enter to send. Use Alt+Enter, Shift+Enter, or Ctrl+J for a newline.
- 3Follow the work.
The transcript streams the response and groups tool activity for the turn. Press Ctrl-c to interrupt.
- 4Inspect 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.
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.