ArchGuard tapir mascot in a rainforest

ArchGuard

Architectural guardrails for AI coding agents

Ask your coding agent to install ArchGuard

Requires Node.js 18 or later

The Problem

Your AI agents write code that works but violates your architecture.

Without guardrails, AI coding agents make decisions that drift from your established patterns. ArchGuard extracts your architectural decisions and makes them available to every agent, every time.

1

Analyze

Extract architectural decisions from your codebase into structured, versioned knowledge.

$ archguard analyze
2

Sync

Push decisions into CLAUDE.md, cursor rules, or any agent configuration file.

$ archguard sync
3

Review

AI agents query decisions in real-time via MCP, getting guidance before writing code.

$ archguard serve
CLAUDE.md is the floor, not the ceiling

By the Numbers

133Architectural decisions extractedfrom 43,000 lines
$16.12Total cost with Opus$2.20 with Sonnet
345Evidence items linkedto source files
ZeroConfiguration neededone command to start

How It Works

Three commands. Full coverage.

Step 01

archguard analyze

Point ArchGuard at your codebase. It reads your source files, identifies patterns, conventions, and architectural decisions, then structures them into versioned knowledge.

terminal
$ archguard analyze ./src

Scanning 43,000 lines across 312 files...
Found 133 architectural decisions
Extracted 345 evidence items
Linked decisions to source locations

Output: .archguard/decisions.json
Step 02

archguard sync

Push extracted decisions into your agent configuration files. CLAUDE.md, .cursorrules, or any custom format. Your agents get architectural context before they write a single line.

terminal
$ archguard sync --target claude

Syncing 133 decisions to CLAUDE.md...
  Added: API design conventions (12 rules)
  Added: Database access patterns (8 rules)
  Added: Error handling standards (15 rules)
  Added: Testing requirements (11 rules)

CLAUDE.md updated with 133 decisions
Step 03

archguard serve

Start the MCP server for real-time guidance. AI agents query architectural decisions on demand, getting contextual answers before making implementation choices.

terminal
$ archguard serve --port 3100

MCP server running on localhost:3100
4 tools available:
  - get_architectural_guidance
  - list_decisions
  - get_decision_detail
  - search_evidence

MCP Tools

Real-time architectural guidance

Four MCP tools that give your AI agents instant access to your architectural decisions. No more guessing, no more violations.

get_architectural_guidance

The killer feature. Agents describe what they want to build, and get back relevant architectural decisions, patterns, and constraints specific to your codebase.

list_decisions

Browse all extracted architectural decisions with their categories, confidence levels, and linked evidence.

get_decision_detail

Deep dive into a specific decision. See the full rationale, evidence trail, and source file references.

search_evidence

Search through 345+ evidence items linked to source files. Find the code that proves a pattern exists.

MCP interaction example

Agent request

"I need to add a new API endpoint for user preferences. What patterns should I follow?"

get_architectural_guidance response

Decision #47: REST API Design Standards
- Use resource-based URLs: /api/v1/users/{id}/preferences
- Return 200 for success, 404 for missing resources
- Validate input with Pydantic models
- Evidence: src/api/routes/users.py (lines 12-45)

Decision #63: Database Access Patterns
- Use repository pattern for all DB operations
- Never access DB directly from route handlers
- Evidence: src/repositories/base.py (lines 1-30)

Cost Breakdown

Pay pennies, not subscriptions

ArchGuard uses your own API keys. You pay for exactly what you use, nothing more.

OperationOpusSonnet
Analyze codebase$12.48$1.70
Extract decisions$2.89$0.38
Link evidence$0.62$0.09
Generate sync files$0.13$0.03
Total$16.12$2.20
Typical SaaS alternative:$5-15/dev/month(forever)
You built something that solves a problem I was literally having.

Clawd 🦞

OpenClaw autonomous coding agent