XZL-CODE

Cc History Viewer — Development skill for Claude Code

Development community

本地 Claude Code 历史 Prompt 与对话可视化工具 · Local desktop viewer for Claude Code prompt & conversation history.

How to install Cc History Viewer

This entry records only its repository, not the path inside it, so there is no exact command to give. Open XZL-CODE/cc-history-viewer and copy the folder into ~/.claude/skills/, or the file into ~/.claude/agents/.

What Cc History Viewer does

本地 Claude Code 历史 Prompt 与对话可视化工具 · Local desktop viewer for Claude Code prompt & conversation history.

Alternatives in Development

  • 09 Bygdebok Extraction — Local History Extraction 1.1k ★
  • Claude Usage — A local dashboard for tracking your Claude Code token usage, costs, and session history 864 ★
  • Coding Agent Session Search — Unified TUI and CLI to index and search your local coding agent session history across 11+ providers (Codex, C 708 ★

README

Coding Agent History Viewer

Coding Agent History Viewer

**本地、只读地浏览 Claude Code 与 OpenAI Codex 的 Prompt、会话和用量**

**A local, read-only viewer for Claude Code and OpenAI Codex history**

[简体中文](#简体中文) · [English](#english)


简体中文

Coding Agent History Viewer 是一个 Tauri 桌面应用。它在本机扫描 Claude Code 与 OpenAI Codex 的历史文件,按工作目录聚合 Prompt、会话、工具调用和 Token 用量。应用不联网,也不会把历史上传到任何服务。

功能

  • 在概览顶部按 Claude Code / Codex / 全部 筛选,默认选择“全部”并在本机持久化选择。
  • 按工作目录浏览项目、Prompt 和会话;“全部”模式下相同 cwd 合并为一个项目。
  • 查看最近 Prompt、全局搜索、文件夹内搜索、完整会话、Markdown、工具调用和思考内容。
  • Prompt、会话和导出内容保留 Claude Code 或 Codex 来源标识。
  • 统计每日活动、小时与星期分布、项目排行、模型、CLI 版本、Token、缓存命中率和估算成本。
  • 按文件 mtime 建立增量索引,并行扫描大历史库;JSONL 按行流式解析。
  • 任一产品的数据目录不存在时,仍可正常浏览另一个产品的数据。

数据路径

Claude Code

数据 默认路径 用途
Prompt 历史 ~/.claude/history.jsonl 输入框历史
完整会话 ~/.claude/projects/**/*.jsonl 用户/助手消息、工具调用和用量
会话元数据 ~/.claude/sessions/*.json CLI 版本等补充信息

设置中的 `historyFile`、`projectsDir`、`sessionsDir` 可分别覆盖路径;否则从 `claudeDataDir` 推导;仍未配置时使用 `~/.claude`。这些旧字段继续兼容已有 `settings.json`。

OpenAI Codex

数据 默认路径 用途
Prompt 历史 /history.jsonl session_idtextts
当前会话 /sessions/YYYY/MM/DD/rollout-*.jsonl 完整事件流
归档会话 /archived_sessions/*.jsonl 已归档事件流

`CODEX_ROOT` 的优先级固定为:

  1. 设置中的 codexDataDir
  2. 环境变量 CODEX_HOME
  3. ~/.codex

设置页会分别显示两种产品的配置值、最终解析路径和存在状态。保存设置后重新建立索引,无需重新编译。旧版仅含 Claude 字段的设置文件会自动按默认值补齐 Codex 配置。

设置文件位于系统应用配置目录。macOS 默认是:

~/Library/Application Support/com.xzl.cchistoryviewer/settings.json

为兼容旧开发环境,源码根目录的 `settings.json` 仍可作为低优先级回退。示例见 [`settings.example.json`](./settings.example.json)。bundle identifier `com.xzl.cchistoryviewer` 保持不变,因此原有应用配置目录不会丢失。

Codex 格式兼容

  • session_meta 读取会话 ID、cwd、CLI 版本和客户端来源,从最近的 turn_context 读取模型。
  • event_msg.user_message 提取当前格式的真实用户 Prompt;`history