Skip to content

Latest commit

 

History

History
216 lines (150 loc) · 10.6 KB

File metadata and controls

216 lines (150 loc) · 10.6 KB

Claude Code Exporter

Claude Code Exporter

Open VSX Version Downloads License

English · 中文


English

What It Does

Export conversations from Claude Code, OpenAI Codex CLI, and Cursor Composer to Markdown — automatically, in real time, into your project folder. Every session becomes a searchable local file you can read, version, and paste back as context.

Three tools. One exporter. Zero configuration.

How It Works

Claude Code  ~/.claude/projects/<project>/*.jsonl  →  .claude-code-history/
Codex CLI    ~/.codex/sessions/YYYY/MM/DD/*.jsonl  →  .codex-history/
Cursor       globalStorage/state.vscdb (SQLite)    →  .cursor-history/

Open any workspace → watchers start automatically → conversations export in real time as you chat. The export folders live inside your project root, so history is always co-located with your code.

Features

Feature Description
Auto-watch Real-time export for all 3 tools the moment you start chatting. No button pressing.
3 sources Claude Code.claude-code-history/ · Codex CLI.codex-history/ · Cursor Composer.cursor-history/
Two formats Readable — rich Markdown with metadata, tool call details, collapsed blocks. Compact — clean Human/Claude turns, optimized for pasting back as context.
Sidebar Browse all Claude Code sessions for the current project. Export or open any session with one click.
Session inject Clone any session with fresh UUIDs into the current project, resumable with claude --resume.
Import Browse sessions from any project on your computer and import them into the current workspace.
Tidy Merge duplicate exports, fix timestamps, auto-migrate old .cc-history/.claude-code-history/.
Repair Strip thinking-block signatures that cause 400 Invalid signature errors when switching API providers.
Smart filenames {date}_{time}_{first-message}_{sessionId}.md — sorted by second, de-duplicated by session ID.

Quick Start

  1. Install from the VS Code Marketplace or Open VSX
  2. Open any project where you've used Claude Code, Codex, or Cursor Composer
  3. Done — check .claude-code-history/, .codex-history/, .cursor-history/ in your project root

Export Menu

Click the status bar counter or the cloud icon in the sidebar:

$(comment-discussion)  Claude Code Sessions    →  .claude-code-history/
$(robot)               Codex CLI Sessions      →  .codex-history/
$(window)              Cursor Composer         →  .cursor-history/
$(wrench)              Repair Session          →  Fix 400 errors after API switch

Each source has its own submenu: Export All · Change Format · Open Folder · Tidy

Repair: Fix "Invalid signature in thinking block"

If you switch API providers mid-conversation (e.g. from Anthropic to a third-party endpoint), Claude's thinking blocks carry a cryptographic signature tied to the original provider. The new provider rejects it with a 400 Invalid signature in thinking block error.

Repair strips those signatures from the JSONL file. Claude regenerates fresh thinking on the next turn.

Click the $(wrench) icon in the sidebar toolbar → choose current session or all sessions → optionally reload the window.

Use as a Knowledge Base

Set format to Compact, then in a new session:

Read .claude-code-history/2025-03-27_143025_fix-auth-bug_a1b2c3d4_compact.md
and use that context to continue the work.

Claude now has full context from a previous session. Works across tools — paste a Claude Code export into Cursor, or a Codex export into Claude.

Settings

Setting Default Description
claudeCodeExporter.autoExport true Auto-export on open and on changes
claudeCodeExporter.exportFormat readable readable for archiving, compact for AI context
claudeCodeExporter.includeThinking false Include extended thinking / reasoning blocks
claudeCodeExporter.includeToolDetails true Include tool call details in exports
claudeCodeExporter.claudeProjectsDir ~/.claude/projects Custom Claude projects directory path

See Also

Extension Description
Claude Code Prism Real-time HUD for Claude Code for VS Code — token usage, cost, context window and model info in your status bar

Compatibility

  • VS Code 1.85+ · Cursor · Windsurf
  • Claude Code CLI · Claude Code for VS Code · OpenAI Codex CLI · Cursor Composer
  • Windows / macOS / Linux

中文

是什么

Claude CodeOpenAI Codex CLICursor Composer 三种 AI 编码工具的对话记录自动导出为 Markdown 文件,实时保存到你的项目文件夹。每次对话都变成可搜索的本地文件,可以直接阅读、版本管理,或者贴回给 AI 作上下文。

三个工具,一个导出插件,零配置。

工作原理

Claude Code  ~/.claude/projects/<project>/*.jsonl  →  .claude-code-history/
Codex CLI    ~/.codex/sessions/YYYY/MM/DD/*.jsonl  →  .codex-history/
Cursor       globalStorage/state.vscdb (SQLite)    →  .cursor-history/

打开任意工作区 → 三个 watcher 自动启动 → 对话进行中实时导出。导出文件夹在项目根目录下,历史记录始终和代码放在一起。

功能

功能 说明
自动监听 三种工具开口说话的瞬间就开始实时导出,无需手动操作
3 种来源 Claude Code.claude-code-history/ · Codex CLI.codex-history/ · Cursor Composer.cursor-history/
双格式 可读模式 — 完整 Markdown,含元数据和工具调用,用于存档。精简模式 — 纯对话流,用于贴回给 AI 作上下文
侧边栏 浏览当前项目的所有 Claude Code 会话,一键导出或预览
会话注入 用新 UUID 克隆任意会话到当前项目,支持 claude --resume 续接
导入 浏览全机所有项目的会话,导入到当前工作区
Tidy 整理 合并重复导出、修正时间戳、自动把旧 .cc-history/ 迁移到 .claude-code-history/
Repair 修复 剥离 thinking block 签名,解决切换 API 提供商后出现的 400 Invalid signature 报错
智能命名 {日期}_{时间}_{首条消息}_{会话ID}.md,按秒排序,按会话 ID 去重

快速开始

  1. VS Code MarketplaceOpen VSX 安装
  2. 打开你用过 Claude Code、Codex 或 Cursor Composer 的任意项目
  3. 完成 — 查看项目根目录下的 .claude-code-history/.codex-history/.cursor-history/

导出菜单

点击状态栏的会话计数,或侧边栏的云图标:

$(comment-discussion)  Claude Code Sessions   →  .claude-code-history/
$(robot)               Codex CLI Sessions     →  .codex-history/
$(window)              Cursor Composer        →  .cursor-history/
$(wrench)              Repair Session         →  修复 API 切换后的 400 报错

每种来源都有独立子菜单:导出全部 · 切换格式 · 打开文件夹 · 整理

Repair:修复「Invalid signature in thinking block」

切换 API 提供商后(比如从 Anthropic 换到第三方接口),Claude 的 thinking block 携带绑定原提供商的加密签名,新提供商无法验证,报 400 Invalid signature in thinking block

Repair 从 JSONL 文件中剥离这些签名,Claude 下次对话时重新生成新的 thinking。

点击侧边栏工具栏的 $(wrench) 图标 → 选择修复当前会话或全部会话 → 可选重载窗口。

用作知识库

格式切换为精简模式,然后在新会话里:

Read .claude-code-history/2025-03-27_143025_fix-auth-bug_a1b2c3d4_compact.md
and use that context to continue the work.

Claude 立刻拥有上一次会话的完整上下文。跨工具同样有效——把 Claude Code 的导出文件贴进 Cursor,或者把 Codex 的导出文件贴给 Claude。

设置项

设置 默认值 说明
claudeCodeExporter.autoExport true 打开项目和检测到变更时自动导出
claudeCodeExporter.exportFormat readable readable 存档,compact 喂 AI
claudeCodeExporter.includeThinking false 包含扩展思考/推理块
claudeCodeExporter.includeToolDetails true 包含工具调用详情
claudeCodeExporter.claudeProjectsDir ~/.claude/projects 自定义 Claude 项目目录

相关扩展

扩展 说明
Claude Code Prism Claude Code for VS Code 的实时 HUD——状态栏显示 token 用量、费用、上下文窗口和模型信息

兼容性

  • VS Code 1.85+ · Cursor · Windsurf
  • Claude Code CLI · Claude Code for VS Code · OpenAI Codex CLI · Cursor Composer
  • Windows / macOS / Linux

Downloads Trend

Built for developers who talk to AI all day and don't want to lose those conversations.
为每天和 AI 对话、又不想丢失这些对话的开发者而造。