CLAUDE.md
Description
This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
Installation
This entry records only its repository, not the path inside it, so there is no
exact command to give. Open the source below and copy the folder into
~/.claude/skills/, or the file into ~/.claude/agents/.
README
CLAUDE.md
This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
Project Overview
Agent Viewer is a web-based kanban board for managing multiple Claude Code AI agents running in tmux sessions. It provides a central UI to spawn, monitor, message, and clean up concurrent Claude Code instances.
Commands
npm start # Start server at http://localhost:4200
HOST=0.0.0.0 PORT=3000 npm start # Bind to network on custom port
There is no build step, no test suite, and no linter configured. The app runs directly with Node.js.
Architecture
This is a two-file application with no frameworks or build tooling:
server.js— Express backend handling agent lifecycle, tmux integration, state detection, and SSE broadcastingpublic/index.html— Entire frontend (HTML/CSS/JS) in a single file with vanilla JavaScript
Backend Core Systems (server.js)
**Agent Registry**: In-memory object + `.agent-registry.json` persistence. Tracks agent label, project path, prompt, state, and timestamps. Auto-recovers on restart.
**State Detection** (`detectAgentState()`): Polls tmux pane output every 3 seconds. Classifies agents as `running`, `idle`, or `completed` by pattern-matching Claude Code's terminal UI signals — "esc to interrupt" means running; empty prompts and permission requests mean idle.
**Tmux Integration**: Spawns agents via `tmux new-session`, captures output via `tmux capture-pane -e -p`, sends messages via `tmux send-keys`. All external commands have timeouts (5-15s).
**Auto-Discovery**: Scans all tmux sessions, builds process trees to detect Claude descendants, and adds discovered sessions to the registry.
**LLM Label Generation**: Spawns a quick heuristic label immediately, then asynchronously calls Claude Haiku via CLI to generate a smarter label. Non-blocking — UI updates via SSE when the upgraded label arrives.
**SSE Endpoint** (`GET /api/events`): Broadcasts full agent state to all connected clients at `POLL_INTERVAL` (3s default).
Frontend (public/index.html)
Three-column kanban board (Running/Idle/Completed) with SSE-driven updates. Includes a full ANSI-to-HTML converter supporting 16/256/24-bit color. Drag-and-drop for cards and file uploads. Terminal-inspired dark aesthetic.
API Routes
| Method | Path | Purpose |
|---|---|---|
| GET | /api/agents |
List all agents with state |
| POST | /api/agents |
Spawn new agent |
| POST | /api/agents/:name/send |
Send message / respawn |
| POST | /api/agents/:name/upload |
Upload file to agent |
| DELETE | /api/agents/:name |
Kill agent session |
| DELETE | /api/agents/:name/cleanup |
Remove from registry |
| DELETE | /api/cleanup/completed |
Bulk cleanup completed |
| GET | /api/agents/:name/output |
Fetch terminal output |
| GET | /api/events |
SSE real-time updates |
Key Patterns
- Shell arguments are escaped with single-quote replacement (`me
Related Agents
Opencode
(60.8k ⭐) - The open source AI coding agent.
Data & AI Gemini CLI
(90.5k ⭐) - An open-source AI agent that brings the power of Gemini directly into your terminal.
Data & AI Chatgpt On Wechat
CowAgent是基于大模型的超级AI助理,能主动思考和任务规划、访问操作系统和外部资源、创造和执行Skills、拥有长期记忆并不断成长,比OpenClaw更轻量和便捷。同时支持微信、飞书、钉钉、企微、QQ、公众号、网页
Data & AI Claude Mem
(13.1k ⭐) - A Claude Code plugin that automatically captures everything Claude does during your coding session
Data & AI Read research for Nyquist validation data
cat "$phase_dir"/*-RESEARCH.md 2>/dev/null node "$HOME/.claude/get-shit-done/bin/gsd-tools.cjs" roadmap get-ph
Data & AI Multi Agent Review
| A sophisticated AI-powered code review system designed to provide comprehensive, multi-perspective a... | -
Data & AI