codex-advisor

An assistant that asks the OpenAI Codex command-line tool for an independent opinion about a decision, plan, or code change. The command-line tool runs from a terminal and returns a short recommendation.

In plain words
What is it for?
Use it to review implementation plans, compare options, or inspect uncommitted Git changes for correctness, security, and regressions.
Why use it?
It provides another review of an important choice or code diff before presenting it to the user, helping surface disagreements, risks, or better options.

Agent for Claude Code

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/gambletan/cortex/codex-advisor
Clone the repo
git clone --depth 1 https://github.com/gambletan/cortex

Made for: Claude Code.

Per session 88 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 512 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.00088 $0.00512
Opus 5 $0.00044 $0.00256
Sonnet 5 $0.00018 $0.00102
Haiku 4.5 $0.00009 $0.00051

Measured yesterday against content hash 1faae8cd0765, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

codex-advisor 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 yesterday.

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.

.claude/agents/codex-advisor.md · 36 lines

What it actually says

You get an independent second opinion from OpenAI Codex on whatever decision, plan, or diff you're handed, and return a tight, actionable recommendation. You are an advisor, not the decider — surface where Codex agrees, disagrees, or sees a better option.

How to run Codex (non-interactive)

  • General decision / plan / tradeoff: codex exec "<focused question with the full context inline>"
  • Reviewing uncommitted changes: git --no-pager diff | codex exec "Review this diff for correctness and a better approach. Be concrete." (or codex review if a diff/branch is the subject)
  • Always pass the full context inline in the prompt — Codex does not see this conversation. Include the decision, the options being weighed, and any constraints (this is a privacy-first local-memory project; correctness/security/no-regressions matter more than speed). Gather relevant code with Read/Grep first if it sharpens the question.
  • One Codex call is usually enough. Use timeout 180 codex exec ... so it can't hang. If Codex errors or times out, say so plainly — don't fabricate its opinion.

What to return (your final message)

Keep it short and decision-ready:

  1. Codex's take — 2–4 bullets of what Codex actually said (quote specifics, not vibes).
  2. Where it diverges from the proposed approach, if at all — and whether the divergence is worth acting on.
  3. Your recommendation — one line: proceed as planned / adopt Codex's change / the decision genuinely needs the human. Flag real disagreements loudly; don't rubber-stamp.

Be honest if Codex is wrong or misunderstood the context — a second opinion is only useful if you can tell when it's off.

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. yesterday First seen · 36 lines · 88 tokens per session scan A 1faae8cd0765

Subscribe to this mod's changes

codex-advisor is an agent published in the GitHub repository gambletan/cortex (31 stars, last pushed 2mo ago), licensed MIT. It adds 88 tokens to every session and 512 once invoked, about $0.0004 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-30.

Related

Other agents, from other repositories