Built CLI Tools to Browse AI Coding Assistant Logs (Claude Code & Codex CLI)

Published: (December 18, 2025 at 06:58 PM EST)
2 min read
Source: Dev.to

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:

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:

CommandDescription
(no args)Interactive mode – browse with fzf
listShow all projects/months
latestView the most recent session
tailWatch active session in real-time
statusCheck 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/bin is in your PATH.

How It Works

The tools are straightforward:

  1. Scan the log directory structure.
  2. Parse JSONL files with jq to extract messages.
  3. Display options with fzf (including a preview).
  4. 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

  1. Reference Past Solutions – Find how you solved a similar problem before.
  2. Reuse Effective Prompts – Discover prompts that worked well and adapt them.
  3. Daily Review – Review what you accomplished with AI assistance today.
  4. Debugging – Check logs when the AI CLI behaves unexpectedly.

Current Limitations

  • macOS only (uses stat -f for timestamps).
  • Linux support would need stat --format – PRs welcome!

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!

Back to Blog

Related posts

Read more »

Project Structure Checker

What it does PSX auto‑detects the project type Node, Go, etc. and runs a set of rules to ensure the repository has the essential files. If something’s missing...