โ† Back to Debate

๐Ÿ—๏ธ Recommended Architecture

3-Layer Agentic System for Mac Mini + Claude Code
Deployable Today โ€” 5-10x Productivity Gain

The 3-Layer Architecture

L1

Human Architect

Who: You, Thota โ€” or a senior developer on your team

  • Defines features from business requirements
  • Writes specs with explicit preconditions, postconditions, and contracts
  • Reviews architecture decisions and final outputs
  • Handles ambiguous requirements โ€” the hardest part that agents can't do
  • Sets constraints: security posture, performance budget, data model invariants
โ†“
L2

Supervisor Agent

Who: Claude via API, or a local 7B planner model on Mac Mini

  • Decomposes specs into structured task trees (JSON/Mermaid format)
  • Manages state across all subtasks (SQLite or file-based)
  • Spawns Claude Code Workers for leaf tasks
  • Catches errors from workers and re-routes or retries
  • Enforces context budgets: max 50K tokens per worker, full context never exceeds 100K
  • Maintains task graph: which tasks are blocked, which are done, which failed
โ†“
L3

Claude Code Workers

Who: Claude Code processes on Mac Mini โ€” parallelized, bounded

  • Execute leaf tasks: single file edits, test generation, terminal commands
  • Run with --dangerously-skip-permissions and --allowedTools scoped per task
  • Output structured results: { files_changed, summary, test_coverage, error }
  • Maximum 10 concurrent workers on M4 Pro Mac Mini
  • Each worker gets only task-relevant context: 5-10 files, not the whole codebase
  • Workers are stateless: no shared state between workers except via supervisor

Implementation Steps

01

Set up the Supervisor Process

Python + LangGraph/CrewAI. The supervisor runs as a long-lived process that manages a task queue. It exposes a CLI or REST API for submitting feature specs and querying task status. State persists in SQLite so you can restart the supervisor without losing progress.

02

Define Worker Templates

Create Claude Code launch templates for each worker type: code-editor, test-generator, docs-writer, reviewer. Each template has scoped --allowedTools and system prompt with explicit constraints. Template files live in ~/.claude/agents/.

03

Build the RAG Pipeline

Index the codebase with a local embedding model (Nomic or similar). When a feature spec comes in, retrieve the 5-10 most relevant files and include their type signatures and contracts. Pass this as context to the Supervisor โ€” never dump the full codebase into any agent's context.

04

Implement the Contract Layer

Use Pydantic models or Zod schemas to define explicit input/output contracts for every feature. The supervisor validates worker outputs against contracts. If a worker returns data that violates the contract, it's automatically retried with the contract error as context.

05

Human Review Gate

After the supervisor completes a feature pipeline, output goes to a human review queue. Use a simple web UI (or even a file-based queue) where you review changed files, run the test suite, and approve/reject. The review takes 5 minutes. The implementation took 2 hours. This is the 10x leverage point.

Recommended Tech Stack

macOS

Mac Mini M4 Pro โ€” handles 10 concurrent Claude Code workers, Docker, databases, local dev

Claude Code

Worker execution. Use --print mode for scripted invocation, --dangerously-skip-permissions for automation

LangGraph / CrewAI

Supervisor orchestration. State machine for task graphs, error handling, retry logic

SQLite

Task state persistence. Simple, fast, no server needed. One DB file for the whole system

Nomic Embeddings

Local RAG embeddings. Keep code context on-device. ~4GB RAM footprint

Pydantic / Zod

Contract validation. Define schemas for all feature inputs/outputs

Debate Consensus โ€” What Both Sides Agreed On

โœ… Where Agents Work Today

  • Well-specified, bounded tasks
  • Boilerplate generation
  • Test scaffolding from clear specs
  • Documentation from code changes
  • DevOps scripting
  • Single-file refactors with clear scope

โŒ Where Agents Still Fail

  • Ambiguous requirements
  • Multi-system understanding
  • Debugging production incidents
  • Security-critical code
  • Business logic interpretation
  • Novel architectural decisions

Next Steps for Thota

High

Day 1: Set up Supervisor skeleton

Clone a LangGraph example, get a hello-world pipeline running. Supervisor โ†’ 1 Worker โ†’ verify output. The hardest part is the mental model shift โ€” once that clicks, everything else follows.

High

Week 1: Build your first feature pipeline

Pick a real feature from your codebase. Write the spec, run it through supervisor โ†’ worker โ†’ output, review the result. First run will be rough. By run 5, you'll have the rhythm.

Medium

Week 2: Add RAG + Contracts

Add the Nomic embedding index and Pydantic contract validation. This is where the quality jump happens โ€” agents stop hallucinating APIs they don't recognize.

Medium

Week 3: Parallelize and measure

Run the same features through traditional dev vs agentic dev. Measure time saved, bug rate, and review overhead. Use this to decide where to invest more in the agentic system.