AgentTrail is a local web-based viewer for browsing Claude Code conversation history across multiple directories. Unlike Cloister (which only reads from ~/.claude), AgentTrail allows users to configure multiple session directories, making it ideal for users who work across different machines, projects, or have multiple Claude Code installations.
- Multi-directory support: Configure and view sessions from multiple directories
- Config-based setup: Persistent configuration stored in
~/.config/agenttrail/config.json - Directory-isolated session chaining: Sessions are only chained within the same directory
- Pins and custom tags: Mark important sessions and add custom tags through config
- Enhanced search: Quick search (titles only) and deep search (full message content)
- Settings modal: In-app configuration management
- Custom identity: Different branding, port (9847), and visual theme
| Technology | Purpose |
|---|---|
| Bun | JavaScript runtime and bundler |
| ElysiaJS | Web framework (replacing Hono from Cloister) |
| TypeScript | Type-safe development |
| Vanilla JS | Frontend (no framework, following Cloister pattern) |
| CSS | Custom styling with dark theme |
- Scan multiple configured directories for Claude Code sessions
- Each directory can have a custom label and color
- Sessions grouped by directory in the UI with collapsible sections
- Directory-specific session chaining (sessions only chain within same directory)
- Parse JSONL session files
- Display messages with proper formatting
- Render tool calls (Read, Edit, Write, Bash, etc.)
- Syntax highlighting for code blocks
- Markdown rendering for text content
- Thinking block display (collapsible)
- Idle: No recent activity
- Working: Claude is currently processing
- Awaiting: Claude is waiting for user input
- Real-time status updates via SSE (Server-Sent Events)
Built-in tag detection based on message content:
debugging- Bug fixes, error investigationfeature- New feature implementationrefactoring- Code restructuringgit- Version control operationstesting- Test-related workdocs- Documentation workconfig- Configuration changesapi- API developmentui- Frontend/UI work
Through the config file, users can:
- Pin important sessions (appear at top of list)
- Add custom tags to specific sessions
- Tags persist across restarts
- Quick Search: Filter by session title, project name, tags
- Deep Search: Full-text search through message content
- Toggle between quick and deep search modes
- Time-based: All, Today, This Week
- By tag (including custom tags)
- By directory
- By project
In-app settings management:
- Add/remove session directories
- Set directory labels and colors
- Manage pins
- View/edit config file path
- Real-time updates when session files change
- New messages appear automatically
- Status changes reflected immediately
~/.config/agenttrail/config.json
You can override the config location by setting AGENTTRAIL_CONFIG to a custom path. This is useful for testing or running multiple isolated instances.
interface AgentTrailConfig {
// Session directories to scan
directories: DirectoryConfig[];
// Pinned session IDs (appear at top)
pins: string[];
// Custom tags for specific sessions
customTags: {
[sessionId: string]: string[];
};
// Server settings
server: {
port: number; // Default: 9847
};
}
interface DirectoryConfig {
// Absolute path to the directory
path: string;
// Display label (e.g., "Work Laptop", "Personal")
label: string;
// Color for UI distinction (CSS color value)
color: string;
// Whether this directory is enabled
enabled: boolean;
}{
"directories": [
{
"path": "/home/user/.claude/projects",
"label": "Default",
"color": "#7c3aed",
"enabled": true
},
{
"path": "/mnt/backup/claude-sessions",
"label": "Backup",
"color": "#2563eb",
"enabled": true
}
],
"pins": [
"abc123-session-id",
"def456-session-id"
],
"customTags": {
"abc123-session-id": ["important", "review-later"]
},
"server": {
"port": 9847
}
}List all sessions from all enabled directories.
Response:
{
sessions: Session[];
}
interface Session {
id: string;
directory: string; // Source directory path
directoryLabel: string; // Directory display label
directoryColor: string; // Directory color
project: string; // Project path
projectName: string; // Project name (last segment)
title: string; // Auto-generated or user-set title
timestamp: string; // First message timestamp
lastModified: string; // File modification time
messageCount: number;
tags: string[]; // Auto + custom tags
status: "awaiting" | "working" | "idle";
filePath: string; // Full path to session file
isPinned: boolean;
chainId?: string;
chainIndex?: number;
chainLength?: number;
}Get session details with all messages.
Response:
{
session: SessionDetail;
}
interface SessionDetail extends Session {
messages: Message[];
}
interface Message {
id: string;
type: "user" | "assistant";
timestamp: string;
content: ContentBlock[];
}
interface ContentBlock {
type: "text" | "tool_use" | "tool_result" | "thinking";
text?: string;
name?: string;
id?: string;
tool_use_id?: string;
input?: Record<string, unknown>;
content?: string | ContentBlock[];
thinking?: string;
}SSE endpoint for real-time session updates.
Events:
message- New message addedstatus- Session status changedping- Keep-alive (every 30s)
List configured directories.
Response:
{
directories: DirectoryConfig[];
}List all projects across all directories.
Response:
{
projects: {
name: string;
path: string;
directory: string;
count: number;
}[];
}Get tag counts (auto + custom tags).
Response:
{
tags: {
[tagName: string]: number;
};
}Search sessions.
Query Parameters:
q- Search querymode-quick(titles only) ordeep(full content)
Response:
{
results: Session[];
mode: "quick" | "deep";
query: string;
}Get current configuration.
Response:
{
config: AgentTrailConfig;
configPath: string;
}Update configuration.
Request Body: AgentTrailConfig
Response:
{
success: boolean;
config: AgentTrailConfig;
}Pin a session.
Unpin a session.
Add custom tags to a session.
Request Body:
{
tags: string[];
}Remove a custom tag from a session.
- Logo and Branding - "AgentTrail" with custom icon
- Time Filters - All, Today, This Week
- Tags Section - Clickable tag filters with counts
- Directories Section - Color-coded directory filters (collapsible)
- Projects Section - Project list with session counts
- Settings Button - Opens settings modal
- Search Bar - With quick/deep toggle
- Session List - Cards grouped by directory
- Pinned sessions appear first
- Directory sections are collapsible
- Session chains are grouped
- Status indicators (working/awaiting)
- Back Button - Return to list
- Session Header - Title, metadata, status
- Messages - Scrollable message list
- User messages (blue theme)
- Assistant messages (purple theme)
- Tool cards (collapsible)
- Thinking blocks (expandable)
- Status Indicator - Floating indicator for awaiting/working states
-
Directories Tab
- List of configured directories
- Add new directory button
- Edit directory (path, label, color)
- Enable/disable toggle
- Remove directory
-
General Tab
- Port configuration
- Config file path (read-only)
# Start the server
agenttrail
# Start on custom port
agenttrail --port 8080
agenttrail -p 8080
# Run in daemon mode (background)
agenttrail --daemon
agenttrail -d
# Initialize config with default directory
agenttrail --init
# Show help
agenttrail --help
agenttrail -h
# Show version
agenttrail --version
agenttrail -vOn first run, if no config exists:
- Creates
~/.config/agenttrail/config.json - Adds
~/.claude/projectsas the default directory - Starts the server
agenttrail/
├── package.json
├── tsconfig.json
├── SPEC.md
├── src/
│ ├── index.ts # CLI entry point
│ ├── server.ts # ElysiaJS routes
│ ├── config.ts # Config management
│ ├── parser.ts # JSONL parsing
│ ├── sessions.ts # Session discovery
│ ├── tagger.ts # Auto-tagging logic
│ ├── watcher.ts # File watching
│ └── search.ts # Search implementation
└── public/
├── index.html # Main HTML
├── app.js # Frontend JavaScript
└── styles.css # Styling
- Background Primary:
#0d1117 - Background Secondary:
#161b22 - Background Tertiary:
#21262d - Border:
#30363d - Text Primary:
#e6edf3 - Text Secondary:
#8b949e - Accent (AgentTrail):
#10b981(Emerald green - distinguishes from Cloister's purple) - User Messages:
#2563eb(Blue) - Success:
#238636 - Warning:
#d29922 - Error:
#f85149
- Name: AgentTrail
- Icon: Trail/path icon with multiple connected dots
- Tagline: "Track your Claude conversations across directories"
# Clone and install
cd agenttrail
bun install
# Run in development mode (with hot reload)
bun run dev
# Build for distribution
bun run buildbun test
bun test tests/unit
bun test tests/api
bunx playwright install chromium
bunx playwright test