Configuration Options for the Codex Plugin: Complete Guide for openai/codex-plugin-cc
The Codex plugin supports seven core configuration options—model, temperature, maxTokens, reviewGate, adversarialReview, openaiApiKey, and endpoint—that control AI behavior, review workflows, and API connectivity.
The openai/codex-plugin-cc repository provides a Claude plugin that integrates OpenAI’s Codex model into the Claude Code environment. Understanding the available configuration options for the Codex plugin is essential for customizing model behavior, securing API credentials, and enabling specialized review workflows. These settings are defined across the plugin manifest, runtime environment variables, and initialization parameters.
Core Configuration Options
The plugin’s behavior is controlled through a combination of static metadata and runtime parameters. Below are the specific options available for tuning the Codex plugin.
Model Selection
The model option specifies which OpenAI model handles code generation and review tasks. Typical values include gpt-4o, gpt-4-turbo, and gpt-3.5-turbo. This option is read by the runtime when the plugin is instantiated. Default: gpt-4o.
Sampling Parameters
Two options in plugins/codex/scripts/lib/codex.mjs control the generation behavior:
temperature: Controls randomness of model responses. Lower values (e.g.,0.0) produce deterministic output, while higher values (e.g.,0.7) increase creativity. Default:0.2.maxTokens: Sets the upper limit on tokens returned in a single request. Default:4096.
Review Workflow Flags
Advanced review behaviors are controlled by boolean flags:
reviewGate: When set totrue, activates the stop-review-gate hook implemented inplugins/codex/scripts/stop-review-gate-hook.mjs. This allows the plugin to halt a review if specific conditions are met. The flag is stored in runtime state viaplugins/codex/scripts/lib/state.mjs. Default:false.adversarialReview: Enables an enhanced security prompt that asks the model to identify subtle bugs and edge-case failures. This uses the prompt template located atplugins/codex/prompts/adversarial-review.md. Default:false.
Environment-Based Configuration
Sensitive and deployment-specific settings are read from environment variables within plugins/codex/scripts/lib/codex.mjs rather than hard-coded configuration files.
API Authentication
The openaiApiKey option maps directly to process.env.OPENAI_API_KEY. You must provide this value through environment variables or a .env file; never embed credentials in source code.
Custom Endpoints
The endpoint option allows specifying an alternative API URL for private deployments or testing. The default value is https://api.openai.com/v1/chat/completions. This is also read from environment variables in plugins/codex/scripts/lib/codex.mjs.
Implementation Details by Source File
Understanding where each option is processed helps with debugging and extending the plugin:
plugins/codex/.claude-plugin/plugin.json: Contains the plugin name and version metadata read by the Claude runtime.plugins/codex/scripts/lib/codex.mjs: Core wrapper that builds request payloads and readsmodel,temperature,maxTokens,openaiApiKey, andendpointconfigurations.plugins/codex/scripts/lib/state.mjs: Holds runtime state, including thereviewGateflag.plugins/codex/scripts/stop-review-gate-hook.mjs: Implements the logic for thereviewGateoption.plugins/codex/prompts/adversarial-review.md: Prompt template used whenadversarialReviewis enabled.plugins/codex/scripts/app-server-broker.mjs: Entry point that reads configuration and starts the plugin server, orchestrating the initialization flow.
Configuration Examples
Override defaults using environment variables before initializing the plugin:
// Example: Overriding the default model and temperature via environment variables
process.env.CODEX_MODEL = "gpt-4-turbo";
process.env.CODEX_TEMPERATURE = "0.5";
// Example: Enabling the review gate from a script that launches the plugin
import { launchPlugin } from "./plugins/codex/scripts/lib/app-server.mjs";
await launchPlugin({
reviewGate: true, // turn on the stop‑review‑gate hook
adversarialReview: false, // keep normal review flow
model: "gpt-4o",
temperature: 0.2,
});
Provide sensitive credentials via shell environment:
# Example: Providing the API key via a .env file
export OPENAI_API_KEY="sk‑xxxxxxxxxxxxxxxx"
# Then start the plugin server
node plugins/codex/scripts/app-server-broker.mjs
Summary
- The Codex plugin offers seven primary configuration options:
model,temperature,maxTokens,reviewGate,adversarialReview,openaiApiKey, andendpoint. - Static metadata resides in
plugins/codex/.claude-plugin/plugin.json, while behavioral tuning happens inplugins/codex/scripts/lib/codex.mjs. - Sensitive credentials (
openaiApiKey) and custom endpoints must be set via environment variables, never hard-coded. - The
reviewGateandadversarialReviewoptions enable advanced safety workflows viaplugins/codex/scripts/stop-review-gate-hook.mjsandplugins/codex/prompts/adversarial-review.md. - Initialization occurs through
plugins/codex/scripts/app-server-broker.mjs, which orchestrates configuration loading.
Frequently Asked Questions
How do I set the OpenAI API key for the Codex plugin?
Set the OPENAI_API_KEY environment variable before launching the plugin. The runtime reads this from process.env.OPENAI_API_KEY in plugins/codex/scripts/lib/codex.mjs. Never hard-code the key in configuration files or source code.
What is the difference between reviewGate and adversarialReview?
The reviewGate option activates a hook in plugins/codex/scripts/stop-review-gate-hook.mjs that can halt reviews based on runtime conditions, while adversarialReview changes the prompt template to ask the model specifically for subtle bug detection using plugins/codex/prompts/adversarial-review.md.
Can I use a custom OpenAI endpoint with the Codex plugin?
Yes. Set the endpoint environment variable to your custom URL. The default is https://api.openai.com/v1/chat/completions, but you can override this in plugins/codex/scripts/lib/codex.mjs for testing or private deployments.
Where are the default model and temperature values defined?
Default values for model (gpt-4o) and temperature (0.2) are defined in plugins/codex/scripts/lib/codex.mjs. These values are used when the plugin is instantiated unless overridden by environment variables or initialization parameters.
Have a question about this repo?
These articles cover the highlights, but your codebase questions are specific. Give your agent direct access to the source. Share this with your agent to get started:
curl -s "https://instagit.com/install.md" Maintain an open-source project? Get it listed too →