Skip to content

Repository files navigation

CC-sesh-master

Real-time monitoring dashboard for Claude Code sessions and processes.

Python License

What it does

Two views in one dashboard:

  • Process Monitor — Live tracking of Claude Code processes (RAM, CPU, lifecycle events, anomaly detection)
  • Session Viewer — Real-time conversation viewer for Claude Code sessions (messages, tool calls, token usage)

The dashboard reads Claude Code's native JSONL session files from ~/.claude/projects/ and displays them in a cyberpunk-themed web UI.

Quick Start

python3 serve-dashboard.py
# Open http://localhost:37778

With PM2 (recommended)

pm2 start serve-dashboard.py --name tracker-dashboard --interpreter python3
pm2 save

Features

Process Monitor

  • Live process count, memory usage, MCP server tracking
  • Event feed (spawn, exit, anomaly, state changes)
  • Memory timeline chart
  • Active process table with CPU/memory/state

Session Viewer

  • Browse 1000+ sessions across all projects
  • Filter by project, status (active/completed), date range, search
  • Real-time conversation view with auto-scroll
  • Collapsible tool call cards with input/output
  • "Show full" expansion for truncated content
  • Session stats (model, tokens, duration, tool usage)
  • 3-second polling for active sessions
  • Subagent visibility — see spawned subagents (task-agents, compact, prompt_suggestion) per session
  • Navigate into subagent conversations with back-to-parent navigation
  • Export any session or subagent conversation to Markdown
  • OpenClaw integration — auto-discovers sessions from ~/.openclaw/agents/*/sessions/ with full event parsing

Architecture

serve-dashboard.py    # Python HTTP server (port 37778)
  ├─ /                # Serves dashboard.html
  ├─ /api/tracker/*   # Process monitor endpoints
  └─ /api/sessions/*  # Session viewer endpoints

dashboard.html        # Single-file frontend (HTML + CSS + JS)
claude-tracker.sh     # Process lifecycle tracker (daemon/interactive)
analyze-session.sh    # Post-session analysis tool

API Endpoints

Endpoint Description
GET /api/tracker/status Current process status + recent events
GET /api/tracker/events Recent process events
GET /api/tracker/history Daily summary (7 days)
GET /api/sessions/list Filterable session list
GET /api/sessions/:id/events Session events (cursor-based)
GET /api/sessions/:id/stats Session statistics
GET /api/sessions/:id/subagents List subagents for a session
GET /api/sessions/:id/raw-event/:uuid Full untruncated event

Session List Params

project, status, search, date_from, date_to, sort, offset, limit

Event Pagination

Use after=<uuid> for cursor-based incremental updates. The server reads from the tail of large files (>512KB) for performance.

Data Sources

  • Session files: ~/.claude/projects/<project>/<sessionId>.jsonl
  • Subagent files: ~/.claude/projects/<project>/<sessionId>/subagents/*.jsonl
  • OpenClaw sessions: ~/.openclaw/agents/<agent>/sessions/<sessionId>.jsonl
  • Process events: logs/events_YYYYMMDD.jsonl (written by claude-tracker.sh)

Session Migration Notes

Session "migration" is not implemented in the dashboard today. If added later, it should be treated as two different classes of operation:

  • Native resume/fork: only available when the destination CLI can reopen its own session format.
  • Context clone: create a new session in another CLI using a generated transcript/bundle from the source session.

What is feasible today

  • Claude -> Claude (fork or move to another workspace): best-supported case. This only makes sense when the goal is to fork the conversation or continue it in another directory/workspace. Claude Code exposes native resume/fork flows (--resume, --continue, --fork-session), so a future "Migrate" button could offer a true clone/fork behavior here. If the user only wants to keep working in the same Claude session and same workspace, that is just resume, not migration.
  • Claude -> Codex
  • Claude -> Kimi
  • Codex -> Claude
  • Codex -> Kimi
  • Kimi -> Claude
  • Kimi -> Codex

The six cross-tool cases above should be treated as context cloning, not true native migration. The dashboard can already read and normalize these sessions for display, but each CLI persists different on-disk formats and session metadata, so directly copying session files between tools would be fragile.

Recommended future design

For cross-tool migration, generate a migration bundle containing:

  • source session metadata (source, cwd, model, timestamps)
  • full conversation transcript
  • cleaned tool calls and tool results
  • optional compact summary for long sessions

Then launch a new destination session in the same workspace and seed it with that bundle as initial context.

Out of scope for now

  • OpenClaw-specific migration: intentionally deferred. At the moment we do not treat OpenClaw as having a stable, first-class "resume this exact session in another tool" flow.
  • Direct raw file transplantation between Claude/Codex/Kimi session stores: not recommended.

Requirements

  • Python 3.8+
  • Claude Code installed (~/.claude/ directory)
  • No external Python dependencies

Process Tracker

The claude-tracker.sh script monitors Claude Code processes independently:

# Interactive mode (live terminal UI)
./claude-tracker.sh

# Daemon mode (background, writes event logs)
./claude-tracker.sh --daemon

# Status snapshot
./claude-tracker.sh --status

# Benchmark (4-hour stress test)
./claude-tracker.sh --benchmark

License

MIT

About

Real-time monitoring dashboard for Claude Code sessions and processes

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages