Codex CLI Profiles for Parallel Sessions
Prepared and checked using AI. Sources are linked in the article.
To give Codex CLI different profiles for parallel sessions, save each configuration in a separate profile file and launch each session with codex --profile NAME. Profiles overlay your shared user configuration, so you can select different models, reasoning effort, and sandbox settings without repeatedly editing ~/.codex/config.toml.
Save one file per profile
In Codex 0.134.0 and later, profiles live in ~/.codex/NAME.config.toml. Older [profiles.NAME] tables and the top-level profile = "NAME" selector are no longer supported. Put ordinary top-level configuration keys in each profile file.
Start with an installed, authenticated CLI. The following examples use GPT-6.1 Sol and GPT-6 Astra; substitute models available to your account. model_reasoning_effort accepts levels supported by the selected model and client, so avoid assuming every model supports every effort level.
For example, create an implementation profile at ~/.codex/implement.config.toml:
model = "gpt-6.1-sol"
model_reasoning_effort = "medium"
sandbox_mode = "workspace-write"
approval_policy = "on-request"
Create an inspection profile at ~/.codex/inspect.config.toml:
model = "gpt-6-astra"
model_reasoning_effort = "low"
sandbox_mode = "read-only"
approval_policy = "never"
These profiles deliberately separate command permissions: workspace-write permits workspace edits, while read-only limits commands to the read-only sandbox. on-request allows approval requests; never disables approval prompts while retaining the selected sandbox restrictions.
The snippets use sandbox_mode. If your existing configuration uses default_permissions, choose one permissions configuration approach: default_permissions must not be combined with sandbox_mode or [sandbox_workspace_write].
Launch each session in its own worktree
Prepare separate worktrees first; the multiple Codex agents guide covers that workflow. For example, assume the worktrees already exist at ../app-implement and ../app-inspect.
The --cd flag sets the agent’s working directory before it processes your request. Launch the implementation session in one terminal:
codex --profile implement --cd ../app-implement
Launch the inspection session in another terminal:
codex --profile inspect --cd ../app-inspect
Keep reusable settings in the profile files and put the task instructions in each session. This gives you explicit launch commands you can reuse when assigning another task.
In each interactive session, run:
/status
Check the active model, approval policy, and writable roots before assigning work.
Override a profile for one launch
Use --model for a model override, -c or --config for a configuration key, and --sandbox for the command sandbox. For example, temporarily use Sol with medium reasoning in the inspection session:
codex --profile inspect --cd ../app-inspect \
--model gpt-6.1-sol \
-c 'model_reasoning_effort="medium"' \
--sandbox read-only \
--ask-for-approval never
These overrides apply to that invocation. The outer single quotes preserve the double quotes around the TOML string value passed to -c.
Understand which setting wins
CLI flags and configuration overrides take precedence over project settings, profiles, and user defaults. From highest to lowest, the configuration order is:
- CLI flags and
--configoverrides. - Trusted project
.codex/config.tomlfiles, with the file closest to the working directory winning. - The selected profile file.
- User configuration in
~/.codex/config.toml. - Cloud-managed configuration defaults, when supplied for the signed-in workspace.
- System configuration, if present.
- Built-in defaults.
A profile therefore does not guarantee the final value when a trusted project’s configuration supplies the same key. If a session starts with an unexpected model or sandbox setting, inspect its project configuration and launch arguments. Use an explicit CLI override when that launch needs to take precedence.
Organization-enforced requirements can also constrain allowed settings; a profile cannot bypass those requirements.
Two other details matter when troubleshooting:
- Plan mode has a separate
plan_mode_reasoning_effortkey. When unset, it uses its built-in preset default; configure it explicitly if your profile needs a particular supported effort in Plan mode. workspace-writestill protects Git metadata, including a worktree’s.gitpointer file and its resolved Git directory. Git operations that write there can require approval even when source-file edits succeed.
Where Parallel Code fits
Parallel Code is our free, open-source desktop app for macOS and Linux that runs several AI coding agents in parallel, each isolated in its own git worktree. It launches the agent CLIs you already use and provides a diff-first review surface for their changes.