Skip to content

Claude Code Log Viewer: How to Browse and Search Your Session History

Claude Code has rapidly become the go-to AI coding assistant for many developers. But as your usage grows, so does a practical question: how do you go back and find something from a previous session?

Claude Code stores every session locally as JSONL files, which is great for data sovereignty but terrible for human readability. This guide covers every method for viewing your Claude Code session history, from raw file parsing to dedicated viewer applications.

Where Claude Code Stores Sessions

Claude Code saves session data across two main locations:

# Project-specific sessions
~/.claude/projects/<project-hash>/sessions/

# Desktop app sessions (if using Claude Desktop)
~/Library/Application Support/Claude/claude-code-sessions/  # macOS

Each session is a .jsonl file — one JSON object per line. A single session can contain hundreds of lines, mixing:

  • User prompts and AI responses
  • Tool call requests and results (file reads, writes, shell commands)
  • System messages and context
  • Token usage metadata

Reading these files directly is impractical for all but the simplest sessions.

Tool Comparison: Finding the Right Viewer

The Claude Code ecosystem has produced several purpose-built viewers. Here's how they compare:

1. claude-code-log (CLI → HTML)

A Python CLI tool that converts JSONL transcripts into readable HTML format.

Best for: Quick one-off conversions when you know which session you want to read.

Features:

  • Converts JSONL to clean HTML with syntax highlighting
  • Interactive TUI for browsing sessions
  • Session summaries with message counts and token usage
  • Lightweight — just Python, no heavy dependencies

Limitations: One session at a time, no cross-session search.

2. Claude Code History Viewer (CCHV)

A desktop application for browsing and analyzing Claude Code conversation history.

Best for: Developers who want a dedicated app for deep-diving into session data.

Features:

  • Switch between Claude Code, Codex CLI, and OpenCode sessions
  • Interactive bar chart timeline of coding activity
  • Token usage comparison across providers
  • Can run as headless HTTP server for remote access

Limitations: Primarily focused on analytics; browsing large sessions can be slow.

3. clog (Web-based Viewer)

A web-based viewer with real-time monitoring and cross-platform support.

Best for: Teams who want to monitor sessions as they happen.

Features:

  • Session grouping with metadata display
  • Conversation threading
  • Real-time log monitoring
  • Cross-platform web interface

Limitations: Requires running a local server.

4. VS Code Extensions

Claude Log Navigator and Claude Code and Codex Assist bring session viewing into your editor.

Best for: Developers who prefer staying in VS Code.

Features:

  • Browse sessions without leaving the editor
  • View file diffs generated during sessions
  • Track token usage and costs

Limitations: Tied to VS Code; limited visualization options.

5. Mantra (Unified Session Manager)

Mantra is a desktop application that manages sessions from Claude Code, Cursor, Gemini, and other AI tools in a single interface.

Best for: Developers using multiple AI tools who want unified session management.

Features:

  • Automatic discovery: Scans your machine and imports Claude Code sessions with zero configuration
  • Visual timeline: Navigate through sessions with a video-player-like scrubber — jump to any point in the conversation
  • Full-text search: Search across all sessions from all AI tools simultaneously
  • Context causality: Understand which prompts led to which code changes
  • Sensitive data detection: Automatically highlights potential secrets or credentials in your session data
  • Local-first: Everything runs on your machine, nothing is sent to external servers

Step-by-Step: Viewing Your Sessions with Mantra

  1. Download Mantra — available for macOS, Windows, and Linux

  2. Open the Import Wizard — Mantra automatically detects your Claude Code installation and lists available sessions

  3. Import sessions — Select which projects and sessions to import. Mantra parses the JSONL files and builds a searchable, visual representation

  4. Browse the timeline — Each session appears as a visual block on the timeline. Click to expand and scrub through the conversation

  5. Search across everything — Use the search bar to find specific code snippets, function names, or discussion topics across all imported sessions

Comparison Table

Featureclaude-code-logCCHVclogVS Code ExtMantra
View sessionsYesYesYesYesYes
Cross-session searchNoLimitedNoLimitedFull
Visual timelineNoChartNoNoFull
Multi-tool supportNoPartialNoPartialFull
Real-time monitoringNoNoYesNoYes
Privacy (local-only)YesYesYesYesYes
Token analyticsBasicDetailedBasicBasicDetailed
Setup complexityLowMediumMediumLowLow

Tips for Managing Claude Code Sessions

  1. Understand the session structure: Each .jsonl line is a self-contained event. The type field tells you whether it's a human message, assistant response, or tool call.

  2. Regular cleanup: Old sessions accumulate. Periodically review and archive sessions for completed projects.

  3. Use project organization: Claude Code organizes sessions by project directory hash. If you consistently work from the same project root, your sessions will be grouped together.

  4. Back up your sessions: The ~/.claude/ directory contains all your session data. Include it in your backup routine.

  5. Check token usage: Session viewers that show token counts help you understand your API consumption and optimize your prompting strategy.

Conclusion

The gap between Claude Code's powerful AI capabilities and its basic session management is real. Whether you choose a lightweight CLI converter for quick lookups or a full-featured desktop app like Mantra for comprehensive session management, the key is having a reliable way to access and search your session history.

As Claude Code continues to evolve, your session archive becomes an increasingly valuable knowledge base. Investing in a good viewer today means you'll always be able to find that crucial conversation from weeks or months ago.


Ready to take control of your Claude Code sessions? Get Mantra — the unified viewer for all your AI coding sessions.

Read more: