cd /news/ai-tools/openai-codex-local-log-audit-516-tok… · home › topics › ai-tools › article
[ARTICLE · art-173340] src=github.com ↗ pub= topic=ai-tools verified=true sentiment=· neutral

OpenAI Codex local log audit: 516-token cliff and zero-reasoning drops

A new open-source tool, codex-local-audit, offers a read-only, offline forensic audit of local OpenAI Codex Desktop and CLI logs stored in ~/.codex/, checking subscription quota compliance against reasoning anomalies. Released in two feature-parity implementations, Node.js (audit_codex.mjs) and Python 3 (audit_codex.py), the tool flags zero-reasoning suppression where reasoning_output_tokens = 0 on flagship high/ultra requests, and checks a quantized 516-token cliff around 514..518 plus harmonics at 1034, 1552 and 2070, cross-checked against encrypted_content ciphertext byte lengths. It also inspects SQLite storage hygiene under GDPR Articles 5, 6, 15, 17 and 32, including unzeroed deleted freelist data in logs_2.sqlite and unencrypted microphone retention in dictation-history/, without reading auth.json or printing prompts, paths or account emails.

key takeaway

Run audit_codex.mjs or audit_codex.py read-only against ~/.codex/ to detect reasoning_output_tokens = 0 on high/ultra requests and the 516-token discontinuity at 514..518, cross-checked against encrypted_content byte lengths.

read7 min views19 publishedNov 20, 2026
OpenAI Codex local log audit: 516-token cliff and zero-reasoning drops
Image: Michielbdejong (auto-discovered)

Cross-platform (Windows, macOS, Linux), 100% read-only, offline forensic audit tool for local OpenAI Codex Desktop / CLI (~/.codex/) logs, SQLite databases, and installed client binaries.

Both implementations — zero-dependency Node.js (audit_codex.mjs) and Python 3 ( audit_codex.py) — have full feature parity and inspect only your own local data to verify:

  1. Quota Compliance: Actual 5-hour (primary ) and 7-day (secondary ) subscription usage vs. reasoning anomalies;
  2. Zero-Reasoning Suppression: Frequency ofreasoning_output_tokens = 0 (with0 reasoning blocks and0 encrypted bytes) on flagshiphigh /ultra requests — including the very first model call immediately after a user prompt;
  3. Quantized 516-Token Cliff ( 518k - 2 Harmonics): Exact discontinuity check around514..518 and multi-block harmonics (1034 ,1552 ,2070 ), cryptographically cross-checked againstencrypted_content ciphertext byte lengths;
  4. Silent Default & Summary Flips: Exact version/date timeline ofturn_context.summary (detailed →none ), server-pushedconfiguration_update effort downgrades, and bundledmodels.json defaults inside your installedcodex binary;
  5. Local Storage & GDPR Hygiene (Arts. 5, 6, 15, 17, 32): SQLite foreign keys and cleanup trigger inspection (thread_history_1.sqlite ), unzeroed deleted SQLite freelist measurement (logs_2.sqlite ), unencrypted local microphone retention (dictation-history/ ), and compiled telemetry flags (codex_accepted_line_fingerprints ,disable_analytics ).
  • 100% Read-Only: Opens every SQLite database strictly in read-only mode ({ readOnly: true } /?mode=ro ). Never writes to, modifies, or deletes anything inside~/.codex/ .
  • 100% Offline: Zero network imports, zero HTTP/DNS/WebSocket calls.
  • Zero Credential Access: Never readsauth.json or any token/key files.
  • Zero PII Output: Never prints user prompts, assistant replies, source code, project names, local file paths, or account emails. Serverresponse_id (resp_... ) samples are omitted by default and only included if you explicitly pass--include-ids .

Clone the repository (or download audit_codex.mjs / audit_codex.py directly):

git clone https://github.com/NeHumorist/codex-local-audit.git
cd codex-local-audit

Uses built-in node:zlib (zstdDecompressSync) and node:sqlite (DatabaseSync). No npm install required.

macOS / Linux:

node audit_codex.mjs

Windows (PowerShell):

node .\audit_codex.mjs

Windows tip (no Node 24 installed globally?): Codex Desktop already ships a local Node 24 runtime on Windows. You can invoke it directly without installing anything:

$node24 = Get-ChildItem "$env:LOCALAPPDATA\OpenAI\Codex\runtimes\cua_node\*\bin\node.exe" | Select-Object -First 1 -ExpandProperty FullName
& $node24 .\audit_codex.mjs

Python 3.14+ includes compression.zstd in the standard library. On Python 3.10–3.13, run via uv (or install zstandard / system zstd) to decompress .jsonl.zst session files:

uv run --with zstandard python audit_codex.py

python3 audit_codex.py
Flag Description
--codex-dir <dir> Custom path to .codex directory (default:~/.codex )
--binary <path> Explicitly point to an installed codex /codex.exe binary (auto-detected on Windows, macOS, and Linux when omitted)
--skip-binary Skip inspecting the installed client binary
--json <file> Save an anonymized machine-readable JSON summary
--markdown <file> Save an anonymized shareable Markdown table report
--include-ids (Off by default) Include up to 10 sample serverresponse_id (resp_... ) values for<80% -quota zero-reasoning &516 -cutoff events in--json /--markdown outputs (intended for private DSAR / regulator filings)
node audit_codex.mjs --markdown my_audit_summary.md

node audit_codex.mjs --json my_evidence.json --include-ids
  1. [1] QUOTA COMPLIANCE: Checks whether your 5h ( primary ) and 7d (secondary ) windows were actually exhausted. If most zero-reasoning or516 -cutoff calls occurred whileboth windows were<80% , rate-limit exhaustion is ruled out.
  2. [2] REASONING BREAKDOWN: Compare Zero% ,1stStepZero% (the very first call after a user prompt), andMedR across months and models. Also reports any server-pushedconfiguration_update downgrades (e.g.ultra →xhigh ) andmodel_reroute events.
  3. [3] QUANTIZED 516-TOKEN CLIFF: Look at 515 vs[516] vs517 and harmonics1034 ,1552 ,2070 (518k - 2 ). IfMedEncryptedB clamps around~8,000 B at516 andMedBlocks jumps from1.0 →2.0 immediately at517..700 , truncation is physically occurring at the 516-token block boundary.
  4. [4] REASONING SUMMARY TIMELINE: Shows when turn_context.summary switched fromauto /detailed tonone and whether that flip happened across identical CLI versions.
  5. [5] SQLITE, DICTATION & TELEMETRY HYGIENE: - foreign_keys=0 +broken_projection_trigger=true indicatesthread_realtime_items_projection_cleanup only cleansthread_realtime_items , leavingthread_turns /thread_items without cascading deletes.
  • unzeroed_freelist shows how much oflogs_2.sqlite consists of deleted but unzeroed plaintext SQLite pages.
  • dictation-history/ reports count and age of unencrypted local microphone recordings (without reading transcripts).
  • cf_ray_pops reports only 3-letter Cloudflare airport codes (e.g.PRG ,FRA ,AMS ) for regional jurisdiction verification.
  1. [6] INSTALLED CLIENT BINARY CHECK: Reads the official bundled models.json inside your installedcodex binary (default_reasoning_level ,default_reasoning_summary ,supports_ultra ) and checks whethercodex_accepted_line_fingerprints is compiled in and whether anydisable_analytics flag exists.

Independently reproduced across multiple EU user installations (both macOS and Windows 11 x64, including signed Windows package OpenAI.Codex_26.1111.2228.0_x64__2p2nqsd0c76g0) well within subscription quotas:

  • In an audited Windows dataset (215 session rollouts, 34,523 deduplicated server calls, Jul–Nov 2026 ,plus tier), median usage was34% (5h) and39% (7d), reaching 100% in only0.37% (5h) and0.09% (7d) of calls.
  • 73.4% (2,848 / 3,878 ) of zero-reasoning calls onhigh /ultra occurred whileboth quota windows were<80% .
  • On gpt-6.1-sol::ultra (which officially lists"ultra" insupported_reasoning_levels inside signedcodex.exe ), zero-reasoning on thefirst step after a user prompt jumped from0.0% in Aug–Sep (0 / 238 ) to40.0%–80.0% (47.6% /151 / 317 in October 2026), including 3,000–8,000-token code outputs emitted withreasoning_output_tokens = 0 and0 reasoning blocks.
  • On gpt-6.1-terra::ultra in November 2026 (2,002 calls), zero-reasoning reached24.2% with a median of21 reasoning tokens , alongside 4 server-emittedconfiguration_update downgrades (ultra →xhigh ).

Across 34,523 calls: 514 (16×), 515 (15×), 516 (1,498× — 100× cliff), 517 (2×), 518 (2×), plus exact multi-block harmonics at 1034 (364×), 1552 (98×), and 2070 (41×).

Bucket ( gpt-6.1-sol::ultra ) Calls ( N ) Median Reasoning Blocks Median encrypted_content P90 encrypted_content
rTok == 0 3,018 0.0 0 B 0 B
rTok 501..515 151 1.0 7,948 B 8,688 B
rTok == 516 1,467 ( 1,410 single-block) 1.0 8,036 B 8,504 B
rTok 517..700 653 2.0 (block jump) 10,584 B 11,736 B
rTok == 1034 352 ( 336 two-block) 2.0 15,748 B 16,900 B
rTok == 1552 92 ( 85 three-block) 3.0 23,238 B 25,168 B
rTok == 2070 38 ( 33 four-block) 4.0 32,012 B 42,876 B
  • Bundled models.json inside signedcodex.exe (offset0x120ae528 ) ships"default_reasoning_level": "low" and"default_reasoning_summary": "none" forgpt-6-astra ,gpt-6.1-sol , andgpt-6.1-terra , despite"supports_reasoning_summaries": true .

  • turn_context.summary flipped globally fromdetailed (924 turns) tonone (466 turns) on2026-10-22 across identical CLI builds (0.159.0 and0.162.0-alpha.17.2 ) without a client update.

  • Incomplete SQLite Deletion Trigger (thread_history_1.sqlite): thread_realtime_items_projection_cleanup deletes only fromthread_realtime_items ; all four tables have** 0**FOREIGN KEY ... ON DELETE CASCADE constraints.

  • Unzeroed SQLite Freelist (logs_2.sqlite): Up to91.8% ( 66.9 MB of72.9 MB ) consists of unzeroed deleted freelist pages (noPRAGMA secure_delete = ON /VACUUM ).

  • Unencrypted Microphone Recordings (dictation-history/): Raw audio/webm;codecs=opus voice chunks and JSON transcripts remain unencrypted on disk without automatic TTL purge (observed retained 54+ days).

  • Telemetry Without disable_analytics: POST /backend-api/codex/analytics-events/events (codex_accepted_line_fingerprints compiled intocodex.exe ), OTLP toab.chatgpt.com/otlp/v1/metrics , and localshadow_selection_experiment execute withdisable_analytics absent from the binary.

To maintain strict engineering rigor, this repository explicitly excludes several commonly misinterpreted artifacts observed during community reverse-engineering:

Artifact / Header Why It Is Excluded from Degradation / Security Claims
codex.response.receive_wait_ms Emitted on every handle_output_item_done (reasoning ,message ,function_call ); measures per-item stream channel wait (down to0.0046 ms when buffered),not prompt Time-to-First-Token (TTFT).
x-codex-safety-buffering-faster-model Verified in codex.exe (safety_buffering.rs ) andapp.asar : supplies the model slug for the optional UI button*"Retry with a faster model"* during safety buffering — it doesnot silently auto-swap the model mid-turn.
wham/remote/control Verified in codex.exe (remote_control_cmd.rs ) andapp.asar : standard Remote Control / device-pairing feature gated by MFA and TPM/device-key challenge —not a "backdoor". (Any GDPR concern is strictly limited to whether enrollment occurred without opt-in consent.)
shadow_selection_experiment Verified in ext/skills/src/shadow_selection_experiment/mod.rs : local benchmark comparing 5 lexical/BM25/ngram rankers over installedSKILL.md files — unrelated to model throttling.
Silent gpt-6-astra -> gpt-6-luna reroutes in Codex Audited datasets showed 0`` model_reroute events. Backgroundgpt-6-luna::low spans in logs stem from hardcoded helper models (ephemeralGenerationModel ,ambientSuggestionsModel ) inapp.asar (worker.js ).

This repository provides a neutral, read-only local diagnostic tool and reproducible technical observations for educational, research, and consumer-transparency purposes. Users are solely responsible for verifying results on their own local data.

Licensed under the MIT License.

── more in #ai-tools 4 stories · sorted by recency
── more on @openai 3 stories trending now
sponsored brought to you by zahid.host 4,200+ EU-deployed projects
reading about agents? ship yours in a single git push.

Run your AI side-project on zahid.host

EU-based hosting, git-push deploys, automatic HTTPS, no cold starts. Free tier with a custom domain — perfect for shipping the agent you just read about.

$git push zahid main
→ Live at https://your-agent.zahid.host ✓
Get free account → Pricing
from €0/mo · no card required
LIVE [news/openai-codex-local-l…] indexed:0 read:7min 2026-11-20 · —