展示HN:用于交互式浏览Claude Code和Codex CLI日志的命令行工具
我每天都在使用Claude Code和OpenAI Codex CLI,发现自己不断需要在嵌套目录中查找过去的会话记录。
Claude Code将日志存储在~/.claude/projects/<hash>/.jsonl中,而Codex CLI则将日志存储在~/.codex/sessions/YYYY/MM/DD/.jsonl中。
手动浏览这些日志非常繁琐,因此我编写了两个简单的Shell脚本,使用fzf进行交互式选择和预览。
*claude-logs*: [https://github.com/wondercoms/claude-logs](https://github.com/wondercoms/claude-logs)
*codex-logs*: [https://github.com/wondercoms/codex-logs](https://github.com/wondercoms/codex-logs)
功能:
- 使用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: