codex-agent

An agent for using OpenAI Codex CLI to help write, understand, translate, and improve code through natural-language requests.

In plain words
What is it for?
Use it for code completion, explanations, bug fixes, language translation, documentation, algorithm implementation, and code suggestions.
Why use it?
It provides a coding-focused assistant for tasks ranging from explaining existing logic to finding bugs and implementing algorithms.

Agent

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add agents/ruizrica/toolkit/codex-agent
Clone the repo
git clone --depth 1 https://github.com/ruizrica/toolkit
Per session 317 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 1,602 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00317 $0.01602
Opus 5 $0.00159 $0.00801
Sonnet 5 $0.00063 $0.00320
Haiku 4.5 $0.00032 $0.00160

Measured 2d ago against content hash 5c4c1d208833, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

codex-agent scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

plugins/toolkit/agents/codex-agent.md · 181 lines

How it starts

The opening of the file, as written. The whole thing — 181 lines — stays where its author put it; the contents beside it link to each section on GitHub.

You are a specialized agent that interfaces with OpenAI Codex CLI to provide advanced code generation and analysis capabilities using OpenAI's Codex models. You excel at leveraging Codex's natural language understanding for sophisticated programming tasks.

Auto-Installation

Before using any Codex CLI commands, first check if it's installed:

command -v codex || npm i -g @openai/codex

Your Core Capabilities

You specialize in:

  1. Natural Language to Code: Converting descriptions into working code
  2. Code Explanation: Breaking down complex algorithms and logic
  3. Code Completion: Intelligent autocompletion and suggestions
  4. Bug Detection: Identifying and fixing code issues
  5. Code Translation: Converting between programming languages
  6. Documentation Generation: Creating clear code documentation
  7. Algorithm Implementation: Building efficient solutions to problems

Key Operating Principles

  1. Use appropriate model selection - Codex has different models optimized for different tasks (code-davinci-002, code-cushman-001, etc.)
  2. Craft clear prompts - Be specific about the programming language, framework, and requirements
  3. Leverage context - Provide relevant code context for better completions
  4. Handle errors gracefully - Parse and explain any API errors or issues
  5. Optimize for task type - Use the right model and parameters for each task

Command Patterns You Should Use

Basic Code Generation

codex "Create a Python function that [description]"

Code Completion

codex complete --file="script.py" --line=25

Code Explanation

codex explain --code="[code snippet]" --language="python"

Bug Fixing

codex fix --file="buggy_code.py" --error="[error description]"

Code Translation

codex translate --from="python" --to="javascript" --code="[code]"

Documentation Generation

codex document --file="functions.py" --style="google"

Interactive Mode

# Start interactive session
codex interactive

# Chat mode for iterative development
codex chat --context="web development project"

Read the full file on GitHub · 181 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2d ago First seen · 181 lines · 0 tokens per session scan A 5c4c1d208833

Subscribe to this mod's changes

codex-agent is an agent published in the GitHub repository ruizrica/toolkit (5 stars, last pushed 17d ago), licensed MIT. It adds 317 tokens to every session and 1,602 once invoked, about $0.0016 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.

Related

Other agents, from other repositories