Conversation Logger
Overview
Create a timestamped folder for each Codex conversation or work thread, save each user query and assistant response as its own Markdown file, and retrieve prior chat context when needed. The default archive root is ~/workspace/codex-workspace; set CODEX_CHAT_LOG_ROOT to override it.
Logging Workflow
- At the beginning of a conversation or work thread, create or select a thread folder:
- Prefer a concise slug from the user's request, such as
create-conversation-logger-skill.
- Use the helper script to create the folder and write the first user query.
- Keep the returned
thread_dir path in mind for the rest of the conversation.
- For every user query in that same thread, write one Markdown file with role
user.
- Before sending each substantive assistant response, write the response text to one Markdown file with role
assistant.
- If a response is a short progress update, log it only when it contains meaningful state, decisions, or outcomes. Always log final answers.
- Never overwrite an existing log file. The helper script appends a numeric suffix if a timestamp collision occurs.
Helper Script
Use scripts/log_turn.py from this skill directory:
python3 ~/.codex/skills/conversation-logger/scripts/log_turn.py \
--role user \
--title "Create conversation logger skill" \
--slug create-conversation-logger-skill \
--content-file /tmp/current-user-query.md
The script prints JSON containing thread_dir and file_path. Reuse thread_dir for subsequent turns:
python3 ~/.codex/skills/conversation-logger/scripts/log_turn.py \
--thread-dir ~/workspace/codex-workspace/2026-05-10-174500-create-conversation-logger-skill \
--role assistant \
--title "Implementation complete" \
--content-file /tmp/current-assistant-response.md
The script also accepts content on stdin when --content-file is omitted.
Retrieval Workflow
When the user asks to find, reference, continue from, or summarize another chat:
- Use
scripts/find_logs.py recent to inspect recent thread folders if the target thread is unclear.
- Use
scripts/find_logs.py search "<query>" for keyword lookup across all Markdown logs.
- Use
scripts/find_logs.py show "<thread-substring>" to inspect one thread's turn list.
- Use
scripts/find_logs.py context "<thread-substring>" to produce compact Markdown context for Codex to read into the current chat.
- Cite or link the specific Markdown files that informed the answer when useful.
- If logging is active for the current chat, log the user's retrieval request and the assistant response as normal.
Common commands:
python3 ~/.codex/skills/conversation-logger/scripts/find_logs.py recent
python3 ~/.codex/skills/conversation-logger/scripts/find_logs.py search "Vercel deployment"
python3 ~/.codex/skills/conversation-logger/scripts/find_logs.py show "conversation-logger"
python3 ~/.codex/skills/conversation-logger/scripts/find_logs.py context "conversation-logger"
Prefer context when the user wants to continue from a prior chat. Prefer search when they remember only a topic, phrase, or problem.
Naming Rules
- Thread folder format:
YYYY-MM-DD-HHMMSS-slug
- Turn file format:
YYYY-MM-DD-HHMMSS-role-title.md
- Use lowercase slugs with hyphens.
- Keep titles short and descriptive.
- Add YAML frontmatter to every Markdown file with
role, created_at, thread, and title.
Practical Notes
- If the thread was not logged from the first turn, create the folder as soon as this skill is invoked and log the current user request.
- For a shorter explicit trigger, the user may invoke the alias skill with
$chat-log.
- If the user asks for logging to be "always on," explain that Codex skills are triggered by session context rather than a guaranteed global hook, then follow this workflow whenever the skill is active.
- Do not include secrets, credentials, API keys, private tokens, or full sensitive file contents in logs unless the user explicitly asks and it is necessary.
- When summarizing a very long assistant response, prefer logging the exact final answer. For intermediate tool output, log concise summaries unless the user asked to preserve raw output.
- When retrieving prior logs, avoid dumping entire long threads into the response. Summarize what matters, then provide file paths for traceability.
1---2name: conversation-logger3description: Create, maintain, search, and reuse per-conversation Markdown archives for Codex work. Use when the user asks to log, journal, archive, record, mirror, persist, find, search, summarize, reference, continue from, or bring in context from Codex conversation threads; when starting or continuing a Codex workspace conversation log; or when saving user and assistant turns as separate timestamped Markdown files.4---56# Conversation Logger78## Overview910Create a timestamped folder for each Codex conversation or work thread, save each user query and assistant response as its own Markdown file, and retrieve prior chat context when needed. The default archive root is `~/workspace/codex-workspace`; set `CODEX_CHAT_LOG_ROOT` to override it.1112## Logging Workflow13141. At the beginning of a conversation or work thread, create or select a thread folder:15 - Prefer a concise slug from the user's request, such as `create-conversation-logger-skill`.16 - Use the helper script to create the folder and write the first user query.17 - Keep the returned `thread_dir` path in mind for the rest of the conversation.182. For every user query in that same thread, write one Markdown file with role `user`.193. Before sending each substantive assistant response, write the response text to one Markdown file with role `assistant`.204. If a response is a short progress update, log it only when it contains meaningful state, decisions, or outcomes. Always log final answers.215. Never overwrite an existing log file. The helper script appends a numeric suffix if a timestamp collision occurs.2223## Helper Script2425Use `scripts/log_turn.py` from this skill directory:2627```bash28python3 ~/.codex/skills/conversation-logger/scripts/log_turn.py \29 --role user \30 --title "Create conversation logger skill" \31 --slug create-conversation-logger-skill \32 --content-file /tmp/current-user-query.md33```3435The script prints JSON containing `thread_dir` and `file_path`. Reuse `thread_dir` for subsequent turns:3637```bash38python3 ~/.codex/skills/conversation-logger/scripts/log_turn.py \39 --thread-dir ~/workspace/codex-workspace/2026-05-10-174500-create-conversation-logger-skill \40 --role assistant \41 --title "Implementation complete" \42 --content-file /tmp/current-assistant-response.md43```4445The script also accepts content on stdin when `--content-file` is omitted.4647## Retrieval Workflow4849When the user asks to find, reference, continue from, or summarize another chat:50511. Use `scripts/find_logs.py recent` to inspect recent thread folders if the target thread is unclear.522. Use `scripts/find_logs.py search "<query>"` for keyword lookup across all Markdown logs.533. Use `scripts/find_logs.py show "<thread-substring>"` to inspect one thread's turn list.544. Use `scripts/find_logs.py context "<thread-substring>"` to produce compact Markdown context for Codex to read into the current chat.555. Cite or link the specific Markdown files that informed the answer when useful.566. If logging is active for the current chat, log the user's retrieval request and the assistant response as normal.5758Common commands:5960```bash61python3 ~/.codex/skills/conversation-logger/scripts/find_logs.py recent62python3 ~/.codex/skills/conversation-logger/scripts/find_logs.py search "Vercel deployment"63python3 ~/.codex/skills/conversation-logger/scripts/find_logs.py show "conversation-logger"64python3 ~/.codex/skills/conversation-logger/scripts/find_logs.py context "conversation-logger"65```6667Prefer `context` when the user wants to continue from a prior chat. Prefer `search` when they remember only a topic, phrase, or problem.6869## Naming Rules7071- Thread folder format: `YYYY-MM-DD-HHMMSS-slug`72- Turn file format: `YYYY-MM-DD-HHMMSS-role-title.md`73- Use lowercase slugs with hyphens.74- Keep titles short and descriptive.75- Add YAML frontmatter to every Markdown file with `role`, `created_at`, `thread`, and `title`.7677## Practical Notes7879- If the thread was not logged from the first turn, create the folder as soon as this skill is invoked and log the current user request.80- For a shorter explicit trigger, the user may invoke the alias skill with `$chat-log`.81- If the user asks for logging to be "always on," explain that Codex skills are triggered by session context rather than a guaranteed global hook, then follow this workflow whenever the skill is active.82- Do not include secrets, credentials, API keys, private tokens, or full sensitive file contents in logs unless the user explicitly asks and it is necessary.83- When summarizing a very long assistant response, prefer logging the exact final answer. For intermediate tool output, log concise summaries unless the user asked to preserve raw output.84- When retrieving prior logs, avoid dumping entire long threads into the response. Summarize what matters, then provide file paths for traceability.