A beautiful web-based dashboard for monitoring and managing Claude Code sessions in real-time.
Claude Session Manager provides a modern web interface to monitor all your active Claude Code sessions, track token usage, and manage multiple projects simultaneously. It reads session data directly from Claude's local file system and presents it through an intuitive web dashboard accessible from any browser.
- π Web-Based Dashboard: Access from any browser on your network
- π Real-time Monitoring: Live updates via WebSocket connections
- π Interactive Charts: Beautiful visualizations for token usage and costs
- π― Multi-Project Support: Manage sessions across different projects and git worktrees
- π° Cost Tracking: Monitor token usage and estimated costs
- π¨ Modern UI: Responsive design with dark/light themes
- β‘ High Performance: Built with Go backend and React frontend
- π± Mobile Friendly: Fully responsive for desktop and mobile viewing
- π³ Docker Support: Easy deployment with Docker container
- Claude Code installed with sessions in
~/.claude/ - Docker (for containerized deployment) OR
- Go 1.21+ and Node.js 18+ (for manual installation)
# Pull and run the Docker image
docker run -p 80:80 -v ~/.claude:/data/claude ksred/claude-session-manager
# Access the dashboard
open http://localhostThe container will:
- Mount your
~/.claudedirectory to/data/claudeinside the container - Create a SQLite database at
~/.claude/sessions.dbfor session management - Serve the web interface on port 80
If your Claude sessions are stored in a different location, use the CLAUDE_DIR environment variable:
# Custom Claude directory
docker run -p 80:80 \
-e CLAUDE_DIR=/custom/claude/path \
-v /your/custom/claude/dir:/custom/claude/path \
ksred/claude-session-manager# Clone the repository
git clone https://github.com/ksred/claude-session-manager.git
cd claude-session-manager
# Start with Docker Compose
docker-compose up -d
# Open in browser
open http://localhost:8080# Clone the repository
git clone https://github.com/ksred/claude-session-manager.git
cd claude-session-manager
# Backend setup
cd backend
go mod download
go build -o claude-session-manager ./cmd/main.go
# Frontend setup
cd ../frontend
npm install
npm run build
# Run the backend server
cd ../backend
./claude-session-manager serveBackend:
- Language: Go (high-performance server)
- Web Framework: Gin
- Database: SQLite for caching and persistence
- WebSocket: Gorilla WebSocket for real-time updates
- Data Source: Claude Code filesystem (
~/.claude/) - API Documentation: Swagger/OpenAPI with swaggo
Frontend:
- Framework: React with TypeScript
- Build Tool: Vite
- Styling: Tailwind CSS
- Charts: Chart.js/Recharts
- State Management: Zustand
- Real-time: WebSocket integration
claude-session-manager/
βββ backend/ # Go backend server
β βββ cmd/ # Application entry points
β β βββ main.go
β βββ internal/
β β βββ api/ # HTTP/WebSocket handlers
β β βββ claude/ # Claude session parsing
β β βββ config/ # Configuration management
β βββ pkg/ # Shared packages
β βββ Dockerfile
β βββ go.mod
βββ frontend/ # React frontend
β βββ src/
β β βββ components/ # React components
β β βββ hooks/ # Custom React hooks
β β βββ services/ # API services
β β βββ store/ # State management
β β βββ styles/ # Global styles
β β βββ App.tsx
β βββ public/
β βββ Dockerfile
β βββ package.json
β βββ vite.config.ts
βββ docker-compose.yml # Docker orchestration
βββ README.md # This file
The application can be configured through environment variables or a YAML configuration file.
# Server configuration
PORT=8080
HOST=0.0.0.0
# Claude directory (defaults to ~/.claude)
CLAUDE_DIR=~/.claude
# Optional: Override database location (defaults to $CLAUDE_DIR/sessions.db)
DATABASE_PATH=/path/to/custom/sessions.dbCreate a configuration file at configs/default.yaml:
server:
host: "0.0.0.0"
port: 8080
cors_origins:
- "http://localhost:3000"
- "http://localhost:5173"
claude:
home_dir: "~/.claude"
watch_interval: 2s
db_path: "./claude_sessions.db"
pricing:
models:
claude-3-opus-20240229:
input_cost_per_1k: 0.015
output_cost_per_1k: 0.075
claude-3-5-sonnet-20241022:
input_cost_per_1k: 0.003
output_cost_per_1k: 0.015cd backend
go mod download
go run ./cmd/main.go serve --devcd frontend
npm install
npm run dev# Backend tests
cd backend
go test ./...
# Frontend tests
cd frontend
npm testThe backend provides a comprehensive RESTful API with Swagger documentation:
When the server is running, access the interactive Swagger UI at:
http://localhost:8080/docs/
Sessions
GET /api/v1/sessions- List all sessionsGET /api/v1/sessions/{id}- Get session by IDGET /api/v1/sessions/active- Get active sessionsGET /api/v1/sessions/recent- Get recent sessions with optional limit
Analytics
GET /api/v1/metrics/summary- Get overall metrics summaryGET /api/v1/metrics/activity- Get activity timelineGET /api/v1/metrics/usage- Get usage statistics
Search & Files
GET /api/v1/search- Search sessions by queryGET /api/v1/recent-files- Get recently accessed files
Real-time Updates
GET /api/v1/ws- WebSocket endpoint for real-time session updates
Health
GET /api/v1/health- Health check endpoint
- Chrome/Edge 90+
- Firefox 88+
- Safari 14+
- Mobile browsers (iOS Safari, Chrome Mobile)
Contributions are welcome! Please feel free to submit a Pull Request.
- Permission Denied: Ensure the Docker container has read access to
~/.claude - Port Already in Use: Change the port mapping in the docker run command
- No Sessions Showing: Verify Claude Code sessions exist in
~/.claude/sessions/
View Docker container logs:
docker logs <container-id>MIT License - see LICENSE file for details
Built for the Claude Code community to enhance session management and monitoring.
