
Codex History Ingest
Ingest local Codex CLI session rollouts and indexes into structured notes or pipelines for search and retrospectives.
Overview
Codex History Ingest is an agent skill most often used in Build (also Operate) that documents Codex local history formats for ingesting rollout JSONL and session indexes.
Install
npx skills add https://github.com/ar9av/obsidian-wiki --skill codex-history-ingestWhat is this skill?
- Maps ~/.codex root: sessions, archived_sessions, session_index.jsonl, history.jsonl, config.toml
- Parses rollout JSONL envelopes: session_meta, turn_context, event_msg, response_item
- Uses session_index.jsonl as inventory backbone for append/full sync modes
- Documents event_msg and response_item payload subtypes for tool and token accounting
- Pairs with Obsidian wiki workflows for durable agent transcript archives
- Documents 4 primary rollout JSONL envelope types: session_meta, turn_context, event_msg, response_item
Adoption & trust: 1.6k installs on skills.sh; 1.8k GitHub stars; 3/3 security scanners passed (skills.sh audits).
What problem does it solve?
You have weeks of Codex sessions on disk but no clear map of which files to read or how event types fit together for a wiki or ETL job.
Who is it for?
Indie devs archiving Codex threads into Obsidian or custom dashboards with append or full sync.
Skip if: Cloud-only Codex users with no local ~/.codex history or teams that only need live chat without historical rollouts.
When should I use this skill?
Building or maintaining importers for Codex local history, rollout JSONL, or session_index-driven sync into a wiki.
What do I get? / Deliverables
You can implement an ingest pipeline that walks session_index.jsonl, parses rollout envelopes, and lands structured notes or tables for later search.
- Ingest field map for Codex on-disk layout
- Event-type parsing checklist
- Delta sync strategy using session_index.jsonl
Recommended Skills
Journey fit
Spans multiple journey phases - primary shelf plus alternate fits below.
Primary shelf is agent-tooling because the skill documents ~/.codex layout and JSONL formats you wire into builders' knowledge bases. History ingest is infrastructure around Codex sessions—not app frontend—so it belongs with other agent workflow tooling during build and operate.
Where it fits
Scaffold a script that watches session_index.jsonl and imports new rollout files into vault folders.
Replay token_count and exec_command_end events to see why a production fix thread spiked cost.
Turn recurring agent debugging patterns from archived rollouts into internal playbooks.
How it compares
Local Codex filesystem reference for ingest—not a hosted logging SaaS or generic git commit exporter.
Common Questions / FAQ
Who is codex-history-ingest for?
Solo builders automating knowledge capture from Codex CLI local sessions, especially alongside Obsidian or personal wikis.
When should I use codex-history-ingest?
In Build when writing an importer for agent-tooling, and in Operate when refreshing archives or auditing past tool runs from rollout logs.
Is codex-history-ingest safe to install?
Sessions may contain secrets or cwd paths—review the Security Audits panel on this page and scope filesystem access to your own machine.
SKILL.md
READMESKILL.md - Codex History Ingest
# Codex Data Format — Detailed Reference This reference describes practical, observed structures for Codex local history ingestion. ## Root Layout `~/.codex/` usually contains: - `sessions/YYYY/MM/DD/rollout-*.jsonl` — primary structured session logs - `archived_sessions/` — archived rollouts - `session_index.jsonl` — session id/name/update index - `history.jsonl` — transcript history (depends on config) - `config.toml` — history persistence controls ## Session Index `~/.codex/session_index.jsonl` entries are one JSON object per line, commonly: ```json {"id":"<thread-id>","thread_name":"<title>","updated_at":"<timestamp>"} ``` Use this as the inventory backbone for append/full mode deltas. ## Rollout JSONL `rollout-*.jsonl` files are event streams with envelope fields: ```json { "timestamp": "2026-04-12T09:40:02.337Z", "type": "session_meta|turn_context|event_msg|response_item", "payload": { "...": "..." } } ``` Common `type` values: - `session_meta` — run metadata (id, cwd, model/provider, etc.) - `turn_context` — turn-scoped context envelope - `event_msg` — runtime events (task lifecycle, token/accounting, tool-call markers) - `response_item` — model response items (messages, tool calls, reasoning blocks) ### Typical payload subtypes Observed examples include: - `event_msg.payload.type`: `task_started`, `user_message`, `agent_message`, `mcp_tool_call_end`, `exec_command_end`, `token_count` - `response_item.payload.type`: `message`, `function_call`, `function_call_output`, `reasoning` ## Extraction Strategy ### Keep - User intent from user-message records - Assistant conclusions/decisions from assistant message records - High-signal tool outputs that encode reusable knowledge ### Skip - Pure telemetry (`token_count`, low-level plumbing events) - Internal reasoning traces unless user explicitly asks to retain them - Verbose execution dumps with no durable insight ## Privacy Notes Rollouts can contain sensitive data: - Injected instruction layers - Tool inputs/outputs - Potential secrets in command output Always redact secrets and summarize instead of copying raw transcript content. ## Config Interaction `~/.codex/config.toml` keys that affect ingestion completeness: - `history.persistence = "save-all" | "none"` - `history.max_bytes = <int>` (truncation/compaction cap) `codex exec --ephemeral` runs may not persist rollout files. --- name: codex-history-ingest description: > Ingest Codex CLI conversation history into the Obsidian wiki. Use this skill when the user wants to mine their past Codex sessions for knowledge, import their ~/.codex folder, extract insights from previous coding sessions, or says things like "process my Codex history", "add my Codex conversations to the wiki", or "what have I discussed in Codex before". Also triggers when the user mentions .codex sessions, rollout files, session_index.jsonl, or Codex transcript logs. --- # Codex History Ingest — Conversation Mining You are extracting knowledge from the user's past Codex sessions and distilling it into the Obsidian wiki. Session logs are rich but noisy: focus on durable knowledge, not operational telemetry. This skill can be invoked directly or via the `wiki-history-ingest` router (`/wiki-history-ingest codex`). ## Before You Start 1. **Resolve config** — follow the Config Resolution Protocol in `llm-wiki/SKILL.md` (walk up CWD for `.env` → `~/.obsidian-wiki/config` → prompt setup). This gives `OBSIDIAN_VAULT_PATH` and `CODEX_HISTORY_PATH` (defaults to `~/.codex`) 2. Read `.manifest.json` at the vault root to check what has already been ingested 3. Read `index.md` at the vault root to understand what the wiki already contains ## Ingest Modes ### Append Mode (default) Check `.manifest.json` for each source file. Only process: - Files not in the manifest (new session rollouts, new index files) - Files whose modification time is newer than `ingested_at` in the manifest Use this mode for regular syncs. #