The Conversation Monitor provides a lightweight, mobile-friendly interface for browsing, searching, and analyzing Claude Code conversations. Perfect for reviewing sessions on tablets or phones.
Launch Monitor
Start the conversation monitor:
Output:
The interface automatically opens at http://localhost:9876.
Options
Verbose Mode
Enable detailed logging:
Shows:
- File watching events
- Message change detection
- WebSocket broadcasts
- State calculations
Remote Access
Setup Cloudflare Tunnel for remote access:
Output:
The tunnel URL works on any device - perfect for checking conversations on your phone while away from your computer.
Disable Auto-open
Start server without opening browser:
Features
Conversation Browsing
- List view: All conversations sorted by last modified
- Project grouping: Filter by working directory
- State indicators: Active, Idle, Recently active, Inactive
- Message counts: Total messages per conversation
- Token usage: Token counts displayed
Search Capabilities
Search by:
- Conversation ID
- Filename
- Project name
Content Search
Search within message content:
Searches:
- Text messages
- Tool use blocks
- Tool names
- Tool inputs
Date Range Filtering
Working Directory Filter
Conversation Details
View full conversation messages:
Pagination supported:
Returns:
- Message role (user/assistant)
- Message content (text and tool blocks)
- Correlated tool results
- Timestamps
- Model information
- Token usage per message
In-Conversation Search
Search within a specific conversation:
Returns:
- Message index
- Role and timestamp
- Preview with context
- Match count per message
Session Export
Download conversation as markdown:
Response:
Conversation Analytics
Get detailed analytics for a conversation:
Returns:
- Message count and token usage
- Cost estimate (input/output/cache)
- Model usage breakdown
- Tool usage statistics
- Session timeline and duration
- Time breakdown (user vs. Claude)
- Components used (agents, commands, skills)
- Optimization tips
API Reference
GET /api/conversations
List all conversations:
GET /api/conversation-state
Get states for all conversations:lines/chats-mobile.js:146
GET /api/directories
Get unique working directories:lines/chats-mobile.js:182
POST /api/search
Advanced search:lines/chats-mobile.js:210
Request:
Response:
POST /api/conversations/:id/search
Search within conversation:lines/chats-mobile.js:312
Request:
Response:
Real-time Updates
WebSocket connection for live updates:lines/chats-mobile.js:976
Events:
new_message: New message added to conversation
data_refresh: Conversations reloaded
state_change: Conversation state changed
Change Detection
The monitor tracks:lines/chats-mobile.js:864
- Message count changes: New messages added
- Message updates: Tool results correlated
- Snapshots: Detects structural changes
Snapshot includes:
- Message ID
- Role
- Content length
- Tool result count
- Tool use presence
Architecture
Core Classes
ChatsMobile:line/chats-mobile.js:16
- Main server class
- Express app on port 9876
- WebSocket server integration
- File watching and change detection
ConversationAnalyzer:line/chats-mobile.js:32
- Loads conversation JSONL files
- Parses messages with tool correlation
- Caches parsed conversations
StateCalculator:line/chats-mobile.js:21
- Determines conversation states
- Uses message timestamps and activity
SessionSharing:line/chats-mobile.js:35
- Exports conversations as markdown
- Handles message formatting
- Includes tool results
Message Tracking
Message counts tracked per conversation:lines/chats-mobile.js:44
On change:lines/chats-mobile.js:881
- Compare previous count vs. current
- Generate snapshots for all messages
- Detect new messages (count increased)
- Detect updated messages (snapshot changed)
- Broadcast via WebSocket
Example: Export Conversation
Example: Search Across Projects
Troubleshooting
Port Already in Use
Chats Mobile uses port 9876. If occupied:line/chats-mobile.js:19
No Conversations Found
Check Claude directory exists:
Search Returns No Results
- Content search looks in message content AND tool results:line/chats-mobile.js:358
- Try searching for tool names or commands
- Check date range covers conversation dates
WebSocket Not Connecting
Verify WebSocket server initialized:lines/chats-mobile.js:1054
Cloudflare Tunnel Timeout
If tunnel URL not detected after 45 seconds:lines/chats-mobile.js:1154
- Pagination: Use
?page=0&limit=50 for large conversations:line/chats-mobile.js:434
- Specific searches: Combine filters to narrow results
- State polling: Use
/api/conversation-state for lightweight checks
- Export limits: Exports limited to prevent timeout
See Also