Skip to content

Ar9av/obsidian-wiki / skills/codex-history-ingest

codex-history-ingest

Verified

Ingest Codex CLI conversation/session history into Obsidian as distilled knowledge. Use for importing or mining ~/.codex sessions, rollout files, indexes, or transcript logs; use wiki-agent for targeted topic-only recall.

FileKindSize
SKILL.mdskill md9.2 KB
references/codex-data-format.mdmarkdown2.4 KB

references/codex-data-format.md

View on GitHub
# 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.
reverse-engineer-anythingmorluto/reaReverse engineer native, managed, Electron/JavaScript, packaged, firmware, and browser targets with REA, and build agent environments (AgentEnv bundles) of web applications from a live instance or a capture, and of Linux desktop apps with a task from a request. Use shipped-artifact or requested runtime evidence to explain features, compare versions, decompile code, or guide a reconstruction. Skip REA for ordinary source-repository architecture analysis.Stars: 471kUpdated Claude CodeCodexVerifiedInstall
diagnosing-superpowersobra/superpowersUse when a superpowers session went wrong and your human partner wants to know why — repeated work, ignored plans, stumbles, poor results, a skill that didn't fire, "it took too long", "why is it so expensive", "what is it doing" — or wants to build a bug report for the superpowers maintainers, for the current session or a past one identified by id or path, on any harness.Stars: 322kUpdated Claude CodeCodexVerifiedInstall
dispatching-parallel-agentsobra/superpowersUse when facing 2+ independent tasks that can be worked on without shared state or sequential dependenciesStars: 322kUpdated Claude CodeCodexVerifiedInstall
executing-plansobra/superpowersUse when executing an implementation plan in the current session as the implementer yourself — your human partner chose inline execution, or no subagent tool is availableStars: 322kUpdated Claude CodeCodexVerifiedInstall