cortex: Agent for Claude Code

.claude/agents/codex-advisor.md

codex-advisor is an agent for Claude Code from gambletan/cortex. It costs 88 tokens per session (512 once invoked), scanned A, original, MIT.

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

Written for Claude Code: installed under .claude/. Also seen: model in frontmatter; runs codex exec; mentions Codex.

This is gambletan/cortex's own configuration. It tells Claude Code how to work on cortex itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything cortex configures →

Reuse

Borrowing it

Nothing to install: this file belongs to gambletan/cortex. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/gambletan/cortex/main/.claude/agents/codex-advisor.md
Clone the repo
git clone --depth 1 https://github.com/gambletan/cortex

Made for: Claude Code.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for codex-advisor

README.md
[![agentmods](https://agentmods.dev/badge/agents/gambletan/cortex/codex-advisor/github.svg)](https://agentmods.dev/agents/gambletan/cortex/codex-advisor)
Your own site
<a href="https://agentmods.dev/agents/gambletan/cortex/codex-advisor"><img src="https://agentmods.dev/badge/agents/gambletan/cortex/codex-advisor/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for codex-advisor

Your own site · 80×15
<a href="https://agentmods.dev/agents/gambletan/cortex/codex-advisor"><img src="https://agentmods.dev/badge/agents/gambletan/cortex/codex-advisor.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
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. A grade says what 26 rules found in the file — not that it is safe.
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.1 $0.00088 $0.00512
Opus 5.5 $0.00035 $0.00205
Sonnet 5.5 $0.00018 $0.00102
Haiku 4.5 $0.00009 $0.00051

Measured 2mo ago against content hash 1faae8cd0765, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, 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 2mo 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.

.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. 2mo ago 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 (35 stars, last pushed 7d ago), licensed MIT. It adds 88 tokens to every session and 512 once invoked, about $0.0004 per session on Opus 5.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.