Detailed Analysis
A Head of Legal Operations with no formal engineering background has published a detailed account of building a self-hosted, multi-agent Claude Code system for daily legal work, and the resulting write-up offers one of the more instructive real-world case studies of how non-technical professionals are pushing Claude Code beyond simple coding assistance into orchestrated, production-grade knowledge work. The system includes an orchestrator agent, specialized sub-agents (a "skeptic" devil's-advocate reviewer, a security reviewer, and a librarian), persistent memory, and a homelab-hosted web client accessible from a phone. What makes the post notable isn't the orchestration or tooling, which the author describes as comparatively easy, but the memory architecture — a problem that turns out to be the central bottleneck in any long-running, multi-agent Claude deployment.
The core technical insight is that naive memory design fails predictably: a single, ever-growing CLAUDE.md file eventually exceeds the point where the model reliably follows it, facts duplicate and drift out of sync, and sub-agents that inherit the full context also inherit the user's biases — a serious flaw when one agent's entire purpose is adversarial review. The author's solution is a five-layer memory system stratified by access frequency and audience: an always-loaded system layer (~L1) for identity and hard rules, a lightweight navigation index (L2), knowledge-base conventions (L3) loaded contextually, a deep archival layer (L4) loaded on trigger, and isolated per-agent vaults (L5) so specialists don't carry irrelevant context. Critically, the two always-on layers are capped near 18KB, reflecting a recognition that everything auto-loaded into context competes with the actual task for the model's attention — a practical, hard-won lesson about context window economics that many builders learn only through failure.
Two engineering mechanisms stand out as broadly applicable beyond legal work: replacing "last verified" timestamps with sha256 hashes for cross-referenced knowledge (since a hash either matches or it doesn't, whereas a timestamp only records an intention to check), and restricting shared-memory write access to a single agent role, with all others filing into a pending queue merged later by the librarian. This single-writer pattern eliminates race conditions between agents overwriting shared truth with conflicting versions — a concrete solution to a coordination problem that becomes increasingly common as multi-agent Claude Code setups proliferate. Perhaps the most conceptually interesting design choice is deliberately denying the red-team critic agent any shared memory at all, on the theory that a critic exposed to the same context as the requester inherits the requester's blind spots and degrades into a rubber stamp. Instead, the critic receives only methodology and a stripped, opinion-free brief, which is a notable articulation of how context contamination undermines adversarial or evaluative AI roles specifically.
This case matters beyond one lawyer's homelab because it illustrates how Claude Code is increasingly being adopted by domain experts — not just software engineers — to build durable, agentic infrastructure around their professional workflows, and because it surfaces memory management as the primary unsolved problem in long-horizon agent deployments generally, ahead of orchestration, tool use, or model capability itself. Anthropic's own product direction (memory features, project-based context, sub-agent support in Claude Code) has been moving toward addressing exactly these pain points, and grassroots architectures like this one function as informal R&D that often anticipates or pressures official tooling. The publication of the sanitized repository, complete with routing tables and a red-team brief template, also reflects a broader trend of practitioners open-sourcing their "prompt engineering as systems engineering" patterns, treating memory layering, hash-based verification, and single-writer concurrency control as first-class design concerns for AI agents in the same way they are for traditional distributed systems.
Read original article →