Skip to main content

archive-logs

Archive Claude Code conversation logs into the current project as JSONL and readable Markdown

Jump to install

Source facts

Repository
AMindToThink/claude-code-settings
Last source activity
February 25, 2026 at 15:16
Detected SKILL.md language
English
Stars
4
Forks
0

Install options

The review-first prompt is selected by default. You can switch to a direct command or download a local copy.

Review the source files

Read SKILL.md and any companion files shown by SkillsMP before deciding whether to install.

Showing SKILL.md

SKILL.md
Source instructions · Read-only preview
name
archive-logs
description
Archive Claude Code conversation logs into the current project as JSONL and readable Markdown
disable-model-invocation
true
Archive the Claude Code conversation logs from this project into the project itself, for auditability and transparency. ## Workflow 1. **Find logs**: Look in `~/.claude/projects/<encoded-path>/` where the encoded path replaces `/` with `-` in the current working directory path. List `*.jsonl` files (top-level only, not subdirectories). 2. **Identify sessions**: For each JSONL, extract the first user message to understand the session topic. Skip files with 0 user messages. Assign descriptive numbered names (e.g. `01_initial_setup.jsonl`, `02_feature_work.jsonl`). 3. **Check for duplicates**: If `logs/conversation/` already exists, compare against existing files to avoid re-archiving. 4. **Copy JSONL files** into `logs/conversation/` in the project. 5. **Create a converter script** at `scripts/jsonl_to_markdown.py` that converts JSONL to readable Markdown. The JSONL format: - Each line is a JSON object with a `type` field - Types `user` and `assistant` contain `message.content` (string or array of content blocks) - Content block types: `text` (render), `tool_use` (show tool name + concise input), `tool_result` (abbreviate), `thinking` (omit) - Filter out `<system-reminder>` tags from user messages - Skip tool_result-only user messages 6. **Run the converter** to generate `.md` files alongside the `.jsonl` files. 7. **Scan for secrets**: Install `detect-secrets` (`uv add --dev detect-secrets` or ensure it's available), then run `detect-secrets scan logs/conversation/` on all archived files (both `.jsonl` and `.md`). If any secrets are detected: - Print a clear warning listing each file and the line number(s) flagged. - Do NOT commit the files. Instead, ask the user how to proceed (redact, skip the file, or abort). - Secrets often appear in bash tool stdout/stderr in the JSONL. Common sources: `echo $API_KEY`, env variable dumps, credential outputs. 8. **Write `logs/conversation/README.md`** listing each session. 9. **Report** what was archived (and whether the secret scan passed cleanly).
View on GitHub