ImplementationAgent Runtimes
Codex Setup Guide
Set up OpenAI Codex in the terminal or desktop app to work with project files, AGENTS.md instructions, and MCP servers.
Intermediate15–20 minTerminal access; ChatGPT plan or OpenAI API key
ToolkitCarrelKimi Plugin
We work in Codex every day alongside Claude Code and Kimi; this guide shows how it fits a shared research repository.
Why Codex fits Research Memex
Codex is OpenAI's workspace agent, available as a terminal CLI (codex) and a desktop app. In research work, it fits three jobs well:
- following explicit multi-step protocols and checklists in
AGENTS.md - reviewing Git changes with
codex reviewand checking named research files withcodex exec - sharing a Git repository with Claude Code and Kimi so a second model critiques what the first produced
Read Agent Runtimes: How Workspace Agents Work first for the six layers all workspace agents share.
Install and authenticate
Install the CLI or desktop app from the official Codex documentation (opens in a new tab) (or GitHub (opens in a new tab)) and verify with codex --version. Choose one authentication route:
- ChatGPT plan sign-in — run
codex loginto use your subscription allowance. LeaveOPENAI_API_KEYunset in your shell profile so requests do not silently route to API billing. - OpenAI API key — export
OPENAI_API_KEYbefore launching Codex for pay-per-token Platform billing.
Model availability differs by route; see Subscriptions you already hold and the AI Model Reference Guide.
Configuration, sandbox, and MCP servers
Codex reads AGENTS.md from the repository root down to your working directory (pair it with CLAUDE.md on multi-host projects) and stores user settings in ~/.codex/config.toml (overridable per run with -c key=value). You can also route Codex to custom providers such as OpenRouter in config.toml; see OpenRouter's Codex CLI guide (opens in a new tab).
Codex separates two safety controls: the filesystem sandbox (read-only inspection versus workspace-write) and command approval (when Codex pauses before running commands or editing files). Inspect your version's flags with codex --help, and start screening or coding in read-only or on-request approval mode on a clean Git tree.
Codex has built-in file and shell tools and needs no Filesystem MCP. To register remote HTTP or local stdio servers (including https://research-memex.org/mcp), follow Transports and host registration.
Skills, plugins, and non-interactive checks
Package repeatable procedures as skills invoked with $ (for example, $kimi after installing the Kimi Plugin), or install multi-host plugins such as the Kimi Plugin via codex plugin marketplace add.
Use Codex's session and non-interactive commands to audit work across hosts:
# Resume the latest session or fork to test an alternative framing
codex resume --last
codex fork
# From a Git repository, review uncommitted changes against AGENTS.md
codex review --uncommitted
# From the same repository, run a scripted verification check
codex exec "Verify that every row in analysis/extraction.csv cites a file in literature/"Use codex review --uncommitted for changes in a Git repository, or give codex review an explicit base branch or commit. For a standalone vault or a table already committed, open Codex in the project folder and name the file, sources, and criteria you want it to check. See Composing an Agentic Research System for the full shared-repository workflow.
referenced in 7 chapters
- AI Model Reference Guide§ Testing models on your own material
- The Research Workbench: How the Tools Connect§ Add tools for a task
- MCP Explorer Guide§ When an MCP server actually helps
- Agent Runtimes: How Workspace Agents Work§ Choose your starting runtime
- Claude Code Setup Guide§ First research task and worked examples
- Case Study: Systematic Reviews with AI§ Tools & budget
- Building an SLR with Claude Code§ Introduction: from cognitive overload to architectural oversight
cite this page
Lin, X. (2026). Codex Setup Guide. Research Memex. https://research-memex.org/docs/implementation/agentic-ai-tools/codex-setup-guide
@misc{docs-implementation-agentic-ai-tools-codex-setup-guide-2026,
author = {Xule Lin},
title = {Codex Setup Guide},
year = {2026},
howpublished = {\url{https://research-memex.org/docs/implementation/agentic-ai-tools/codex-setup-guide}},
note = {ORCID: 0000-0001-7885-4194}
}one renderingthe source remains