ai-agent-session-center
AGENTS.md83 starsChanged 4 months agoMITView on GitHub
This file is the durable coding-agent entrypoint for this repository. It is based on CLAUDE.md; read CLAUDE.md for the full architecture notes and keep the two files aligned when project guidance changes. AI Agent Session Center is a localhost dashboard on port 3333 for monitoring AI coding agent sessions from Claude Code, Codex, and related tools. It uses hooks to ingest session events, visualizes sessions as 3D robots, supports SSH terminals, team/subagent tracking, prompt queuing, workspace snapshots, and session resume.
Where files are headingNew AGENTS.md files have more rules about keeping secrets out of the code, and fewer about checking a change actually works.
Of the AGENTS.md files we read, the 11,773 first seen in the last six months, against the older ones: the kind of rule that gained most share, and the kind that lost most. About files like this in general, not this one, and an estimate, since a kind is a pattern in the words.
In this repository3 other files it gives its agents.
- CLAUDE.mdCLAUDE.md
- electron-buildSkill
- electron-releaseSkill
The file
Show its rules and text
We split this AGENTS.md into the rules it gives an agent
18 rules. About 0 are common, 12 are distinctive, and 6 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈12
Distinctive · estimate
This author's own choices. Worth a look.
6
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 47
Use the smallest verification command that fits the change.
- Very specific: line 56
All feature logic is documented under docs/feature/.
- Distinctive: line 59
Read CLAUDE.md to identify the affected feature domain.
- Very specific: line 60
Read the corresponding doc(s) in docs/feature/.
- Distinctive: line 61
Check the impact matrix in CLAUDE.md for connected features.
- Distinctive: line 62
Read connected feature docs before changing shared behavior.
- Very specific: line 63
After the code change, use $update-feature-docs to update every affected feature doc.
- Distinctive: line 158
Treat changes here as cross-cutting:
- Distinctive: line 177
Check connected docs and tests when touching these contracts:
- Distinctive: line 216
Never mutate session objects in place.
- Distinctive: line 217
Never use Zustand directly inside React Three Fiber Canvas code.
- Distinctive: line 223
Never block the hook script.
- Distinctive: line 224
Never hardcode port 3333; read from config, env, or CLI flags.
- Very specific: line 225
Never modify ~/.claude/settings.json without an atomic temp-write and rename.
- Very specific: line 245
Put test and debug screenshots in test-screenshots/ or /tmp.
- Distinctive: line 250
Follow existing local patterns before adding abstractions.
- Distinctive: line 251
Keep behavior changes narrow and update docs when user-facing features, backend endpoints, UI components, shortcuts, or architecture …
- Distinctive: line 254
Use structured parsers and existing helpers instead of ad hoc string handling when the project already has a suitable utility.
≈ “Common” is an estimate: at least 1 in 5 of the 16,595 AGENTS.md files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
AI Agent Session Center: Agent Guidance
This file is the durable coding-agent entrypoint for this repository. It is
based on CLAUDE.md; read CLAUDE.md for the full architecture notes and keep
the two files aligned when project guidance changes.
Project Snapshot
AI Agent Session Center is a localhost dashboard on port 3333 for monitoring AI coding agent sessions from Claude Code, Codex, and related tools. It uses hooks to ingest session events, visualizes sessions as 3D robots, supports SSH terminals, team/subagent tracking, prompt queuing, workspace snapshots, and session resume.
Core stack:
- Backend: Node.js 18+, ESM, Express 5, ws 8, tsx
- Frontend: React 19, Three.js /
@react-three/fiber, Zustand 5, Vite 7 - Desktop: Electron 34, electron-builder 25
- Terminal:
node-ptythrough Electron IPC, WebSocket fallback in browser - Hooks: Bash hook script with JSONL file queue and HTTP POST fallback
- Persistence: SQLite /
better-sqlite3on the server, IndexedDB / Dexie in the browser
Common Commands
npm run dev # Vite + tsx watch
npm run build # Production build
npm start # Start production server
npm test # Vitest
npm run test:e2e # Playwright E2E
npm run test:coverage # Coverage report
npm run typecheck # tsc --noEmit (src/ only)
npm run typecheck:server # tsc --noEmit -p tsconfig.server.json (server/ + src/types)
npm run typecheck:all # both, in sequence
npm run lint # ESLint src/
npm run format # Prettier
npm run electron:dev # Build and launch Electron app
npm run electron:build # Build distributables
npm run install-hooks # Install CLI hooks
npm run uninstall-hooks # Remove dashboard hooks
npm run setup # Interactive setup wizard
npm run reset # Remove hooks, clean config, backupUse the smallest verification command that fits the change. For shared contracts,
state shape, server routes, Electron IPC, terminal behavior, or feature-doc work,
prefer at least npm run typecheck:all (plain typecheck only covers src/ —
server/ has its own tsconfig.server.json and nothing runs it automatically,
so a server-only change checked with plain typecheck can still ship a type
error) plus any targeted tests that cover the touched area.
Feature Documentation Workflow
All feature logic is documented under docs/feature/. Before implementing a new
feature or modifying an existing one:
- Read
CLAUDE.mdto identify the affected feature domain. - Read the corresponding doc(s) in
docs/feature/. - Check the impact matrix in
CLAUDE.mdfor connected features. - Read connected feature docs before changing shared behavior.
- After the code change, use
$update-feature-docsto update every affected feature doc.
docs/feature/.manifest.json is machine-readable source of truth for file to
doc mappings, symbols, and last-aligned timestamps. Do not hand-edit it. If it
drifts, run $align-existing-feature-docs; request a manifest rebuild when the
manifest itself is corrupted.
Feature-doc domains:
docs/feature/server/: hooks, sessions, matching, approvals, WebSocket, API, database, terminal/SSH, teams, process monitoring, auth, file index cache, floating session spawning, and plan usage (the CLIs' 5-hour/weekly limits)docs/feature/frontend/: Zustand state, persistence, WebSocket client, session detail, conversation/file/terminal/queue/review views, settings, shortcuts, command autocomplete, workspace snapshots, setup, auth UI, project browser, floating terminals, creation modals, file-open chooser, and UI primitivesdocs/feature/3d/: cyberdrome scene, robot system, particles/effectsdocs/feature/multimedia/: sound/alarm and TTS voice outputdocs/feature/electron/: app lifecycle, PTY host, and IPC transport
Architecture Notes
Event flow:
AI CLI
-> hooks/dashboard-hook.sh
-> /tmp/claude-session-center/queue.jsonl
-> server/mqReader.ts
-> server/hookProcessor.ts
-> server/sessionStore.ts
-> server/wsManager.ts
-> browser Zustand stores and React renderImportant server areas:
server/index.ts: orchestration and startupserver/apiRouter.ts: REST API surfaceserver/mqReader.ts,server/hookProcessor.ts,server/hookRouter.ts: hook ingestion and routingserver/fileIndexCache.ts,server/commandIndex.ts: cached file and slash-command indexesserver/sessionStore.tsand helpers: session state, matching, titles, approvals, teams, liveness, and auto-idleserver/wsManager.ts: WebSocket broadcast and terminal relayserver/sshManager.ts: SSH/PTY terminal managementserver/db.ts: SQLite storageserver/authManager.ts: password auth and tokensserver/floatingSessionSpawner.ts,server/floatingPrompt.ts,server/extractPreviousAnswer.ts: floating/forked session supportserver/planUsageCodec.ts,planUsageSources.ts,planUsageService.ts: each CLI's plan limits, read from Codex rollouts and the Claude status-line tap (hooks/dashboard-statusline.sh) and attached assession.planUsageto every live session of that CLI (seedocs/feature/server/plan-usage.md)server/resourceRouter.ts,resourceCatalog.ts,resourceScanner.ts,resourceAdapters.ts,resourceRoots.ts,resourceMask.ts,fsSafe.ts: the read-only/api/resourcescatalog of Claude Code / Codex resources (seedocs/feature/server/agent-resources.md)
Important frontend areas:
src/stores/: Zustand state stores for session, settings, queue, room, camera, UI, WebSocket, agenda, shortcuts, and floating sessionssrc/hooks/: WebSocket, terminal, sound, auth, shortcuts, settings init, workspace auto-save/load, queue scheduler, selection popup, and outside-click behaviorsrc/lib/: client transport, IndexedDB, audio, workspace snapshots, CLI detection, scene utilities, file system provider, formatting, shortcuts, transcript, queue scheduling, history export, command suggestions, command shortcuts (Shortcut for /xaliases), and TTSsrc/components/3d/: scene, robots, labels, particles, camera, overlays, and 3D state displaysrc/components/session/: detail panel, tabs, conversation, project/file browser, floating panels, queue/history, notes, summaries, linkified text, dialogs, TeX/image viewerssrc/components/terminal/: terminal container, toolbar, themessrc/components/settings/,src/components/modals/,src/components/layout/,src/components/agenda/,src/components/auth/,src/components/setup/,src/components/ui/: domain UI and shared primitivessrc/routes/: live, history, project browser, queue, agenda, review, and resources views (src/components/resources/,src/lib/resourceFilters.ts,src/lib/resourcesApi.ts; seedocs/feature/frontend/resources-tab.md)
Electron uses electron/main.ts for app lifecycle and windows,
electron/preload.ts for the context bridge, electron/ptyHost.ts for the
Node PTY host with ring buffer replay, and electron/ipc/ for IPC handlers.
Terminal transport is IPC in Electron and WebSocket in browser; renderer code
detects Electron through window.electronAPI?.createPty.
Session State Machine
Session state drives the 3D robots, sounds, approvals, auto-idle, and session UI. Treat changes here as cross-cutting:
SessionStart -> idle (idle animation)
UserPromptSubmit -> prompting (walking/wave, seeks desk)
PreToolUse -> working (running, tool-specific animation)
PostToolUse -> working (stays working)
[timeout] -> approval (waiting for tool approval)
[timeout] -> input (waiting for user answer)
PermissionRequest -> approval (reliable signal, overrides heuristic)
Notification(permission_prompt) -> approval (backstop while a tool call is open;
no approval timer in bypassPermissions/dontAsk modes)
Stop -> waiting (thumbs up / dance)
[5 min waiting] -> idle (announced; approval/input 10 min and working 15 min decays stay silent)
SessionEnd -> ended (death animation, kept in memory)High-Risk Change Areas
Check connected docs and tests when touching these contracts:
- Hook script or MQ format affects session matching, management, and hook stats.
- Session state changes affect robots, sound/alarms, approvals, auto-idle, and frontend stores.
- Session matching affects terminal/SSH, session resume, team linking, and external-session discovery.
- WebSocket messages affect the WS client, terminal UI, and real-time UI.
- API contracts affect frontend HTTP calls and Electron PTY registration.
- DB schema affects API endpoints and IndexedDB mirroring.
- Terminal/SSH behavior affects session matching and PTY registration.
- Zustand store shape changes affect all subscribing components.
- Theme CSS variables affect 2D UI, 3D UI, and terminal themes.
- The 3D scene style (
sceneStyle,dioramaGeometry/dioramaLighting/dioramaProps,colorMath,GroundMarkings,Plants,sessionRobotMemo) affects the cyberdrome scene, robot system, particle/effect docs, the settings doc, and theSceneOverlayHUD; the paint tone (clayToneFor: robot clay, livery, floor marks) follows the palette's furniture brightness and is judged by CIELABdeltaEin a render. - The 3D-off LIVE page (
liveBoard/liveHint,wsStore.snapshotReceived,uiStore.liveHintDismissed) affects views/routing, the NavBar (LIVE tab dot,data-live-tab) and the WS client; its empty state waits for the first snapshot. - Electron IPC channel changes affect preload and terminal transport.
- Queue scheduler or
queueHistoryStorechanges affect prompt queue, loops, per-session automation, and client persistence. - Command or file indexes affect command autocomplete, queue editors, project browsing, and file picking.
- Transcript reconstruction affects conversation view and review tab.
- Floating session spawn/fork changes affect floating terminal fork, review tab, pop-out windows, and session matching.
- Shared UI primitives affect settings, modals, panels, and any consumer.
- TTS or Google Cloud API-key work must keep per-user API keys client-side and forwarded per request. Do not reintroduce ambient credentials such as gcloud ADC or service-account files.
Key Invariants
The detail and traps behind these, and behind the one-line invariants in
CLAUDE.md, live in the owning feature doc's ## Invariants & Traps section.
- Never mutate session objects in place; create new objects and Maps.
- Never use Zustand directly inside React Three Fiber Canvas code; pass data from DOM layers through props to avoid React Error #185.
- The 3D scene has two looks (
sceneStyle) over one set of components: share geometry and materials per style, never per robot, and add any newSessionRobotprop tosessionRobotMemoor it is silently ignored; seedocs/feature/3d/cyberdrome-scene.md#scene-styles-diorama--cyberdrome. - Never block the hook script; background processing with a detached subshell.
- Never hardcode port 3333; read from config, env, or CLI flags.
- Never modify
~/.claude/settings.jsonwithout an atomic temp-write and rename. - Server imports use
.jsextensions for NodeNext module resolution with tsx. - File browser path access must go through
resolveProjectPath(). - External sessions must be traced rather than dropped. Never persist
process-discovered
external-<pid>cards in workspace snapshots, and keep the recurring external-process scan asynchronous. - SSH inputs must stay validated with Zod and shell-metacharacter checks.
/api/resourcesis read-only and loopback-only: it 404s unless the socket AND the Host header are loopback (DNS rebinding), config values leave only throughresourceMask, and every served text is redacted. The RESOURCES nav tab shows only on devices presence marksisLocal.- Floating overlays must stay inside the viewport. Reuse the existing flip/nudge/clamp helpers and render-check narrow layouts.
- Auto-idle announces only
prompting -> waitingandwaiting -> idle. The safety-net decays (approval/input 10 min, working 15 min) stay silent: the queue treatsidleas sendable, so announcing a pending approval as idle would type into the permission dialog. - On touch, a tap resolves after
:hoverhas reflowed the row. A control inside a hover-reveal row (the queue's unfold toggle) must not move, be clipped or slide down, or the tap lands on a neighbour (it once deleted a prompt); seedocs/feature/frontend/prompt-queue.md#where-the-toggle-sits-in-a-list-row. - Put test and debug screenshots in
test-screenshots/or/tmp; only shipping images belong instatic/.
Editing Expectations
- Follow existing local patterns before adding abstractions.
- Keep behavior changes narrow and update docs when user-facing features, backend endpoints, UI components, shortcuts, or architecture patterns change.
- Preserve unrelated worktree changes; inspect current diffs before editing.
- Use structured parsers and existing helpers instead of ad hoc string handling when the project already has a suitable utility.
- For frontend changes, verify the rendered app when feasible, especially for 3D, Electron, terminal, or responsive layout work.
<claude-mem-context>
# Memory Context[agent-manager] recent context, 2026-08-07 11:04pm GMT+12
Legend: 🎯session 🔴bugfix 🟣feature 🔄refactor ✅change 🔵discovery ⚖️decision Format: ID TIME TYPE TITLE Fetch details: get_observations([IDs]) | Search: mem-search skill
Stats: 50 obs (19,002t read) | 1,803,530t work | 99% savings
Jul 30, 2026
S1846 agent-manager Electron Distributable Built — v2.10.40 (Jul 30 at 1:17 PM) S1882 agent-manager Electron Build Status Check — Is the build done? (Jul 30 at 2:31 PM) S1891 macOS WindowServer High CPU Usage — Root Cause Investigation on Apple M4 Mac (Jul 30 at 8:21 PM) S1904 User sent "of" — ambiguous/incomplete message, no actionable request (Jul 30 at 8:48 PM)
Jul 31, 2026
S1906 Interruption Detection Daemon Feature Requested for Queue System (Jul 31 at 4:31 AM) S1910 Interrupt Detection Daemon Proposed for Agent Queue System (Jul 31 at 9:55 AM) S1914 Kokoro TTS Worker Fully Functional — UI Click Path Is the Bug, Not the Worker (Jul 31 at 11:44 AM) S1918 agent-manager v2.10.40 — Built and Packaged with interruptionDetector, crashLogger, and Session Name Quoting Fix (Jul 31 at 12:07 PM) S1919 Local TTS Feature — WebGPU vs WASM performance investigation and review-first plan for on-device text-to-speech (Jul 31 at 2:58 PM)
Aug 1, 2026
13647 12:01p 🔴 TexViewer Font Override Fix for Windows XP Theme 13648 " 🟣 Windows XP Theme Added to agent-manager UI via URL Query Param 13649 12:02p 🔵 Windows XP Theme Renders Without Console Errors; Settings Button Functional 13650 12:04p 🔵 Windows XP Theme — Full Theme Swatch List + Settings Panel Visual Verified 13651 " 🔴 Windows XP 3D Theme — Lighting Overexposure Fix for Bliss Grass Colors 13652 12:05p 🔵 Windows XP Theme Verified via Playwright Screenshot After Color Fix 13653 12:06p 🟣 Windows XP Theme — CSS Font Stack Verified via Playwright 13654 " 🟣 Windows XP Theme — New UI Theme Requested via Screenshot Reference 13655 12:07p 🟣 Windows XP Theme Added to agent-manager 13656 " 🔵 Windows XP Theme Files — Feature Doc Mapping Audit 13657 12:08p 🟣 Windows XP Theme — New UI Theme Requested via Screenshot Reference 13658 " 🟣 Windows XP Theme Added to agent-manager — Luna Palette + Font + Chrome Override 13659 12:09p 🟣 Windows XP Style Theme — Addition Requested via Image Reference 13660 12:10p 🟣 Windows XP (Luna) Theme Added to agent-manager 13661 " 🟣 Windows XP Theme Added — Font Override Architecture for TexViewer Compatibility 13662 12:13p 🟣 Windows XP Theme Request Initiated — Agent Manager UI 13663 12:14p 🔵 agent-manager — Hardcoded #0a0a1a Dark Backgrounds Pre-Date Theme Application 13664 " ✅ agent-manager Default Theme Changed from command-center to windows-xp 13665 12:15p 🔴 Flash-of-Dark-Content Fixed — Pre-Theme Paint Sites Updated for Windows XP Default 13666 12:16p 🟣 Windows XP Theme — Build Verification + First-Run Harness Mode 13667 12:17p 🔵 Windows XP Theme — Runtime CSS Variables and Font Verified via Playwright 13668 12:18p 🟣 Windows XP Theme Addition — New UI theme styled after Windows XP added to agent-manager 13669 12:20p 🟣 Windows XP Theme Addition — New UI theme styled after Windows XP added to agent-manager 13670 12:22p 🟣 Windows XP Theme Addition — New UI theme styled after Windows XP added to agent-manager 13671 12:24p 🔵 agent-manager Feature Doc Manifest — index.html Has No Mapped Feature Doc 13672 12:26p 🟣 Windows XP Theme Addition — User Request to Add XP-Style UI Theme 13673 12:29p 🟣 Windows XP Theme Addition — Final Verification Results 13674 12:30p 🔵 firstRunFlow.test.tsx — Two Flaky Tests Timing Out After XP Theme Addition 13675 12:31p 🟣 Windows XP Theme Addition — New UI theme styled after Windows XP added to agent-manager 13676 12:32p 🔵 XP Theme WIP Stashed — Regression Tests Verified Before Re-Apply 13677 12:36p 🟣 Windows XP Theme Addition — New UI theme styled after Windows XP added to agent-manager 13678 12:41p 🔵 agent-manager Z-Index Layer Map — Queue Move Picker Investigation 13679 " 🔵 Queue Items Not Rendering in Harness — IndexedDB Seed Version Mismatch 13680 12:42p 🔵 Queue Panel Toggle Behavior in Harness — Zero-Width Textareas After Expand 13681 12:43p 🔵 Queue ADD Button Fails in Static Harness — API Write Blocked by Stub 13682 12:46p 🔵 Queue Move Action Root Cause — z-index 50 Buried Behind Detail Panel at 100 13683 " 🔴 Queue Move Picker z-index Fixed from 50 → 10050 — MOVE Action Now Works 13684 12:47p ✅ Queue Move Picker Fix Verified in Production Build 13685 12:51p ✅ Post-Fix Full Verification — Typecheck Clean, Tests 1541/1548 Pass 13686 12:52p 🔴 Queue MOVE Picker Fix Committed — dd20c77 13687 12:57p ✅ update-feature-docs Skill Invoked After Windows XP Theme Addition 13688 " 🔵 update-feature-docs Audit — File-to-Doc Mapping with 3 Unmapped Files 13690 12:58p 🔵 Root index.ts is a Stale Orphaned Copy of server/index.ts 13691 " 🔵 update-feature-docs Session Interrupted — Partial Audit Complete 13692 12:59p 🔵 update-feature-docs — Session Awaiting Tool Execution Data 13693 1:00p 🔵 update-feature-docs Skill — Repeated Interruptions, No Doc Writes Completed 13694 1:01p 🔵 update-feature-docs — No New Tool Outputs in Latest Continuation S1931 User said "hi" — session status check after prior work on agent-manager app (Aug 1 at 2:54 PM) 13723 8:11p 🔵 agent-manager Product Identity — Name, Version, and Purpose Confirmed
Aug 3, 2026
13781 8:33p 🔵 agent-manager 3D Scene Default — scene3dEnabled: true in settingsStore
13782 " ✅ 3D Scene (Cyberdrome) Now Defaults to Disabled in agent-manager
Access 1804k tokens of past work via get_observations([IDs]) or mem-search skill.
</claude-mem-context>
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

