Extract the user-side prompt history from noisy Codex session JSONL files.
session-logger packages a Codex skill and a small Python extractor that turn a raw session archive into something you can actually reuse:
- a clean Markdown prompt log
- a machine-readable JSONL export
- separate summaries for oversized prompts
It is useful when you want to reconstruct intent from a long agent session without digging through tool calls, wrappers, or assistant chatter.
Most agent session archives are technically complete but practically unusable. The user intent is buried under:
- tool call noise
- AGENTS injections and environment wrappers
- heartbeat and subagent markers
- base64 image payloads
- long prompts that are too big to skim quickly
This repo keeps the useful layer: what the user actually asked for, in order.
prompt-log.md: a chronological Markdown log of user promptsprompt-log.jsonl: structured prompt records for scripts or follow-up analysislong-prompts/: one summary file per oversized prompt
Each prompt record includes:
- timestamp
- original JSONL line number
- word count
- attached image count
- detected file mentions
python3 scripts/extract_user_prompt_log.py \
demo/demo-session.jsonl \
--out-dir ./tmp/session-archive \
--long-threshold 60 \
--jsonThen inspect:
tmp/session-archive/prompt-log.mdtmp/session-archive/prompt-log.jsonltmp/session-archive/long-prompts/
The bundled example output under examples/session-archive/ was generated with
the same --long-threshold 60 setting.
- Copy this folder into your Codex skills directory as
session-logger. - Reload your Codex client if needed.
- Use
session-loggerwhen you need a reusable prompt archive from a raw session file.
Example:
Use session-logger on this Codex automation run and produce a compact prompt archive.
SKILL.md: installable skill instructionsagents/openai.yaml: portable UI metadatascripts/extract_user_prompt_log.py: extractordemo/demo-session.jsonl: synthetic sample session inputexamples/session-archive/: generated sample output from the demo inputassets/preview.png: truthful visual of the workflow and output shape
The bundled demo uses synthetic prompts only. No real user sessions, browser state, personal notes, or private thread data are included.
- no tokens, cookies, or credentials
- no raw personal session exports
- no browser profiles or synced notes
- no private local machine paths in the bundled demo artifacts
The tool is intentionally conservative about what it copies forward from a session file.
Apache-2.0
