Agent skill
codex-session-history
Search Codex local session history stored in SQLite and session_index.jsonl. Use this skill when the user wants to list, search, filter, or inspect locally saved Codex sessions by session id, provider, time range, preview text, thread name, or archived status.
Install this agent skill to your Project
npx add-skill https://github.com/acking-you/myclaude-skills/tree/main/skills/codex-session-history
SKILL.md
Codex Session History
Use the bundled CLI to inspect local Codex session history. The script reads:
state_*.sqlitefor persisted thread metadatasession_index.jsonlfor the latest user-facing thread names
The script auto-discovers the newest state database under CODEX_SQLITE_HOME, the configured sqlite_home, or ~/.codex.
Primary Command
Run:
python3 scripts/codex_session_history.py --limit 30
The default cards view shows:
- full
session_id - provider and source
- created and updated timestamps
- thread name, title, and preview
- cwd
- a ready-to-run
codex resume <session_id>command
Common Queries
Search by preview, title, id, provider, cwd, or thread name:
python3 scripts/codex_session_history.py --query "resume provider"
Show the newest sessions in a compact table:
python3 scripts/codex_session_history.py --view table --limit 50
Filter by provider:
python3 scripts/codex_session_history.py --provider openai --provider staticflow
Filter by time:
python3 scripts/codex_session_history.py --since 7d
python3 scripts/codex_session_history.py --sort-by created --since 2026-03-01 --until 2026-03-10
Include archived-only sessions:
python3 scripts/codex_session_history.py --archived only
Emit JSON for piping or ad hoc analysis:
python3 scripts/codex_session_history.py --view json --limit 200
Time Filters
--since and --until accept:
- ISO timestamps like
2026-03-23T15:30:00 - dates like
2026-03-23 - epoch seconds
- relative values like
30m,12h,7d,2w today,yesterday,now
Notes
previewis the stored first user message, not a generated conversation summary.thread_namecomes fromsession_index.jsonland may be missing.- If the user wants to continue a session after locating it, run
codex resume <session_id>. - If auto-discovery fails, pass
--db /path/to/state_5.sqliteor--codex-home /path/to/.codex.
Recommended Agent Skills
Expand your agent's capabilities with these related and highly-rated skills.
github-wrapped
Generate a verifiable GitHub Wrapped year-in-review as a single-file HTML (raw gh API JSON saved, Python-built dataset embedded), with a Bilibili-style narrative, smooth transitions, and mobile-friendly paged mode. Requires gh CLI to be authenticated.
tech-impl-doc
Write precise technical implementation docs (developer or user) with clear structure, accurate flows, render-safe Mermaid diagrams, and audience-appropriate detail; avoid boilerplate; include a meaningful Code Index for developer docs.
gemini-image
Generate images using AI when user wants to create pictures, draw, paint, or generate artwork. Supports text-to-image and image-to-image generation.
excalidraw
Generate hand-drawn style diagrams (architecture, flowcharts, system design) as .excalidraw.json files. Use when user wants diagrams, mentions Excalidraw, or needs Mermaid-to-visual conversion.
research
Structured web research with multi-source validation. Output reports with complete citation links. Focus on key results, verify information quality.
gen-commit-msg
Generate concise commit messages based on conversation context and minimal git inspection.
Didn't find tool you were looking for?