Skip to content

correasebastian/egghead--claude-helpers

Repository files navigation

Claude Helpers

Interactive CLI and Web Dashboard for managing Claude Code sessions.

Features

  • Web Dashboard - Visual interface for browsing sessions at http://localhost:3000
  • Semantic Search - AI-powered search across session history (with semtools)
  • Text Search - Keyword-based search (no dependencies)
  • Session Management - Browse, resume, and explore past conversations
  • Agent Launcher - Quick access to predefined Claude agents

Quick Start

# Install dependencies
bun install

# Start the web dashboard
bun run ui
# Open http://localhost:3000

# Or use the CLI
bun run dev

Web Dashboard

The dashboard provides a visual interface for exploring Claude Code sessions:

bun run ui
# Opens at http://localhost:3000

Pages

Page URL Description
Sessions / List and filter all sessions
Search /search Full-text search with filters
Stats /stats Usage statistics and charts
Agents /agents View available agents
Timeline /timeline Chronological session view

Search Features

  • Filter by project - Dropdown with all projects
  • Filter by date - 7 days, 30 days, 90 days, year, all time
  • Filter by message type - User only, assistant only, or both
  • Highlighted results - Matched terms highlighted in yellow
  • In-session search - Search within a conversation with match navigation

Screenshots

The dashboard shows:

  • Session list with project badges and message counts
  • Full conversation view with code block formatting
  • Search results with relevance scores
  • Activity charts and project statistics

CLI Commands

ch                    # Interactive menu
ch search <query>     # Search across sessions
ch sessions           # List recent sessions
ch resume [id|query]  # Resume a session
ch agent <name>       # Launch with agent
ch agents             # List available agents
ch ui                 # Start web dashboard

Architecture

src/
├── ui/
│   ├── server.ts    # Hono web server + API routes
│   └── app.tsx      # React SPA (Tailwind + dark theme)
├── search.ts        # Text search + semantic search fallback
├── sessions.ts      # Session loading from ~/.claude/projects/
├── agents.ts        # Predefined agent definitions
├── types.ts         # TypeScript interfaces
└── ui.ts            # Terminal UI formatting

docs/
└── WEB-DASHBOARD.md # Detailed dashboard documentation

index.ts             # CLI entry point

API Endpoints

Endpoint Description
GET /api/sessions List sessions (params: limit, days, project)
GET /api/sessions/:id Get session by ID
GET /api/sessions/:id/messages Get session messages
GET /api/search Search sessions (params: q, days, topK, project, searchType)
GET /api/stats Dashboard statistics
GET /api/agents List available agents
GET /api/health Health check

Search API Example

# Text search
curl "http://localhost:3000/api/search?q=react+hooks&days=30"

# Filter by project and message type
curl "http://localhost:3000/api/search?q=bug&project=myapp&searchType=user"

Response:

{
  "results": [
    {
      "session": { "id": "...", "project": "myapp", ... },
      "matchedContent": "...highlighted snippet...",
      "score": 0.85,
      "messageType": "user"
    }
  ],
  "method": "text",
  "query": "bug"
}

Dependencies

Required

  • hono - Web framework
  • @inquirer/prompts - Interactive CLI prompts
  • chalk - Terminal colors
  • ora - Spinners
  • glob - File pattern matching

Optional

For semantic (AI-powered) search:

bun add --global @llamaindex/semtools

This enables embedding-based search when filtering by "User Only" messages.

Data Location

Sessions are stored by Claude Code at:

~/.claude/projects/{encoded-project-path}/{session-id}.jsonl

Each JSONL file contains conversation entries with type, message, and timestamp.

Development

# Run CLI in dev mode
bun run dev

# Run web dashboard
bun run ui

# Type check
bun run tsc --noEmit

# Link as global command
bun link

Bun Guidelines

This project uses Bun as the runtime:

  • Use bun <file> instead of node
  • Use bun test for testing
  • Use bun install for dependencies
  • Prefer Bun.file over node:fs
  • Use Bun.$ for shell commands
  • Bun automatically loads .env files

Documentation

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors