Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@Claude Viewer show me conversations from yesterday"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
Claude Viewer
Multi-User Conversation History Viewer for Claude Code
šÆ Overview
Claude Viewer is an admin tool web application for visualizing Claude Code conversation history from all Windows/macOS users on a single machine. It provides rich analytics, full conversation details, token usage tracking, and model/tool insights.
MCP Server integration allows Claude Desktop and Claude Code to query conversation data directly!
Demo
https://github.com/user-attachments/assets/1426b08d-6086-439f-9f4b-d95d7cfdac1e
⨠Key Features
v0.1 Features
ā MCP Server Integration - Query conversation data directly from Claude Desktop/Code
ā 5 MCP Tools - get_claude_users, get_conversations, get_stats, get_conversation_details, open_dashboard
ā Open Dashboard via MCP - Start server and open browser with a single command
ā Shared Library - Refactored codebase with
lib/data-access.jsfor reuseā Configurable Port - Default 2204, configurable via
CLAUDE_VIEWER_PORTenvā Full Conversation Viewer - View complete user/assistant message threads in modal
ā Token Usage Analytics - Track input/output/cache tokens per conversation
ā Model Tracking - See which Claude models are used (Sonnet 4.5, Opus, Haiku)
ā Tool Analytics - Top 10 most-used tools (WebSearch, Bash, Edit, etc.)
ā Enhanced Dashboard - 8 statistical cards
ā Enriched Data Table - 9 columns with messages, tokens, model, tools
ā Dual-Source Architecture - Combines
history.jsonl+projects/*.jsonlfor rich metadata
Core Features
š Real-time statistics dashboard
š Advanced search and filtering (user, project, date range, text)
š Daily activity chart (last 30 days)
āļø Keyword cloud (top 20 keywords)
š„ CSV export with enriched data
š„ļø Multi-user support (scans all system users)
š XSS protection with HTML escaping
š Quick Start
Installation
ā” Quick Start Integration Options
Choose your preferred method to launch Claude Viewer with a single command:
1ļøā£ Automated Launcher Script (Recommended)
A convenient bash script that starts the server and opens your browser automatically.
Location: start-claude-viewer.sh
What it does:
Starts the Node.js server in the background
Waits for server initialization (3 seconds)
Automatically opens your default browser at
http://localhost:2204Displays helpful status messages during startup
Usage:
To stop the server:
Setup (first time only):
2ļøā£ Global Shell Alias
For terminal power users, create a global alias to launch from anywhere.
Add to your
Replace ~/path/to/claude-viewer/ with your actual project path, for example:
Usage from anywhere:
Apply changes:
š Summary of Launch Methods
Method | Command | Requires |
Direct Script |
| None (project directory) |
Shell Alias |
|
|
Manual |
| None |
All launch methods provide the same seamless experience: One command ā Server starts ā Browser opens ā View conversations
Tip: The script runs the server in the background, allowing you to continue using your terminal. To view server logs, check
server.logor monitor the console output.
š MCP Server Integration (v0.1)
Claude Viewer includes an MCP (Model Context Protocol) server that exposes conversation data directly to Claude Desktop and Claude Code.
Running the MCP Server
Available MCP Tools
Tool | Description | Parameters |
| List users with Claude history | - |
| Get conversations with filters |
|
| Aggregated usage statistics | - |
| Full transcript of a session |
|
| Start server and open browser |
|
Configuration
Claude Desktop
Add to ~/Library/Application Support/Claude/claude_desktop_config.json (macOS) or %APPDATA%\Claude\claude_desktop_config.json (Windows):
Claude Code
Option 1: Via CLI (recommended)
Option 2: Configuration file
Global (
~/.claude.json):
Per project (
.mcp.jsonin project root):
Verify configuration:
Example Requests to Claude
Once configured, you can ask Claude to query your conversation history. Here are some practical examples:
Dashboard & Overview
"Open the Claude Viewer dashboard"
"Show me my Claude usage statistics"
"How many conversations do I have in total?"
User Analysis
"Which users have Claude conversation history on this machine?"
"Who is the most active Claude user?"
"Compare token usage between users"
Conversation Search
"Show me conversations about MCP from the last week"
"Find all conversations related to React development"
"Search for conversations where I discussed database optimization"
"List conversations from the project /Users/max/myapp"
Token & Cost Analysis
"What's my total token usage this month?"
"Which conversations consumed the most tokens?"
"Show daily token usage for the past 30 days"
"Calculate my estimated API costs based on token usage"
Model & Tool Insights
"Which Claude model do I use most frequently?"
"What tools are most commonly used in my conversations?"
"Show conversations where I used WebSearch"
"List all conversations that used the Bash tool"
Conversation Details
"Get the full transcript of session abc123..."
"Show me the last conversation I had about authentication"
"What did Claude suggest for the caching implementation?"
š Dashboard & Features
8-Card Statistics Dashboard
Total Conversations - Count of all conversations
Active Users - Number of unique users
Most Active User - User with most conversations
Most Used Project - Top project by conversation count
Total Tokens - Sum of all input/output/cache tokens
Total Messages - Count of all user + assistant messages
Top Model - Most-used Claude model (e.g., "sonnet-4-5")
Top Tool - Most-used tool (e.g., "WebSearch")
9-Column Conversation Table
Timestamp
User
Project
Prompt (user's first message)
Msgs - Number of messages in conversation
Tokens - Formatted token usage (e.g., "12,345")
Model - Model used (e.g., "sonnet-4-5")
Tools - Tool count with hover tooltip for names
Actions (Details button)
Additional Features
Conversation Modal - Click "š¬ Dettagli" to view full user/assistant thread
Daily Activity Chart - Canvas-based visualization of last 30 days
Keyword Cloud - Frequency-based sizing (4+ character words only)
Advanced Filters - Text search, user, project, date range
CSV Export - Download filtered data with 8 columns
šļø Architecture
Tech Stack
Backend: Node.js + Express.js (v4.18.2)
Frontend: Vanilla JavaScript, HTML5, CSS3 (no frameworks)
Data Format: JSONL (JSON Lines) from Claude Code history
Platform: Cross-platform (Windows/macOS/Linux)
Dual-Source Data Architecture
Claude Viewer now combines data from two sources for enriched insights:
Source 1: Quick Conversation List
Path: ~/.claude/history.jsonl (Windows: C:\Users\{USERNAME}\.claude\history.jsonl)
Contains:
User prompts (display text)
Timestamps
Project paths
Basic metadata
Purpose: Fast scanning for conversation list
Source 2: Full Session Transcripts
Path: ~/.claude/projects/{project}/{session-uuid}.jsonl
Contains:
Complete message threads (user + assistant)
Token usage (input/output/cache_creation/cache_read)
Model information (e.g., "claude-sonnet-4-5-20250929")
Tool usage (WebSearch, Bash, Edit, Read, etc.)
Thinking blocks and tool_use content
Purpose: Rich metadata extraction
Data Flow
REST API Endpoints
GET /api/users- List of users with Claude historyGET /api/conversations- All conversations with enriched metadataIncludes: messageCount, totalTokens, model, toolsUsed[], hasDetails
Sorted by timestamp descending (most recent first)
GET /api/stats- Aggregated statisticsOriginal: totalConversations, totalUsers, userStats, projectStats, dailyStats, topKeywords
New: totalTokens, totalMessages, tokensByUser, modelStats, toolStats, dailyTokenStats
GET /api/conversation/:sessionId/:username- Full conversation transcriptReturns complete thread with all messages
Used by modal for detailed view
š ļø Configuration
Change Port (Optional)
Default port is 2204. You can change it via environment variable:
Data Locations
macOS/Linux:
History:
~/.claude/history.jsonlSessions:
~/.claude/projects/{project}/{session-uuid}.jsonl
Windows:
History:
C:\Users\{USERNAME}\.claude\history.jsonlSessions:
C:\Users\{USERNAME}\.claude\projects\{project}\{session-uuid}.jsonl
ā ļø Troubleshooting
No Data Displayed
Symptoms: Empty conversation list, 0 total conversations
Solutions:
Verify Claude history files exist:
# macOS/Linux ls ~/.claude/history.jsonl # Windows dir C:\Users\*\.claude\history.jsonlCheck permissions (may require admin on enterprise PCs):
# macOS/Linux sudo npm start # Windows (run terminal as Administrator) npm startCheck server logs for errors:
tail -f server.log
Dashboard Shows "0" for Tokens/Messages
Cause: ~/.claude/projects directory not accessible or empty
Solutions:
Verify session files exist:
# macOS/Linux find ~/.claude/projects -name "*.jsonl" # Windows dir C:\Users\%USERNAME%\.claude\projects /s /b | findstr .jsonlCheck server console for "Error enriching conversation" messages
Graceful Degradation: App still works, showing 0 values but conversation list remains visible
Table Missing New Columns (Msgs, Tokens, Model, Tools)
Cause: Browser cached old app.js
Solutions:
Hard refresh:
Ctrl+Shift+R(Windows/Linux) orCmd+Shift+R(macOS)Clear browser cache for
localhost:2204Try incognito/private browsing mode
Port 2204 Already in Use
Symptoms: Error: listen EADDRINUSE: address already in use :::2204
Solutions:
Option 1: Kill existing process
# macOS/Linux lsof -ti:2204 | xargs kill # Windows netstat -ano | findstr :2204 taskkill /F /PID [PID from above]Option 2: Use different port via environment variable
CLAUDE_VIEWER_PORT=3000 npm start
"Cannot find module 'express'" Error
Cause: Dependencies not installed
Solution:
Modal Shows "Session not found"
Cause: Session file deleted, moved, or corrupted
Solutions:
Session may have been cleaned up by Claude Code
Conversation still visible in list but full transcript unavailable
Check if
projects/directory exists and contains.jsonlfiles
Permission Errors on Enterprise PCs
Cause: Corporate policies restrict access to user directories
Solutions:
Run terminal/command prompt as Administrator
Contact IT to grant read access to
C:\Users\*\.claude\directoriesAlternative: Copy history files to accessible location and modify paths in
server.js
Slow Loading (>10 seconds)
Cause: Too many conversations to enrich (>500)
Performance Notes:
Enrichment reads
projects/*.jsonlfor each conversation (~100-700KB per file)Typical load time: 2-5 seconds for 200-500 conversations
Memory usage: ~50-100MB for typical workload
Optimization Opportunities:
Add in-memory cache for session metadata
Implement lazy loading (only load on modal open)
Consider SQLite database for >1000 conversations
š§āš» Development
Project Structure
Key Backend Functions
File: server.js
getClaudeUsers()- Scans for users with.claudedirectoriesparseHistoryFile(filePath, username)- Parseshistory.jsonlgetUserSessions(username)- Finds all session UUID filesparseSessionTranscript(filePath)- Parses full session JSONLextractSessionMetadata(messages)- Extracts tokens, model, tools, message countmapConversationsToSessions(conversations, users)- Matches history to sessionsbuildConversationThread(messages)- Builds threaded conversation view
Key Frontend Functions
File: public/app.js
updateDashboard(stats)- Populates 8-card dashboardrenderConversations()- Renders 9-column table with enriched dataexportToCSV()- Exports 8 columnsshowConversationDetails(sessionId, username)- Opens modal with full transcriptrenderConversationThread(thread, container)- Renders user/assistant messagesrenderAssistantContent(content)- Handles text/thinking/tool_use blocks
š Version History
v0.1.0 (2025-12-08) - Initial Public Release
Major Features:
ā MCP Server - Exposes conversation data via Model Context Protocol
ā 5 MCP Tools - get_claude_users, get_conversations, get_stats, get_conversation_details, open_dashboard
ā Open Dashboard Tool - Start server and open browser directly from Claude
ā Shared Library - Refactored code into
lib/data-access.jsfor reuseā ES Modules - Migrated from CommonJS to ES modules
ā Configurable Port - Default 2204, set via
CLAUDE_VIEWER_PORTenv
Architecture Changes:
server.js: Reduced from ~920 to ~114 lines (uses lib/)lib/data-access.js: New shared module (~700 lines)mcp-server.js: New MCP server entry point (~350 lines)package.json: Added"type": "module", MCP SDK dependencies
Dependencies Added:
@modelcontextprotocol/sdk: ^1.12.0zod: ^3.25.0
š§Ŗ Test Checklist
After installation or upgrade, verify:
Dashboard displays 8 cards
"Total Tokens" and "Total Messages" cards show numbers > 0
"Top Model" card shows model name (e.g., "sonnet-4-5")
"Top Tool" card shows tool name (e.g., "WebSearch")
Conversation table has 9 columns
"Msgs" column shows message count
"Tokens" column shows formatted numbers (with commas)
"Model" column shows abbreviated model names
"Tools" column shows "X tools" with hover tooltip
"š¬ Dettagli" button opens modal with full conversation
Modal displays user and assistant messages correctly
CSV export includes 8 columns
Search and filters work correctly
Daily activity chart renders
Keyword cloud displays
š Technical Notes
Performance Characteristics
No database: All data loaded from files on each API request
No backend pagination: All conversations loaded into memory at once
Frontend filtering: O(n) filtering on every filter change
Keyword extraction: Simple regex word matching (
\b\w{4,}\b)
Security
ā XSS protection with
escapeHtml()functionā Session ID validation in backend
ā No SQL injection risk (no database)
ā ļø File system access required (ensure proper permissions)
Browser Compatibility
Chrome/Edge 90+
Firefox 88+
Safari 14+
Requires ES6+ support
āļø Claude Code Configuration
Session Retention
Claude Code automatically deletes conversation sessions older than 30 days by default. To preserve history for Claude Viewer, configure the retention period in ~/.claude/settings.json:
Common values:
30- Default (1 month)90- 3 months365- 1 year730- 2 years999999- Virtually unlimited
File locations:
OS | Path |
macOS/Linux |
|
Windows |
|
Important: Longer retention means more historical data available in Claude Viewer!
š¤ Contributing
For issues or feature requests:
Check
CLAUDE.mdfor architectural detailsReview
server.logfor runtime errorsOpen an issue on GitHub
š License
MIT License
Copyright (c) 2025 Max Turazzini
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Built with: Node.js, Express.js, Vanilla JavaScript Powered by: Claude Code conversation history data Author: Max Turazzini Version: 0.1.0 Last Updated: 2025-12-08