A Node/TypeScript core orchestrates Claude Agent SDK sessions through an MCP server. A React dashboard streams the live state. A separate daemon (Clawern) runs the same engine autonomously over a folder.
src/ ├── agents/ 67 prompts + profiles + definitions ├── api/ Fastify server, WebSocket, 25 routes ├── assembly/ Markdown → HTML/DOCX ├── claw/ Clawern daemon (28 modules) ├── db/ SQLite (auth, archive, matters) ├── documents/ PDF/DOCX/MD/TXT parser + sanitization ├── mcp/tools/ 21 MCP tools ├── mcp/remote-bridge/ JSON-RPC bridge for Managed Agents ├── providers/ Anthropic / Mistral / local abstraction ├── workflows/ 9 templates + executor ├── orchestrator.ts Per-session SDK loop ├── dispatch.ts Workflow + gate + budget selection └── index.ts Entry (CLI / --serve / claw) viz/ React 19 dashboard (Vite) site/ Static marketing site (Netlify) menubar/ macOS SwiftUI menu bar app tests/ 1,677 tests across 109 files
POST /api/sessions with document + context.src/dispatch.ts) picks a workflow template, assigns budget, wires a gate resolver.src/orchestrator.ts) launches a Claude Agent SDK query() with the in-process MCP server.| Layer | What it does | Where |
|---|---|---|
| Evaluator gate | Drops weak findings, up to 2 revision loops | mcp/tools/evaluator-gate.ts |
| Adversarial debate | Red team / blue team challenge | workflows/templates/adversarial.ts |
| 10-pass verification | context, ux, clarity, structure, accuracy, completeness, risk, formatting, legal_design, delivery | workflows/templates/verification.ts |
| Grounding verifier | String-matches every cited quote against the parsed document | mcp/tools/grounding-verifier.ts |
Fastify + WebSockets. User briefs in plain language, watches agents debate, approves at gates, downloads audit bundle.
Daemon watches a folder. Processes new documents on a 30-minute heartbeat. Precedent board persists findings across engagements. Pushes alerts to Telegram, email, macOS.