微算力 · API 导航与自营网关
API 接入 EN
未登录登录
📄

一键归档完整对话,智能复盘双向评分

export-conversation-summary · v1.0.0
效率 安全 A 级 作者 youngbeauty 公开目录收录
973 下载 0 安装 2.8k 收藏 22 浏览

简介

导出 Claude Code 完整对话记录为结构化 Markdown,含操作日志、Token 统计与双向质量评估

原始描述

Export current Claude Code conversation to markdown document with full dialogue context and model operations

通过你的 Agent 添加

安装目录:export-conversation/(目录名取自 SKILL.md 的 frontmatter name,不是 URL 里的 slug)。

点「快速安装」复制一段指令贴给你的 Agent:它会先下载到 /tmp、把文件清单和校验值给你看,你确认之后才解压安装。不会一步装完、也不改系统其它位置。

或者手动安装

Claude Code~/.claude/skills/export-conversation-summary/
Codex CLI~/.codex/skills/export-conversation-summary/
DeepSeek Harness~/.agents/skills/export-conversation-summary/

包是「根级 SKILL.md + 作者附带的文件」,解压到上面的 <slug>/ 目录即可; 目录名不用换,也不要把包直接解压到 skills 根目录。 技能申请的权限由作者决定:装之前先看清单里有没有脚本、它会读写什么。

中文使用说明 来自收录源

核心用法

export-conversation 是一款专为 Claude Code 设计的对话归档工具。用户可通过自然语言指令(如"保存这轮对话""导出聊天记录")触发该技能,系统会自动定位本地 JSONL 格式的对话存储文件(位于 ~/.claude/projects/ 目录下),并启动 general-purpose Agent 执行解析与格式化任务。

导出流程分为三步:首先通过 shell 脚本定位当前项目的最新对话文件;随后 Agent 读取 JSONL 并逐行解析,提取用户提问与模型回复,同时识别所有工具调用行为(文件读写、搜索、命令执行、文档查阅等);最终生成一份包含完整对话上下文、操作时间线、Token 消耗统计及双向质量评估的 Markdown 文档,默认保存至 docs/{日期}-conversation.md。

显著优点

本地化处理,隐私可控:全程无外部网络请求,对话数据仅在用户本地流转,彻底杜绝云端泄露风险,特别适合处理含敏感代码、内部架构或商业机密的对话场景。

结构化审计追踪:导出文档不仅记录问答内容,更详细列出每轮对话中模型执行的所有操作(浏览文件、编辑代码、执行命令等),形成可审计的技术决策日志,便于团队复盘与知识沉淀。

双向质量评估体系:内置独特的评分机制,从"问题清晰度、技术细节精准度、上下文提供"三维度评估用户 Prompt 质量,从"操作正确性、上下文理解、解决方案质量、效率"四维度评估模型表现,并附具体改进建议,持续优化人机协作效能。

零依赖极简架构:纯 Markdown 文档型 Skill,无第三方包依赖,无编译代码,从根本上消除供应链攻击面,部署与维护成本极低。

潜在缺点与局限性

T3 来源可信度限制:开发者为 ClawHub 平台个人用户 youngbeauty,无组织级安全流程背书,亦无公开 GitHub 仓库可供深度代码审计,企业敏感环境需谨慎评估。

中文本地化处理不足:技能文档与输出模板混用中英文,部分术语(如"Token 消耗""Prompt 质量评分")在纯中文工作流中可能显得突兀,国际化支持有限。

大规模对话性能未验证:对于超长会话(数万轮或超大 JSONL 文件),当前实现未明确分块读取策略,极端场景下可能引发内存压力。

输出路径灵活性有限:默认固定输出至 docs/ 目录,用户自定义路径需显式指定,自动化流水线集成时可能需要额外适配。

适合的目标群体

  • 技术团队 Leader 与架构师:需要定期归档技术决策过程,建立可查询的知识库
  • Claude Code 重度用户:日均对话轮次多、涉及复杂多文件操作,希望留存完整上下文
  • AI 辅助编程研究者:需要分析人机协作模式,优化 Prompt 工程与模型交互策略
  • 企业合规与审计部门:要求对 AI 辅助开发过程留痕,满足内部安全审计需求
  • 开发者教育与培训机构:将真实对话案例作为教学素材,展示问题排查与代码演进过程

使用风险说明

数据泄露风险(用户侧):导出文件可能包含敏感信息(API 密钥、数据库连接串、内部文件路径),用户需自行审查并脱敏后再分享,避免误提交至公共仓库或 IM 频道。

来源验证风险:T3 级别 Skill 建议首次使用前人工通读 skill.md,确认无隐蔽指令;关键生产环境可联系作者获取源码仓库进行深度审计。

存储空间累积:长期高频使用将产生大量 Markdown 文件,建议建立定期清理与归档策略。

格式兼容性:生成的 Markdown 采用特定模板结构,如需导入其他系统(如 Notion、Confluence),可能需要额外转换脚本。

技能正文


name: export-conversation description: Export current Claude Code conversation to markdown document with full dialogue context and model operations

Export Conversation to Markdown

Extract the current Claude Code conversation from internal JSONL storage and format it as a readable markdown document showing:

  • All user questions
  • All model responses with associated operations (files read/edited, searches, commands, documentation lookups)
  • Timeline of the conversation flow

When to Use

Use this skill when the user asks to:

  • "Export this conversation" / "Save our chat"
  • "把对话保存成文档" / "保存对话记录"
  • Document a problem-solving session
  • Create a record of what was discussed and changed
  • Generate a conversation transcript

Process

Step 1: Locate Current Conversation File

The conversation is stored in ~/.claude/projects/-Users-{user}-{project_path}/ as a JSONL file.

# Find the most recent conversation file
PROJECT_DIR=$(pwd | sed 's|/||g' | sed 's| |-|g')
CONV_DIR="$HOME/.claude/projects/-Users-$(whoami)-$PROJECT_DIR"
LATEST_CONV=$(ls -t "$CONV_DIR"/*.jsonl 2>/dev/null | head -1)

Step 2: Use Task Agent to Parse and Extract

Launch a general-purpose agent to:

  1. Read the JSONL conversation file
  2. Parse each line as JSON
  3. Extract user messages and assistant messages
  4. For assistant messages, identify tool calls and operations
  5. Format as markdown with clear structure

Task prompt template:

Read and parse the JSONL conversation file at `{CONVERSATION_FILE_PATH}`.

This is a Claude Code conversation log. Each line is a JSON object representing a message.

Extract ALL user messages and assistant messages in chronological order.

For each assistant message, identify:
- Files read (Read tool)
- Files edited/written (Edit/Write tools)
- Searches performed (Grep/Glob tools)
- Commands executed (Bash tool)
- Documentation lookups (Context7, web searches)
- Skills invoked (Skill tool)
- Agents dispatched (Task tool)
- Token usage for this turn (from JSONL metadata)
- Text responses to the user

Write the extracted conversation to `{OUTPUT_PATH}` in this format:

```markdown
# {Conversation Title}

## 日期: {YYYY-MM-DD}

---

### 用户 #{N}
[user message text]

### 模型 #{N}
**操作:**
- 浏览文件: [list of files read]
- 编辑文件: [list of files edited]
- 搜索: [searches performed]
- 执行命令: [bash commands]
- 查阅资料: [documentation lookups]

**回复:**
[assistant text response]

**Token 消耗:** [tokens used in this turn]

---

After all conversation turns, add:

对话统计

  • 总轮次: [total user-assistant exchanges]
  • 总时长: [duration from first to last message, e.g., "2小时15分"]
  • Token 消耗总计: [total tokens across all turns]

对话评价

用户 Prompt 质量评分: X/10

评分维度:

  • 问题清晰度 (3分): 问题表述是否明确、无歧义
  • 技术细节精准度 (4分): 技术术语使用是否准确、错误描述是否完整
  • 上下文提供 (3分): 是否提供足够背景信息(截图、报错、代码片段等)

优点:

  • [列出用户提问做得好的地方]

待改进:

  • [列出可以提升的地方,附具体建议]

典型案例:

  • 好的提问示例: [引用对话中的好例子]
  • 可改进示例: [引用对话中可以更精确的例子,并说明如何改进]

模型表现评分: Y/10

评分维度:

  • 操作正确性 (2分): 读取/编辑文件、搜索、命令执行是否准确
  • 上下文理解 (3分): 是否正确理解用户意图和项目状态
  • 解决方案质量 (3分): 提供的方法/代码是否正确、高效、符合最佳实践
  • 效率 (2分): 是否走弯路、是否及时查资料、是否避免重复操作

优点:

  • [列出模型做得好的地方]

问题:

  • [列出模型的失误,分析根本原因]

典型案例:

  • 正确操作示例: [引用做得好的回合]
  • 失误案例: [引用走弯路的回合,分析为什么]

改进建议

给用户:

  1. [具体建议1]
  2. [具体建议2]

给模型:

  1. [具体建议1]
  2. [具体建议2]

Important:
- Skip internal/system messages
- Preserve original language (Chinese/English)
- Summarize tool operations (don't dump raw JSON)
- Include ALL rounds of conversation
- Create output directory if needed

Step 3: Confirm Output Location

After the agent completes:

  1. Read the first 50 lines of the output file to verify format
  2. Report the file path to the user
  3. Provide line count and file size

Example Usage

User says: "把这轮对话保存成文档"

Agent does:

  1. Find conversation file: ~/.claude/projects/-Users-yz-dev3-demo3/ca50434c-b83d-4f88-ac4c-6b4c722cb460.jsonl
  2. Launch agent to parse and extract to docs/2025-02-27-conversation.md
  3. Report: "对话已保存到 docs/2025-02-27-conversation.md (536 行)"

Output Format

The markdown document should include:

Header

  • Title (derived from conversation topic)
  • Date
  • Project name/path

Body

  • Numbered dialogue turns
  • User questions (verbatim)
  • Model responses with:
    • 操作 section listing all tool operations
    • 回复 section with text response to user
  • Preserve code blocks, images, formatting

Footer

  • Summary of files involved
  • Key technical points discussed
  • Total conversation turns
  • Conversation metadata:
    • Total duration (start to end timestamp)
    • Token usage per turn (if available in JSONL)
    • Total tokens consumed
  • Conversation evaluation:
    • User prompt quality score (1-10)
      • Clarity and specificity of questions
      • Technical detail accuracy
      • Problem description completeness
    • Model performance score (1-10)
      • Operation correctness (file reads/edits/searches)
      • Context understanding accuracy
      • Solution quality and code correctness
      • Efficiency (avoiding unnecessary detours)
    • Key strengths and weaknesses for both sides
    • Suggestions for improvement

Tips

  • Use general-purpose agent type (has access to all tools needed)
  • Default output to docs/{YYYY-MM-DD}-conversation.md
  • Ask user for output path if they specify one
  • Handle large JSONL files (read in chunks if needed)
  • Preserve markdown formatting in original messages
  • Don't include this skill's own invocation in the exported conversation

正文来自原始发布页, 版权归作者所有,许可未标注。 权利人认为有不妥,可申请下架。

标签

conversation-managementdocumentationexportmarkdownproductivityagent-automationdeveloper-tools

同类 Skill