Show HN: 交互式浏览 Claude Code 和 Codex CLI 日志的命令行工具
1 分•作者: hy_wondercoms•6 个月前
我每天都在使用 Claude Code 和 OpenAI Codex CLI,并且发现自己经常需要翻阅层层嵌套的目录来查找过去的会话记录。
Claude Code 将日志存储在 `~/.claude/projects/<哈希值>/*.jsonl` 中。
Codex CLI 将日志存储在 `~/.codex/sessions/YYYY/MM/DD/*.jsonl` 中。
手动浏览这些日志非常繁琐,所以我编写了两个简单的 shell 脚本,使用 fzf 实现交互式选择和预览功能。
*claude-logs*: <a href="https://github.com/wondercoms/claude-logs" rel="nofollow">https://github.com/wondercoms/claude-logs</a>
*codex-logs*: <a href="https://github.com/wondercoms/codex-logs" rel="nofollow">https://github.com/wondercoms/codex-logs</a>
功能:
- 使用 fzf 进行交互式项目/会话选择
- 在打开之前预览对话
- 使用 `tail` 命令进行实时监控
- 状态检查(CLI 是否正在运行?)
- 带有颜色的格式化输出
要求:fzf, jq (目前仅限 macOS)
使用方法很简单:
查看原文
I've been using Claude Code and OpenAI Codex CLI daily, and found myself constantly
digging through nested directories to find past sessions.<p>Claude Code stores logs in ~/.claude/projects/<hash>/<i>.jsonl
Codex CLI stores logs in ~/.codex/sessions/YYYY/MM/DD/</i>.jsonl<p>Browsing these manually is tedious, so I built two simple shell scripts that use
fzf for interactive selection with previews.<p>*claude-logs*: <a href="https://github.com/wondercoms/claude-logs" rel="nofollow">https://github.com/wondercoms/claude-logs</a>
*codex-logs*: <a href="https://github.com/wondercoms/codex-logs" rel="nofollow">https://github.com/wondercoms/codex-logs</a><p>Features:
- Interactive project/session selection with fzf
- Preview conversations before opening
- Real-time monitoring with `tail` command
- Status check (is the CLI running?)
- Formatted output with colors<p>Requirements: fzf, jq (macOS only for now)<p>Usage is simple: