Log Current Conversation
node "${CLAUDE_SKILL_DIR}/scripts/activate-persistent-log.mjs" "${CLAUDE_SESSION_ID}"
Create and maintain a Markdown conversation log for the current thread only.
Goal
Keep a project-local Markdown file up to date for this conversation. Each completed logged turn should append:
- the timestamp for the user message
- the user's prompt text
- a one-sentence summary of the assistant reply
Scope
- This skill only tracks the current conversation.
- Start a new Markdown file for each new conversation that explicitly enables this skill.
- Do not backfill older threads unless the user explicitly asks.
- Do not log hidden system prompts, developer prompts, tool schemas, or chain-of-thought.
Runtime Model
This skill is designed to use a Stop hook plus local scripts.
- On invocation, the setup script activates logging for the current session and tries to install a project-local persistent
Stop hook in .claude/settings.local.json. - The hook runs at assistant stop points after the skill has been invoked.
- The script reads the current session transcript to recover the latest user message.
- The script stores per-session state in a hidden project-local sidecar directory so it can avoid duplicate appends.
- The visible user-facing artifact remains a single Markdown log file in the project root.
Compatibility
- Preferred mode: install a persistent project-local
Stop hook in .claude/settings.local.json. - Fallback mode: if the runtime does not support project-local hook persistence, keep session-local logging enabled and continue using explicit in-conversation fallback behavior when needed.
File Rules
- Use the current project directory as the log location unless the user explicitly overrides it.
- Create a new file named
YYYY-MM-DD-HHMMSS-conversation.md. - Prefer the local system timezone when formatting timestamps.
- Remember the absolute path to the log file for the rest of the current conversation.
- Store hook bookkeeping in
.claude/log-current-conversation/ inside the project. - Try to install the persistent project-local hook in
.claude/settings.local.json so logging survives runtime reloads for this project.
Logged Format
The script should write this header exactly once:
# Conversation Log
- Session started: YYYY-MM-DD HH:MM:SS
- Project: /absolute/path/to/project
Each appended entry should use this format:
## YYYY-MM-DD HH:MM:SS
**User Prompt**
<verbatim user prompt>
**Assistant Reply Summary**
<one-sentence summary>
Writing Rules
- Keep the user prompt verbatim when practical.
- If the user message contains non-text attachments, mention them briefly in the prompt block only if needed for context.
- The summary must stay to one sentence, plain and factual.
- Summarize the reply that the user actually receives, not the hidden tool work.
- If the assistant sends multiple paragraphs, still reduce the reply to one sentence.
- Append only once per completed logged turn.
Recovery Rules
- If the log file is missing but its intended path is known, recreate it at the same path and continue.
- If the conversation resumes after compaction, continue appending to the same file if the path is still known.
- If the path is no longer recoverable, create a new timestamped file in the current project directory and continue.
Stop Conditions
- Stop appending when the user asks to stop logging.
- Stop if the user switches to a different logging format and explicitly replaces this workflow.
- If hook execution is unavailable in the current runtime, fall back to explicit in-conversation file appends.