展示HN:用于交互式浏览Claude Code和Codex CLI日志的命令行工具

1作者: hy_wondercoms大约 2 个月前原帖
我每天都在使用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&#x27;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 ~&#x2F;.claude&#x2F;projects&#x2F;&lt;hash&gt;&#x2F;<i>.jsonl Codex CLI stores logs in ~&#x2F;.codex&#x2F;sessions&#x2F;YYYY&#x2F;MM&#x2F;DD&#x2F;</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:&#x2F;&#x2F;github.com&#x2F;wondercoms&#x2F;claude-logs" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;wondercoms&#x2F;claude-logs</a> *codex-logs*: <a href="https:&#x2F;&#x2F;github.com&#x2F;wondercoms&#x2F;codex-logs" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;wondercoms&#x2F;codex-logs</a><p>Features: - Interactive project&#x2F;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: