Real-time augmentation dashboard for PAI — session tracking, system inventory, agent spawns, tool calls, machine health, and maturity scoring.
A single-page dashboard at http://localhost:8895 showing:
- Live Session — current session detection, elapsed time, recent events, tool call breakdown
- Session History — past sessions with duration, message count, task description, effort level
- System Inventory — skills count, hooks count, LaunchAgents, dashboards, memory files
- Tool Call Analytics — aggregated tool usage across sessions (Read, Write, Bash, Agent, etc.)
- Agent Spawn Tracking — which agent types are spawned, when, and how often
- Machine Health — CPU, memory, disk, battery, uptime, recommendations
- PAIMM Score — PAI Maturity Model scoring across 6 dimensions
- Session Intent / Project Tracking — maps sessions to projects by keyword matching
- Next Actions — AI-suggested maintenance tasks based on system state
- Runtime: Bun (TypeScript)
- Database: SQLite (WAL mode) for session and event storage
- Frontend: Single inline HTML page with Tailwind CSS + ApexCharts
- Architecture: Single-file server (~2,100 lines) — all backend + frontend in one file
- Bun installed (
curl -fsSL https://bun.sh/install | bash) - PAI directory structure at
~/.claude/
# Clone the repo
git clone https://github.com/RubyWolff27/pai-control-tower.git
cd pai-control-tower
# Copy source files to your PAI Tools directory
cp src/ControlTower.ts ~/.claude/Tools/ControlTower.ts
cp src/ct-types.ts ~/.claude/Tools/ct-types.ts
# Copy the dashboard frontend (server loads this at runtime)
mkdir -p ~/.claude/Tools/public
cp src/public/control-tower.html ~/.claude/Tools/public/control-tower.html
# Create the database directory
mkdir -p ~/.claude/data
# Test run
bun ~/.claude/Tools/ControlTower.ts
# → Open http://localhost:8895# Copy the plist
cp setup/ai.pai.control-tower.plist ~/Library/LaunchAgents/
# Edit the plist to match your paths (replace YOUR_USERNAME)
sed -i '' "s|YOUR_USERNAME|$(whoami)|g" ~/Library/LaunchAgents/ai.pai.control-tower.plist
# Load it
launchctl load ~/Library/LaunchAgents/ai.pai.control-tower.plist
# Verify
curl -s http://localhost:8895 | head -1Edit the projectKeywords object in ControlTower.ts (~line 1741) to match your projects:
const projectKeywords: Record<string, string[]> = {
"My Web App": ["webapp", "react", "frontend", "api"],
"Infrastructure": ["deploy", "ci", "docker", "kubernetes"],
"Research": ["research", "paper", "analysis"],
// Add your own...
};Edit the dimensions array (~line 1193) to reflect your PAI's capabilities:
const dimensions = [
{ name: "Context", score: 50, detail: "Your context description" },
{ name: "Personality", score: 30, detail: "Your DA personality status" },
{ name: "Tool Use", score: 60, detail: "Skills, hooks, integrations" },
// ...
];Change const PORT = 8895; at the top of the file.
Set const INCEPTION_DATE = new Date("YYYY-MM-DD"); to when you started your PAI.
The dashboard scans ~/.claude/projects/ for Claude Code session transcript directories. It parses JSONL transcripts to extract:
- Session start/end times
- Tool calls (Read, Write, Bash, Agent, Skill, etc.)
- Agent spawns (type, timestamp)
- Task descriptions (from the conversation)
- Message counts
SQLite at ~/.claude/data/control-tower.db:
sessions— one row per Claude Code sessiontool_calls— aggregated tool usage per sessionagent_spawns— agent spawn eventsskill_invocations— skill usage tracking
Scans the filesystem for:
~/.claude/skills/**/SKILL.md— skill count~/.claude/hooks/*.ts— hook count~/Library/LaunchAgents/ai.pai.*— LaunchAgent count~/.claude/MEMORY/— memory file count and staleness
Uses macOS system commands:
sysctlfor CPU/memorydffor diskioregfor batterypsfor top processes
The dashboard uses a dark cockpit aesthetic with:
- Glass-morphism cards
- Emerald/blue accent colors
- ApexCharts for session timelines and tool usage
- Responsive grid layout
- macOS (LaunchAgent support,
sysctl/ioregfor health metrics) - Bun 1.0+
- Claude Code installed (for session transcript parsing)
- PAI directory structure (
~/.claude/skills/,~/.claude/hooks/, etc.)
MIT — use it, modify it, make it yours.