{"slug": "openai-codex-local-log-audit-516-token-cliff-and-zero-reasoning-drops", "title": "OpenAI Codex local log audit: 516-token cliff and zero-reasoning drops", "summary": "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.", "body_md": "**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.**\n\nBoth 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:\n\n1. **Quota Compliance:** Actual 5-hour (`primary` ) and 7-day (`secondary` ) subscription usage vs. reasoning anomalies;\n2. **Zero-Reasoning Suppression:** Frequency of`reasoning_output_tokens = 0` (with`0` reasoning blocks and`0` encrypted bytes) on flagship`high` /`ultra` requests — including the very first model call immediately after a user prompt;\n3. **Quantized `516`-Token Cliff (` 518k - 2` Harmonics):** Exact discontinuity check around`514..518` and multi-block harmonics (`1034` ,`1552` ,`2070` ), cryptographically cross-checked against`encrypted_content` ciphertext byte lengths;\n4. **Silent Default & Summary Flips:** Exact version/date timeline of`turn_context.summary` (`detailed` →`none` ), server-pushed`configuration_update` effort downgrades, and bundled`models.json` defaults inside your installed`codex` binary;\n5. **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` ).\n\n- **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/` .\n- **100% Offline:** Zero network imports, zero HTTP/DNS/WebSocket calls.\n- **Zero Credential Access:** Never reads`auth.json` or any token/key files.\n- **Zero PII Output:** Never prints user prompts, assistant replies, source code, project names, local file paths, or account emails. Server`response_id` (`resp_...` ) samples are omitted by default and only included if you explicitly pass`--include-ids` .\n\nClone the repository (or download `audit_codex.mjs` / `audit_codex.py` directly):\n\n```\ngit clone https://github.com/NeHumorist/codex-local-audit.git\ncd codex-local-audit\n```\n\nUses built-in `node:zlib` (`zstdDecompressSync`) and `node:sqlite` (`DatabaseSync`). No `npm install` required.\n\n**macOS / Linux:**\n\n```\nnode audit_codex.mjs\n```\n\n**Windows (PowerShell):**\n\n```\nnode .\\audit_codex.mjs\n```\n\n**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:\n\n``` php\n$node24 = Get-ChildItem \"$env:LOCALAPPDATA\\OpenAI\\Codex\\runtimes\\cua_node\\*\\bin\\node.exe\" | Select-Object -First 1 -ExpandProperty FullName\n& $node24 .\\audit_codex.mjs\n```\n\nPython 3.14+ includes `compression.zstd` in the standard library. On Python 3.10–3.13, run via [`uv`](https://docs.astral.sh/uv/) (or install `zstandard` / system `zstd`) to decompress `.jsonl.zst` session files:\n\n```\n# Recommended on Python 3.10–3.13 (auto-provides zstandard in an isolated ephemeral env)\nuv run --with zstandard python audit_codex.py\n\n# Or with Python 3.14+ / if zstandard or the `zstd` CLI is already installed\npython3 audit_codex.py\n```\n\n| Flag | Description | \n|---|---|\n| `--codex-dir <dir>` | Custom path to `.codex` directory (default:`~/.codex` ) | \n| `--binary <path>` | Explicitly point to an installed `codex` /`codex.exe` binary (auto-detected on Windows, macOS, and Linux when omitted) | \n| `--skip-binary` | Skip inspecting the installed client binary | \n| `--json <file>` | Save an anonymized machine-readable JSON summary | \n| `--markdown <file>` | Save an anonymized shareable Markdown table report | \n| `--include-ids` | *(Off by default)* Include up to 10 sample server`response_id` (`resp_...` ) values for`<80%` -quota zero-reasoning &`516` -cutoff events in`--json` /`--markdown` outputs (intended for private DSAR / regulator filings) | \n\n```\n# Export a clean anonymized Markdown table to share or compare across platforms\nnode audit_codex.mjs --markdown my_audit_summary.md\n\n# Export full anonymized JSON + sample server resp_... IDs for a private GDPR/consumer filing\nnode audit_codex.mjs --json my_evidence.json --include-ids\n```\n\n1. **`[1] QUOTA COMPLIANCE`:** Checks whether your 5h (` primary` ) and 7d (`secondary` ) windows were actually exhausted. If most zero-reasoning or`516` -cutoff calls occurred while**both** windows were`<80%` , rate-limit exhaustion is ruled out.\n2. **`[2] REASONING BREAKDOWN`:** Compare` Zero%` ,`1stStepZero%` (the very first call after a user prompt), and`MedR` across months and models. Also reports any server-pushed`configuration_update` downgrades (e.g.`ultra` →`xhigh` ) and`model_reroute` events.\n3. **`[3] QUANTIZED 516-TOKEN CLIFF`:** Look at` 515` vs`[516]` vs`517` and harmonics`1034` ,`1552` ,`2070` (`518k - 2` ). If`MedEncryptedB` clamps around`~8,000 B` at`516` and`MedBlocks` jumps from`1.0` →`2.0` immediately at`517..700` , truncation is physically occurring at the 516-token block boundary.\n4. **`[4] REASONING SUMMARY TIMELINE`:** Shows when` turn_context.summary` switched from`auto` /`detailed` to`none` and whether that flip happened across identical CLI versions.\n5. **`[5] SQLITE, DICTATION & TELEMETRY HYGIENE`:**  - `foreign_keys=0` +`broken_projection_trigger=true` indicates`thread_realtime_items_projection_cleanup` only cleans`thread_realtime_items` , leaving`thread_turns` /`thread_items` without cascading deletes.\n  - `unzeroed_freelist` shows how much of`logs_2.sqlite` consists of deleted but unzeroed plaintext SQLite pages.\n  - `dictation-history/` reports count and age of unencrypted local microphone recordings (without reading transcripts).\n  - `cf_ray_pops` reports only 3-letter Cloudflare airport codes (e.g.`PRG` ,`FRA` ,`AMS` ) for regional jurisdiction verification.\n6. **`[6] INSTALLED CLIENT BINARY CHECK`:** Reads the official bundled` models.json` inside your installed`codex` binary (`default_reasoning_level` ,`default_reasoning_summary` ,`supports_ultra` ) and checks whether`codex_accepted_line_fingerprints` is compiled in and whether any`disable_analytics` flag exists.\n\nIndependently 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:\n\n- In an audited Windows dataset (**215 session rollouts, `34,523` deduplicated server calls, Jul–Nov 2026** ,`plus` tier), median usage was**34%** (5h) and**39%** (7d), reaching 100% in only`0.37%` (5h) and`0.09%` (7d) of calls.\n- **73.4%** (`2,848 / 3,878` ) of zero-reasoning calls on`high` /`ultra` occurred while**both** quota windows were`<80%` .\n- On `gpt-6.1-sol::ultra` (which officially lists`\"ultra\"` in`supported_reasoning_levels` inside signed`codex.exe` ), zero-reasoning on the**first step after a user prompt** jumped from**0.0%** in Aug–Sep (`0 / 238` ) to**40.0%–80.0%** (`47.6%` /`151 / 317` in October 2026), including 3,000–8,000-token code outputs emitted with`reasoning_output_tokens = 0` and`0` reasoning blocks.\n- On `gpt-6.1-terra::ultra` in November 2026 (`2,002` calls), zero-reasoning reached**24.2%** with a median of**21 reasoning tokens** , alongside 4 server-emitted`configuration_update` downgrades (`ultra` →`xhigh` ).\n\nAcross `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×`).\n\n| Bucket ( `gpt-6.1-sol::ultra` ) | Calls ( `N` ) | Median Reasoning Blocks | Median `encrypted_content` | P90 `encrypted_content` | \n|---|---|---|---|---|\n| `rTok == 0` | 3,018 | 0.0 | 0 B | 0 B | \n| `rTok 501..515` | 151 | 1.0 | 7,948 B | 8,688 B | \n| **`rTok == 516`** | **1,467** (` 1,410` single-block) | **1.0** | **8,036 B** | **8,504 B** | \n| `rTok 517..700` | 653 | **2.0** (block jump) | 10,584 B | 11,736 B | \n| **`rTok == 1034`** | **352** (` 336` two-block) | **2.0** | **15,748 B** | **16,900 B** | \n| **`rTok == 1552`** | **92** (` 85` three-block) | **3.0** | **23,238 B** | **25,168 B** | \n| **`rTok == 2070`** | **38** (` 33` four-block) | **4.0** | **32,012 B** | **42,876 B** | \n\n- Bundled `models.json` inside signed`codex.exe` (offset`0x120ae528` ) ships`\"default_reasoning_level\": \"low\"` and`\"default_reasoning_summary\": \"none\"` for`gpt-6-astra` ,`gpt-6.1-sol` , and`gpt-6.1-terra` , despite`\"supports_reasoning_summaries\": true` .\n- `turn_context.summary` flipped globally from`detailed` (`924` turns) to`none` (`466` turns) on**2026-10-22** across identical CLI builds (`0.159.0` and`0.162.0-alpha.17.2` ) without a client update.\n\n- **Incomplete SQLite Deletion Trigger (`thread_history_1.sqlite`):**` thread_realtime_items_projection_cleanup` deletes only from`thread_realtime_items` ; all four tables have** 0**`FOREIGN KEY ... ON DELETE CASCADE` constraints.\n- **Unzeroed SQLite Freelist (`logs_2.sqlite`):** Up to**91.8%** (` 66.9 MB` of`72.9 MB` ) consists of unzeroed deleted freelist pages (no`PRAGMA secure_delete = ON` /`VACUUM` ).\n- **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).\n- **Telemetry Without `disable_analytics`:**` POST /backend-api/codex/analytics-events/events` (`codex_accepted_line_fingerprints` compiled into`codex.exe` ), OTLP to`ab.chatgpt.com/otlp/v1/metrics` , and local`shadow_selection_experiment` execute with`disable_analytics` absent from the binary.\n\nTo maintain strict engineering rigor, this repository **explicitly excludes** several commonly misinterpreted artifacts observed during community reverse-engineering:\n\n| Artifact / Header | Why It Is Excluded from Degradation / Security Claims | \n|---|---|\n| `codex.response.receive_wait_ms` | Emitted on every `handle_output_item_done` (`reasoning` ,`message` ,`function_call` ); measures per-item stream channel wait (down to`0.0046 ms` when buffered),**not** prompt Time-to-First-Token (TTFT). | \n| `x-codex-safety-buffering-faster-model` | Verified in `codex.exe` (`safety_buffering.rs` ) and`app.asar` : supplies the model slug for the optional UI button*\"Retry with a faster model\"* during safety buffering — it does**not** silently auto-swap the model mid-turn. | \n| `wham/remote/control` | Verified in `codex.exe` (`remote_control_cmd.rs` ) and`app.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.) | \n| `shadow_selection_experiment` | Verified in `ext/skills/src/shadow_selection_experiment/mod.rs` : local benchmark comparing 5 lexical/BM25/ngram rankers over installed`SKILL.md` files — unrelated to model throttling. | \n| Silent `gpt-6-astra -> gpt-6-luna` reroutes in Codex | Audited datasets showed `0`` model_reroute` events. Background`gpt-6-luna::low` spans in logs stem from hardcoded helper models (`ephemeralGenerationModel` ,`ambientSuggestionsModel` ) in`app.asar` (`worker.js` ). | \n\nThis 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.\n\nLicensed under the [MIT License](https://github.com/NeHumorist/codex-local-audit/blob/master/LICENSE).", "url": "https://wpnews.pro/news/openai-codex-local-log-audit-516-token-cliff-and-zero-reasoning-drops", "canonical_source": "https://github.com/NeHumorist/codex-local-audit", "published_at": "2026-11-20 16:00:05+00:00", "updated_at": "2026-11-20 16:18:31.587540+00:00", "lang": "en", "topics": ["ai-tools", "ai-agents", "developer-tools", "ai-safety"], "entities": ["OpenAI", "Codex", "codex-local-audit", "NeHumorist", "Node.js", "Python"], "also_reported_by": [], "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.", "recommendation": null, "alternates": {"html": "https://wpnews.pro/news/openai-codex-local-log-audit-516-token-cliff-and-zero-reasoning-drops", "markdown": "https://wpnews.pro/news/openai-codex-local-log-audit-516-token-cliff-and-zero-reasoning-drops.md", "text": "https://wpnews.pro/news/openai-codex-local-log-audit-516-token-cliff-and-zero-reasoning-drops.txt", "jsonld": "https://wpnews.pro/news/openai-codex-local-log-audit-516-token-cliff-and-zero-reasoning-drops.jsonld"}}