N
Open Source · MIT License · v0.1.0

AI is writing 90% of your code.
You're shipping faster than ever. Don't fly blind — keep architectural guardrails
that protect your architecture from AI-driven architectural drift.

1000s of PRs later — does your architecture still make sense? Or has it become spaghetti? GyroCompass reads your living architecture from source, blocks drift the moment a commit crosses a boundary, and keeps Claude Code, Cursor, and every AI agent oriented. So your system stays coherent no matter how fast you ship.

Start for free See how it works →
Works with any AI coding agent
⚡ Claude Code
⚙ Cursor
◈ Codex CLI
✦ Windsurf
◦ Gemini CLI
▸ Copilot
◉ Aider
gyrocompass — your-saas-app
$ pip install gyrocompass
$ gyro setup
 ✓ Initialized .gyro/
 ✓ Architecture extracted — 12 components · 6 capabilities · 24 endpoints
 ✓ Installed git pre-commit + Claude Code hooks
 ✓ Audit: 3 findings — 1 critical (hardcoded key), 2 high
$  
800+
Files/sec indexed
Tree-sitter · measured on 4 real repos
0
False positives
across our 27-case detection benchmark
15+
Languages parsed
Python · TS · Go · Rust · Java · …
10
MCP tools for your agents
context · impact · compliance · audit

Numbers measured by our open, reproducible benchmark — see the results & methodology →

Three steps. Then it keeps watch.

One command onboards any existing repo. The rest is automatic.

Step 01
🧭

Extract the architecture

GyroCompass parses your source with Tree-sitter across Python, TypeScript, Go, Rust, Java and more. It produces a living architecture model — components, data flows, API surface, tech stack — written to version-controlled YAML and a visual diagram.

$ gyro setup
Step 02
🛡️

Define your boundaries

Write your invariants once in .gyro/.gyrorules.yaml — layering rules, ADRs, security policies. GyroCompass installs a real git pre-commit hook that blocks violations before they ever reach review. No advisory warnings — actual enforcement.

$ gyro install-hooks
Step 03
🔌

Feed context to your agents

Connect the MCP server to Claude Code, Cursor, or any MCP-compatible agent. It gets 10 tools: architecture context, blast-radius analysis, compliance checks, ship-readiness audit, and attestation — grounded in your real system, not hallucination.

$ gyro mcp start

Everything AI-native teams need

📐

Living architecture extraction

Tree-sitter parses 15+ languages into components, relationships, data entities, and API surface — in seconds, with no manual input. The model stays current with every gyro analyze --save.

Instant
🔴

Real enforcement — not suggestions

The pre-commit hook runs gyro check and refuses commits that violate invariants. It names the file, the line, and the rule. The violation never reaches code review.

Non-bypassable
📡

10 MCP tools for agents

get_context, get_impact, check_compliance, run_audit, get_drift_report and more — so agents plan inside your architecture from line one, not after review.

Agent-native
🔍

Ship-readiness audit

8 scanners — hardcoded secrets, PII in logs, vulnerable dependencies, SQL injection, unguarded routes, missing tests and CI. Emits an agent-ready punch list: paste it into Claude, get it fixed in one loop.

Security-first
📈

Architectural drift detection

Every PR gets a drift score, a list of what changed (which component, which primitive, which rule was violated), and a suggested fix. CI posts it as a comment. Critical drift blocks the merge.

On every PR
🗂️

Architectural memory

Every drift event is logged into a typed knowledge graph — what changed, which PR caused it, which rule it violated, and what fixed it. Query the evolution of your system over time.

Long-term
🎨

Interactive architecture diagram

A polished SVG diagram auto-generated from your source — components color-coded by type, arrows showing dependencies, a drift-evolution timeline, built-in PNG/PDF export. Standalone HTML, no server.

Shareable
🔒

Local-first / any LLM

Works offline with Ollama. Plug in OpenAI, Anthropic, or your company's internal endpoint. Zero data leaves your machine unless you choose otherwise. MIT licensed — self-host everything.

Private

Deep call-graph engine

Optional Memgraph + Qdrant backend upgrades drift detection to actual call-graph blast-radius. A change in db.query() surfaces every caller up to the API layer. No grep — real graph traversal.

Advanced

Architecture-aware reviews, automatically

When an agent or developer crosses a boundary — a route touching the database directly, a rule violated, a capability broken — GyroCompass catches it at the PR and at the commit. Not a style warning. A real block.

Rule violations with exact file:line
Undocumented architectural changes flagged
Capability regressions detected
Drift score — how far from documented intent
Critical findings block the merge
GitHub PR — gyrocompass-bot commented
GC
gyrocompass-bot  just now
🏛 Architecture Drift Report  ·  PR #412
HIGH
ADR-001 violated — direct DB access from edge handler
Found: api/routes/orders.py:71
Route must call a service, not import db.repositories directly
MED
Undocumented relationship added
api/routes → db/repositories (not in .gyrostate.yaml)
CRIT
PII in logs — user.email written to logger
services/notification_service.py:18
Drift score
45%
🛑 Blocking merge — resolve critical findings or add --no-verify override

The commit that breaks the rules never lands

GyroCompass installs a real git pre-commit hook. It runs the full enforcement gate — rules check, drift analysis, attestation — and exits non-zero when the code violates your invariants. The agent sees the exact violation, fixes it locally, and commits cleanly.

Baked-in interpreter path — works even without active venv
Claude Code PreToolUse hook for in-session context injection
Protected components — block edits to critical modules
SHA-256 bound attestations — tied to exact staged diff
Bypass only with explicit --no-verify
pre-commit hook
$ git commit -m "feat: bulk export endpoint"
GyroCompass — Enforcement Gate
────────────────────────────────────
🛑 rules 2 invariant violation(s)
• no-direct-db-from-routes
  api/routes/orders.py:71
  "from meridian.db.repositories..."
⚠️ drift 45% — 3 event(s)
────────────────────────────────────
🛑 COMMIT BLOCKED
# resolve the violation and re-commit
$  

Built for the AI-native era

"We went from 'what did the agent actually change?' to knowing exactly which components moved, which rules it respected, and what it broke — before it hit review."

AK
Platform Lead
Series B fintech, 40 engineers

"The MCP integration means Claude Code reads our actual architecture before proposing a plan. It self-corrects when it's about to cross a service boundary. We spend way less time in review."

SR
Staff Engineer
AI-native startup, 8 engineers

"We ran the audit on a Lovable-built app before launch. Found a hardcoded Stripe key, PII in logs, and two vulnerable deps. Pasted the output into Claude, fixed in 20 minutes."

ML
Indie founder
Solo SaaS, shipped with Cursor

Start in 30 seconds

One command. Your architecture extracted, hooks installed, audit run.

pip install gyrocompass
1 pip install gyrocompass
2 cd your-repo && gyro setup
3 gyro mcp start