How It Works
The Daemon
When you run groove start, a Node.js daemon launches on port 3141. It manages:
- Registry — in-memory store of all active agents, their roles, scopes, and status
- WebSocket — real-time broadcasts to the GUI and CLI
- REST API — endpoints for spawning, killing, and querying agents
- State persistence — survives daemon restarts via
.groove/registry.json
Spawning Agents
bash
groove spawn --role backend --scope "src/api/**"When you spawn an agent:
- The daemon registers it in the registry
- A provider process (e.g.,
claude) is started with the role context - The introduction protocol runs — existing agents are notified
AGENTS_REGISTRY.mdis updated in the project root- The GUI tree updates in real-time
The Introduction Protocol
When agent #2 spawns, the daemon:
- Writes
AGENTS_REGISTRY.mdwith all active agents and their scopes - Notifies existing agents about the new arrival
- Gives the new agent a full context brief on spawn
This ensures every agent knows who else is working and what files they own.
File Locks
Groove prevents conflicts through scoped file ownership:
bash
groove spawn --role backend --scope "src/api/**,src/middleware/**"
groove spawn --role frontend --scope "src/components/**,src/pages/**"Agents are aware of their boundaries. The lock manager tracks ownership and flags violations before they happen.
The Journalist
The core innovation. A background process that:
- Tails all active agent stdout streams
- Runs on a configurable interval (default: 5 minutes)
- Synthesizes activity into living documentation
- Updates
GROOVE_PROJECT_MAP.mdandGROOVE_DECISIONS.md
When a new agent spawns, it reads PROJECT_MAP.md and immediately knows the full project state. No re-explanation needed.
Context Rotation
Context windows degrade over time. Groove monitors usage and auto-rotates:
- Detects when an agent's context is approaching degradation threshold
- Triggers the Journalist to capture current state
- Kills the old session
- Spawns a fresh session with full context handoff
Quality stays at 100%. Sessions are effectively infinite.
