A second product in the same repository. Where Lavern is interactive, Clawern is autonomous: it watches a folder, reads what lands there, curates findings against an institutional memory, and delivers a bundle without a human in the loop until review time.
Entirely on the user's own machine. There is no
Clawern server. The whole product is a Node.js process bundled into
a CLI binary (npm run claw or the installed
claw command), with src/claw/index.ts as
the entry point.
| Daemon | daemon.ts registers a macOS LaunchAgent plist; daemon-systemd.ts is the Linux equivalent. Both restart Clawern on boot and on crash. Logs go to local files. |
| Filesystem watch | watcher.ts uses chokidar to watch a local folder — debounced, symlink-guarded. Default inbox sits inside ~/.lavern/ (override with LAVERN_CLAW_DIR). |
| In-process pipeline | When a file lands, watchman.ts → processor.ts runs the parse / infer / dispatch loop in-process. LLM calls go out to Anthropic (or Ollama on the same machine for hybrid / local mode); everything else stays local. |
| State on disk | Document registry, precedent board, audit log, daily backups, profile, deliveries — all flat files and JSON under ~/.lavern/. |
| Network surface | Outbound only — LLM APIs, Telegram, optional webhook. No inbound ports unless the user starts the local dashboard. |
menubar/, SwiftUI) — polls the local Claw API every 30s for document counts, budget, daemon status.telegram-bot.ts) — long-polls Telegram from inside the daemon process and dispatches commands back through the same in-process API. The bot is local, not a cloud webhook.viz/src/claw/) — connects to the local API server when the user starts it; nothing routes through a cloud tier.The privacy story is direct: data never leaves the user's disk unless explicitly escalated to a frontier model — and even then via the anonymisation step.
Added in commits 4455d89 → 2276bae after a v1 → v3.4
evaluation arc on 10 CUAD contracts. The pipeline has three named
stations and a memory store:
| Watchman | watchman.ts + watcher.ts. Filesystem watch with debounce and symlink protection. Hands new arrivals to the Reader. |
| Reader | reader-templates.ts + processor.ts. Parses, infers document type, dispatches to the right analysis path. |
| Curator | curator.ts. Reconciles new findings against the precedent board — dedup, decay, surface what matters. |
| Precedent board | precedent-board.ts. Cross-document finding store, O(1) dedup, relevance search, decay + compaction. |
The precedent board is what makes the law-firm framing literal. Every finding written for a client gets persisted with provenance. Later documents query that history — have we seen this clause before? what did we say last time? did the counterparty accept the redline? Decay rules prevent the store from drifting; compaction keeps it small.
--ethical flag, planner-aware) — narrower budget, sensitivity-aware patterns, conservative escalation.
client-registry.ts partitions everything by client:
directories, profiles, budgets, precedent shards. No cross-client
reads. A finding from Client A never surfaces in
Client B's review.
daemon.ts + daemon-systemd.ts | macOS LaunchAgent and Linux systemd unit management |
notify.ts | Webhook + macOS native notifications, with dedup and redaction (heartbeat, precedent match) |
telegram-bot.ts + notify-telegram.ts | Two-way Telegram bot — receive alerts, issue commands, scan-on-demand |
audit.ts | Append-only JSON-lines audit trail with rotation |
backup.ts | Daily state snapshot, 30-day retention |
diff.ts | Findings diff across review sessions — added / resolved / changed |
events.ts | ClawEventBus singleton for real-time WebSocket streaming to the dashboard |
menubar/ | Native macOS SwiftUI status-bar app — polls Claw API every 30s, document counts, budget gauge, daemon status, quick actions |
viz/src/claw/ mirrors the daemon with Overview (Portfolio
Intelligence), Documents (inline error recovery), Deliveries (change
detection), Precedents, and Config. Same event stream the menu bar
app polls.