codex-direct-read-plan

codex-direct-read-plan is an agent for coding agents from gaelic-ghost/SwiftASB. It costs 0 tokens per session (968 once invoked), scanned A, original, Apache-2.0.

A read-only experimental plan for inspecting local Codex session storage through SQLite metadata and session files. JSONL is a line-by-line JSON file format.

In plain words
What is it for?
Use it when designing or validating AgentSB's SwiftASB thread-inventory path, including when to read metadata and when to load detailed session records.
Why use it?
It can support faster thread inventory while treating the local storage layout as temporary and version-dependent.

Agent

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add agents/gaelic-ghost/swiftasb/codex-direct-read-plan
Clone the repo
git clone --depth 1 https://github.com/gaelic-ghost/SwiftASB

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for codex-direct-read-plan

README.md
[![agentmods](https://agentmods.dev/badge/agents/gaelic-ghost/swiftasb/codex-direct-read-plan.svg)](https://agentmods.dev/agents/gaelic-ghost/swiftasb/codex-direct-read-plan)
Your own site
<a href="https://agentmods.dev/agents/gaelic-ghost/swiftasb/codex-direct-read-plan"><img src="https://agentmods.dev/badge/agents/gaelic-ghost/swiftasb/codex-direct-read-plan.svg" alt="Measured on agentmods" height="20"></a>
Per session 0 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 968 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00000 $0.00968
Opus 5 $0.00000 $0.00484
Sonnet 5 $0.00000 $0.00194
Haiku 4.5 $0.00000 $0.00097

Measured 3d ago against content hash 810a04de58fb, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

codex-direct-read-plan scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 3d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

docs/agents/codex-direct-read-plan.md · 114 lines

How it starts

The opening of the file, as written. The whole thing — 114 lines — stays where its author put it; the contents beside it link to each section on GitHub.

AgentSB Direct Read Prototype Plan

AgentSB may use direct local Codex reads as an experimental maintainer lane for faster reports and for prototyping the future SwiftASB direct-thread-storage feature. This lane is private, read-only by default, and version-gated. The destination feature is tracked in ../maintainers/codex-direct-thread-storage-plan.md.

Goal

Use local Codex storage to help design and validate a faster SwiftASB thread inventory path without clogging the CLI/app-server JSONL pipe. The first AgentSB target is thread inventory: read SQLite metadata first, then lazily read referenced JSONL only when deeper turn evidence is needed.

Supported Storage Contract

The first experimental contract targets the local Codex storage shape observed on 2026-06-04:

  • ~/.codex/state_5.sqlite
  • table: threads
  • rollout JSONL paths under ~/.codex/sessions/ and ~/.codex/archived_sessions/
  • active and archived JSONL using the same broad envelope families: session_meta, turn_context, event_msg, and response_item

AgentSB must treat this as a prototype compatibility window, not a forever-stable schema. If the table, required columns, or path conventions drift, AgentSB should report the mismatch and stop before reading deeper content.

Direct Read Principles

  • Open SQLite databases read-only.
  • Never mutate Codex state, archive flags, JSONL files, logs, goals, or app support files.
  • Prefer metadata summaries over prompt/tool-content ingestion.
  • Redact private text by default, including titles, first user messages, and previews.
  • Require an explicit flag before including private title, prompt, or preview text.
  • Read JSONL lazily and only for selected rows.
  • Keep direct-read outputs labeled as private local Codex storage observations.
  • Keep app-server surfaces authoritative for product behavior, archive actions, live state, and compatibility claims while SwiftASB's direct-read design is still experimental.

Read the full file on GitHub · 114 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 3d ago First seen · 114 lines · 0 tokens per session scan A 810a04de58fb

Subscribe to this mod's changes

codex-direct-read-plan is an agent published in the GitHub repository gaelic-ghost/SwiftASB (4 stars, last pushed 1mo ago), licensed Apache-2.0. It costs nothing until one of its globs matches a file; then it loads 968 tokens. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.