Codex CLI

Cut Your Codex CLI Token Costs by 40–70%

Terse auto-detects OpenAI's Codex CLI — the #1-ranked terminal coding agent — compresses every prompt before it reaches the model, and tracks per-turn cost as context grows each turn. At GPT-5, Codex, and GPT-4o rates. All on-device.

40–70%prompt compression
AutoCodex CLI detection
Per-turnOpenAI-rate cost tracking
0data leaves device

How Terse Works with Codex CLI

Codex CLI runs an agentic loop: it reads your repo, edits files, and runs commands — re-sending the accumulated context every turn. Input tokens climb the longer the session runs. Terse compresses what it can — your typed prompts — and flags what drives the climb: redundant file reads as Codex works.

Terminal — Codex CLI Session
Terse Active
$ codex --model gpt-5-codex
OpenAI Codex CLI · Terminal-Bench 2.1 #1 (83.4%) · workspace: ~/app
● Terse detected Codex CLI — monitoring (gpt-5-codex · per-turn cost on)
> could you please go ahead and take a look at the checkout flow and then refactor the paymnet handler so that it retries on transient network erors, and also please make sure the existing tests still pass afterwards
Terse: 44 tokens → 19 tokens · "refactor payment handler to retry on transient network errors, keep tests passing" · 57% reduction
codex reading: src/checkout/payment.ts [2,380 tokens] · context now 34.7K
⚠ Terse: payment.ts read 3× this loop — context re-sent each turn, cost compounding
12.9Kprompt tokens
34.7Kwithout Terse
63%compressed
$0.19this turn

Auto Codex CLI Detection

Terse scans running processes every 5 seconds. The moment you run codex in your terminal, a floating monitor bar attaches automatically — no config, no wrapper, no flags. Works whether you launch via API key or a ChatGPT/Codex subscription.

Automatic
🗜️

Prompt Compression

Every instruction you type into Codex's prompt runs through Terse's 7-stage pipeline: typo correction, filler removal, hedge stripping, and phrase shortening. File paths, flags, and code blocks pass through untouched.

7-Stage Pipeline
🔁

Redundant Read Flagging

Codex's agentic loop re-reads files as it edits and re-runs commands to check its work — and the whole context is re-sent each turn. Terse flags when the same file is read 2+ times so you can rein in a session before input tokens balloon.

Loop Tracking
💰

Per-Turn Cost at OpenAI Rates

Terse recognizes the model Codex is running — gpt-5-codex, GPT-5, GPT-4o, or GPT-4o mini — and prices each turn at the correct input/output rate. For API-key users, that's real dollars per turn, live in the terminal.

Per-Turn Visibility
📈

Context-Growth Meter

Because Codex re-sends accumulated context every turn, cost rises even when your prompt is short. Terse tracks the running context size and shows how fast it's growing — so you know when to /clear or start a fresh session.

Session Analytics
🔒

100% On-Device

Terse reads your terminal input via OS Accessibility APIs and compresses locally with a Rust engine. No prompt text, no code, and no file contents ever leave your machine or reach Terse's servers.

Zero Cloud

Supported Codex CLI Models

Codex CLI is powered by OpenAI models. Terse prices each turn at the correct rate — and still tracks cost if you point Codex at Claude or Gemini backends.

GPT-5 / Codex
$1.25/M input · $10/M output
GPT-4o
$2.50/M input · $10/M output
GPT-4o mini
$0.15/M input · $0.60/M output
o4-mini
$1.10/M input · $4.40/M output
Claude Sonnet 4.5
$3/M input · $15/M output
Claude Opus 4
$15/M input · $75/M output
Gemini 2.5 Pro
$1.25/M input · $10/M output
Local (Ollama)
Token count monitoring · no cost tracking

Frequently Asked Questions

Everything about using Terse with OpenAI's Codex CLI.

Does Terse work with Codex CLI automatically?
Yes. Terse scans running processes every 5 seconds. When you run codex in your terminal, Terse detects the process and activates a floating monitor bar. No wrapper, no flags, no configuration — detection is automatic whether you authenticate with an OpenAI API key or a ChatGPT/Codex subscription.
Why is my Codex CLI session so expensive?
Codex is agentic: it reads your repo, edits files, and runs commands in a loop, re-sending the accumulated context every turn. Input tokens grow steadily, and on GPT-5-class output pricing a long session adds up fast. Terse compresses your typed prompts and flags redundant file reads so the context stops ballooning turn over turn.
Does Terse help on a ChatGPT or Codex subscription, not just API keys?
Both. With an API key, Terse shows real per-turn dollar cost at GPT-5, Codex, and GPT-4o rates. On a subscription with usage limits, shorter prompts and fewer redundant reads mean you burn your quota slower and hit rate limits less often — you get more work per session either way.
Does Terse send my Codex prompts to any server?
No. Terse is 100% on-device. It reads your terminal input via OS Accessibility APIs, compresses locally using a Rust engine, and writes the compressed text back to the input field. Your prompts, code, and file contents never leave your machine — Terse only sees what you type, never Codex's agentic loop.

Also Works With

Terse reduces token costs across every major AI coding tool.

Claude Code ⌨️ Cursor — AI Code Editor 🤖 GitHub Copilot — VS Code 📟 Aider — Terminal

Stop Burning Tokens on Verbose Prompts

30-day free trial. No credit card required until your trial ends. Tracks cost at GPT-5, Codex, GPT-4o, and GPT-4o mini rates.

Start Free Trial — macOS Calculate Your Savings