Skip to main content

archive-logs

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

跳到安装

来源信息

仓库
AMindToThink/claude-code-settings
最近来源活动
2026年2月25日 15:16
检测到的 SKILL.md 语言
英语
星标
4
分支
0

安装方式

默认使用会先检查来源的 Prompt;你也可以切换为直接命令,或下载本地副本。

检查来源文件

决定是否安装前,请先阅读 SKILL.md,以及 SkillsMP 当前展示的配套文件。

正在显示 SKILL.md

SKILL.md
来源说明 · 只读预览
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).
在 GitHub 查看