Skip to content

Codex

Codex runs the Token Optimizer engine through its own hook API. Quality scoring, cost tracking, the dashboard, and session continuity all work. A few Claude Code features are approximated or unavailable because the Codex hook API exposes less than Claude Code’s, and each gap is named below with its upstream cause.

Codex CLI and Codex Desktop share one adapter. There is no separate Desktop install. The telemetry hook profile adds PostToolUse rows that render in Desktop.

  • Codex CLI is the primary surface.
  • Codex Desktop loads the same ~/.codex/hooks.json and behaves identically.

Install from the Codex (CLI) or Codex (Desktop) page. The full capability grid is at /reference/capability-matrix/.

Every Token Optimizer command on Codex carries the runtime prefix:

Terminal window
TOKEN_OPTIMIZER_RUNTIME=codex python3 skills/token-optimizer/scripts/measure.py <command>

This selects the Codex adapter, the Codex dashboard port, and Codex pricing. Omitting it falls back to the Claude Code defaults.

Codex uses different config and memory conventions, and the adapter follows them.

ConceptClaude CodeCodex
Config fileCLAUDE.mdAGENTS.md
Memory systemMEMORY.md plus project memory dirs~/.codex/memories/**/*.md
Model routing adviceOpus, Sonnet, Haiku per agentIntelligence levels plus GPT-5.x model selection
Hook installAuto on plugin install, 8 eventscodex-install command, global by default, 4 profiles, 3 to 5 events
Compact lifecyclePreCompact and PostCompact capture and restoreCompact-prompt guidance plus Stop checkpoints
Tool result archivePostToolUse archives immediatelyStop-time backfill from JSONL, or PostToolUse on the telemetry profile
Dashboard refreshSessionEnd hook plus daemon at 24842Stop hook plus daemon at 24843

The Token Coach reads AGENTS.md and the Codex memory directories, and its routing advice speaks in GPT-5.x intelligence levels and model choices rather than the Claude model tiers.

Codex hooks install through codex-install. Pick a profile by how much surface noise you want.

ProfileInstallsNoise
balanced (default)SessionStart, UserPromptSubmit, Stop, compact promptLow, 3 events
quietStop onlyMinimal, 1 event
telemetryBalanced plus PostToolUseMedium, visible rows in Desktop
aggressiveAll hooks including experimental Bash PreToolUseHigh, full coverage
Terminal window
TOKEN_OPTIMIZER_RUNTIME=codex python3 skills/token-optimizer/scripts/measure.py codex-install --profile quiet
CapabilityStatus on Codex
Quality scoring (7 signals, dual composite, GPT-5.x curves)Yes
S/A/B/C/D/F gradesYes
Session continuity and checkpointsYes
Dashboard (port 24843) and bookmarkable daemonYes
Cost tracking (GPT-5.x pricing)Yes
Fleet Auditor (cross-system, includes Codex sessions)Yes
Token Coach (adapted for AGENTS.md)Yes
Memory and config audit (AGENTS.md plus memories)Yes
Proactive context nudgeYes
Per-prompt quality steering (via UserPromptSubmit)Yes
FeatureBehavior on CodexUpstream cause
Smart CompactionApproximated through compact-prompt guidance plus Stop checkpointsNo PreCompact or PostCompact hook in Codex
Crash recoveryApproximated with Stop plus the compact promptNo StopFailure hook in Codex
Bash output compressionExperimental opt-in onlyCodex hooks cannot rewrite tool input silently
Cache-write TTL breakdownCached input shown, no 1h or 5m splitCodex logs do not expose cache-write TTL fields
Skill usage telemetryPartial, from limited log signalsCodex logs do not expose every skill invocation event
FeatureUpstream cause
Delta read substitutionCodex PreToolUse Read hook does not support updatedInput
Structure-map substitutionSame updatedInput gap
Keep-Warm automationSee below
Terminal window
TOKEN_OPTIMIZER_RUNTIME=codex python3 skills/token-optimizer/scripts/measure.py codex-doctor --project "$PWD"

A healthy install reports 0 FAIL.

The Codex dashboard serves at http://localhost:24843/token-optimizer. The Claude Code dashboard on 24842 can run at the same time without conflict. The file fallback lives at ~/.codex/_backups/token-optimizer/dashboard.html.

Terminal window
TOKEN_OPTIMIZER_RUNTIME=codex python3 skills/token-optimizer/scripts/measure.py setup-daemon

For LAN access, set TOKEN_OPTIMIZER_DASHBOARD_HOST=0.0.0.0 before setup-daemon. The setting is sticky and independent per runtime.

Token Optimizer tracks these Codex model prices for cost figures.

ModelInput ($/1M)Cached ($/1M)Output ($/1M)
GPT-5.5$5.00$0.50$30.00
GPT-5.4$2.50$0.25$15.00
GPT-5.4-Mini$0.75$0.075$4.50
GPT-5.3-Codex$1.75$0.175$14.00
GPT-5.2$1.75$0.175$14.00

Codex auto-upgrades Git-backed marketplaces on startup with git ls-remote. Force an upgrade with codex plugin marketplace upgrade.