Built CLI Tools to Browse AI Coding Assistant Logs (Claude Code & Codex CLI)
Source: Dev.to
The Problem
If you’re using AI coding assistants like Claude Code or OpenAI Codex CLI, you’ve probably had this experience:
- “What was that solution Claude suggested last week?”
- “How did I phrase that prompt that worked so well?”
Both tools store conversation logs locally, but finding past sessions is painful:
# Claude Code logs
~/.claude/projects//*.jsonl
# Codex CLI logs
~/.codex/sessions/YYYY/MM/DD/*.jsonl
Navigating these nested directories manually? No thanks.
The Solution
I built two simple shell scripts that use fzf for interactive log browsing:
- claude-logs – for Claude Code
- codex-logs – for OpenAI Codex CLI
Each is a single file (~200 lines), requires only fzf and jq, and works out of the box.
Features
Both tools share the same command structure:
| Command | Description |
|---|---|
| (no args) | Interactive mode – browse with fzf |
list | Show all projects/months |
latest | View the most recent session |
tail | Watch active session in real-time |
status | Check if the CLI is running |
Quick Demo
Interactive Mode
$ claude-logs
# → Select project with fzf
# → Select session with fzf
# → View formatted conversation
Real‑time Monitoring
$ claude-logs tail
# → Watch the active session live (Ctrl+C to exit)
Status Check
$ claude-logs status
Claude Code is running (PID: 12345)
Recent sessions:
2025-12-18 15:30 - my-project
2025-12-18 14:00 - another-project
Output Format
Raw JSONL logs are transformed into readable conversations:
━━━━━━━━━━ USER ━━━━━━━━━━
Fix the bug in this function
━━━━━━━━━━ CLAUDE ━━━━━━━━━━
I found the issue. The problem is...
🔧 [Tool: Edit file]
For Codex CLI, you also get project path and git branch info:
=== rollout-xxx.jsonl ===
Project: /Users/me/my-project | Branch: main
Installation
Prerequisites
brew install fzf jq
Install claude-logs
git clone https://github.com/wondercoms/claude-logs.git
chmod +x claude-logs/claude-logs
cp claude-logs/claude-logs ~/.local/bin/
Install codex-logs
git clone https://github.com/wondercoms/codex-logs.git
chmod +x codex-logs/codex-logs
cp codex-logs/codex-logs ~/.local/bin/
Note: Make sure
~/.local/binis in yourPATH.
How It Works
The tools are straightforward:
- Scan the log directory structure.
- Parse JSONL files with
jqto extract messages. - Display options with
fzf(including a preview). - Format output with ANSI colors.
The fzf preview feature is key – you can see conversation snippets before opening:
fzf --preview 'head -20 {} | jq -r "..."'
Use Cases
- Reference Past Solutions – Find how you solved a similar problem before.
- Reuse Effective Prompts – Discover prompts that worked well and adapt them.
- Daily Review – Review what you accomplished with AI assistance today.
- Debugging – Check logs when the AI CLI behaves unexpectedly.
Current Limitations
- macOS only (uses
stat -ffor timestamps). - Linux support would need
stat --format– PRs welcome!
Links
- claude-logs: https://github.com/wondercoms/claude-logs
- codex-logs: https://github.com/wondercoms/codex-logs
Wrapping Up
If you’re a heavy user of Claude Code or Codex CLI, give these tools a try. They’re simple, dependency‑light, and solve a real annoyance.
Found a bug? Want Linux support? Issues and PRs are welcome!