Optimization layer for Codex

Ship more code.
Send less context.

CostLayers reuses verified repo context and prior agent work so coding agents spend fewer tokens rediscovering what they already know.

Local audit · no provider key required
cd your-repo
npx -y https://costlayers.com/costlayers-0.8.61.tgz audit

The audit creates local .agentspend/ reports and does not upload source by default. Hosted 0.8.61 is checksum-published; npm latest is not yet current. Release details

Measured on authenticated Codex runsNative-login token telemetry, not provider invoice savings.
73.7%fewer measured input tokens
10/10optimized tasks passed
40/40matched quality gates passed
5 repospublic external codebases

Your agent should not relearn the same repository every session.

CostLayers starts with an audit, then adds reusable context and proof only where the result can be checked.

01

Find repeated context

Identify the files and repository facts agents repeatedly pay to inspect.

02

Reuse certified work

Bind prior analysis to repository state and a passing evaluator before reuse.

03

Keep claims separate

Context estimates, native usage stretch, and API invoice savings remain visibly distinct.

Synthetic sample proofInterface preview
Synthetic CostLayers dashboard showing before and after context tokens, claim boundaries, and a quality status
Synthetic interface preview. It illustrates the dashboard format and is not customer or benchmark evidence.

One useful result before any workflow change.

Start locally. Connect Codex only after the audit finds enough repeated work to matter.

01 / AUDIT

Scan one repo locally

Measure repository context and generate a compact, source-local report. No provider key is required.

02 / REUSE

Launch with verified context

Route through existing code-memory backends and reuse only state-bound, evaluator-certified work.

03 / PROVE

Compare the outcome

Record token telemetry and quality receipts. Count provider dollars only when API invoice evidence exists.

Less context. Same deterministic result.

The latest native Codex comparison used ten frozen tasks across Requests, Flask, Click, Express, and Gin.

Plain Codex input tokens2,132,015
CostLayers input tokens560,804
Measured reduction73.6961%
Quality gates40 / 40 passed
Memory backends bound2 / 2 on every row
Claim boundary: this is authenticated native Codex token telemetry, not verified OpenAI invoice savings. Provider-native caching and discounts are never counted as CostLayers-attributed savings.

Start local. Opt into hosted processing deliberately.

The audit path and API path have different data boundaries. The product should make that obvious before either runs.

Local auditReads the repo on your machine and writes reports under .agentspend/.
Default uploadNo source upload is required for the local audit path.
Native Codex modeUses your existing ChatGPT login and reports context efficiency, not subscription invoice reduction.
API invoice modeRoutes opted-in API traffic through CostLayers and your provider account for explicit metering.
What does the audit command change?

It creates local reports in .agentspend/. It does not intentionally modify or delete source files. Local cleanup is explicit through the privacy command.

Know what is measured before you run it.

Does this lower my ChatGPT subscription bill?

No. Native Codex mode can reduce repeated context and stretch usage, but subscription pricing and limits remain controlled by the provider.

When do invoice savings count?

Only when API-billed traffic is explicitly routed through CostLayers and a quality-passing receipt contains provider cost counters.

Will quality drop with less context?

CostLayers reuses state-bound context and falls back when proof is missing. The current native benchmark passed all 40 matched deterministic quality gates; broader production quality still requires your own eval.

Who should use this first?

Teams running repeated Codex workflows on medium or large repositories, especially when agents repeatedly rediscover architecture, tests, and execution paths.

Find out what your agents relearn every day.

Run the local audit on one real repository, or bring one workflow to a 15-minute setup call.

cd your-repo
npx -y https://costlayers.com/costlayers-0.8.61.tgz audit