Skip to main content
Glama

flowchart TD
    A(["Coding Agent<br/><i>Claude Code · Cursor · Codex · Windsurf</i>"]) -->|"Proposed plan: Build auth helper"| B{"Aedile MCP<br/><i>12 local tools</i>"}
    B --> C["BM25 + AST Symbol Reuse<br/><i>aedile_consult · aedile_map</i>"]
    B --> D["Stdlib & Declared Deps<br/><i>tomllib · pyproject.toml</i>"]
    B --> E["Tarjan Cycle & Layer Gate<br/><i>PEP 810 lazy · add / modify / delete</i>"]
    B --> F["Output Compression & Hotspots<br/><i>aedile_compress · recall · cProfile</i>"]
    C --> G(["Verified, Minimal Implementation"])
    D --> G
    E --> G
    F --> G

Why Aedile?

Modern coding assistants know how to write code. They usually don't know your architecture.

Static prompt rules drift as the context window fills, and regex-only maps miss nested definitions, import graphs, and layer boundaries. That leads to:

  • duplicated utilities (15–30 lines rewritten when 1–5 lines would reuse existing code)

  • unnecessary third-party dependencies

  • circular imports and broken layer boundaries

  • dangling imports when modules are deleted

Aedile verifies the repository deterministically before code is generated, giving coding assistants real AST and graph facts instead of relying on prompts alone.


Related MCP server: Manifold Engine MCP Server

Quick Example

Without Aedile

AI: "I'll write a custom TOML dependency parser and a new cache class."
↓
Repository already has tomllib and ScanCache.
↓
29 lines of duplicated code.

With Aedile

Aedile [Observed: AST/Graph]:
  "Reuse ScanCache in src/aedile/infrastructure/cache.py and stdlib tomllib."
  "ARCHITECTURAL VIOLATION: importing cli from shared violates layer order."
↓
AI reuses existing abstractions in 9 lines with zero violations.

Install & Setup

pip install aedile

Configure MCP servers and SessionStart / SubagentStart hooks automatically (creates .aedile.bak backups):

aedile setup

Check your environment, toolchain, and agent registrations:

aedile doctor

See SUPPORTED_AGENTS.md for manual Claude Code, Cursor, Windsurf, Copilot, and Gemini CLI setup.


Commands & MCP Tools

CLI Command

MCP Tool

What it does

aedile

aedile_consult

Consult reuse, stdlib, declared deps, and pre-edit verification

—

aedile_verify_architecture

Simulate add / modify / delete changes before writing files

aedile map

aedile_map

Emit token-budgeted AST symbol & layer map

aedile graph

aedile_graph

Export Mermaid, SVG, GraphML, or Cypher graphs + blast radius

aedile explain <mod>

aedile_explain

Inspect a module's imports, dependents, instability, and blast radius

aedile path <a> <b>

aedile_path

Shortest dependency path with EXTRACTED / LAZY hop provenance

aedile insights

aedile_insights

Surface god_nodes, subsystem communities, bridges, and questions

aedile review

aedile_review

Caller-aware diff review ranked Must / Should / Nice to have

aedile audit

aedile_audit

Whole-repo ranked audit combining rules, hubs, and debt

aedile debt

aedile_debt

Harvest # shortcut: / # aedile-waive: debt ledger

aedile hotspots <py>

aedile_hotspots

cProfile hotspot ranker with covered_by outermost-caller detection

aedile compress <cmd>

aedile_compress

Compress noisy pytest/git diff/ruff/mypy output + .aedile/recall/ recovery

aedile recall <id> / gain

—

Recover full raw failure logs and view cumulative token-savings telemetry

aedile check

—

CI gate (text, json, sarif, html, card) with --baseline

aedile mode / board / doctor

—

Intensity modes (lite|full|ultra|off), local telemetry board, and diagnostics


Benchmarks (Real Measured Runs)

All benchmarks were executed locally with zero fabricated numbers:

  1. 10-Task Bloat & LOC Test (qwen3:4b) — BLOAT_LOC_BENCHMARK.md:

    • Avg generated code dropped from 19.6 LOC (Without Aedile) to 9.9 LOC (With Aedile, -49.5% less code).

    • Codebase / stdlib reuse rose from 2/10 (20%) to 10/10 (100%).

  2. 12-Prompt Reuse & Architecture Suite (qwen3:4b) — BENCHMARKS.md:

    • Aedile vs. Ponytail (AGENTS.md + ponytail-map.js): 10/12 (83.3%) vs. 2/12 (16.7%) LLM hit rate, 11/12 (91.7%) vs. 0/12 deterministic tool catches, and lower avg prompt tokens (752.8 vs. 794.6).

  3. 10 Production Repositories (50k+ Stars Each) — MEGA_10_REPO_VALIDATION.md:

    • Validated across fastapi, flask, requests, yt-dlp, django, express, vite, nest, gin, and ripgrep (2,674 files, 5,367 edges): 915/923 (99.1%) checks passed.

  4. 100k+ Star Scale Benchmark — SCALE_100K_REPOS_ANALYSIS.md:

    • Measured across yt-dlp, ollama, deno, and react with 19.5x–91.5x warm-cache speedups (0.113s–1.095s warm scans).

  5. 55-Test Token Savings & Pre-Write Gate — TOKEN_SAVINGS_50_TESTS.md:

    • 62,429 / 82,411 (75.8%) CLI output tokens saved across 30 real pytest/git/ruff/mypy/aedile runs + 807,108 / 807,570 (99.9%) pre-write context tokens saved across 25 aedile_consult & verify checks.

  6. 4-Way Real LLM Comparison (qwen3:4b: Aedile vs. RTK vs. Ponytail vs. Baseline) — FOUR_WAY_BENCHMARK.md:

    • 43,860 / 47,278 (92.8%) total tokens saved (169.7 avg prompt tokens vs. 7,479.7 baseline and 6,709.7 RTK) on the playable Tesla Roadster Skyline .exe demo (0.0268 ms/frame across 1,000 simulated frames).

  7. Core Test Suite: 1,073 passing tests in pytest (Python 3.15.2, ruff + mypy strict clean).


FAQ

Does Aedile require internet access or API keys? No. All AST parsing, graph simulation, profiling, caching, and telemetry stay 100% local.

Which languages and Python versions are supported? Python 3.15 (including PEP 810 lazy import cycle awareness) via stdlib ast, plus zero-dependency structural parsers for TypeScript, JavaScript, Go, and Rust.

How do I adopt Aedile on an existing repo without fixing old violations first? Run aedile check --update-baseline, then gate CI with aedile check --baseline so only new regressions fail the build.


Documentation


Contributing & License

Contributions are welcome. See CONTRIBUTING.md and CODE_OF_CONDUCT.md.

Aedile is released under the MIT License.


Star History

Available Tools

1 tool
aedile_consultA

Consult Aedile before implementing. Returns codebase symbol matches, stdlib alternatives, dependency reuse options, and checks proposed imports for cycles or layering violations.

Inputs: proposed_plan (required), proposed_changes.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A4/5.0

    Scored across 1 tool

    Disambiguation5/5

    Only one tool exists, so there is no ambiguity. The agent cannot confuse it with other tools.

    Naming Consistency5/5

    With a single tool, the naming pattern is perfectly consistent. 'aedile_consult' follows a descriptive noun_verb pattern.

    Tool Count2/5

    A single tool is too few for effective agent workflow. The server's purpose (code consultation) would benefit from additional tools for actions like implementing suggestions.

    Completeness2/5

    The lone tool tries to cover multiple consultation aspects (symbols, stdlib, dependencies, imports), but the absence of any action tools leaves obvious gaps in the implementation workflow.

    Maintenance

    ActivityMaintained
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      A
      quality
      B
      maintenance
      Self-hosted semantic code search for AI coding agents. Indexes many repositories at once with tree-sitter AST chunking, local llama.cpp embeddings and Qdrant, so Claude Code, Cursor, Codex and any MCP client can find code by meaning, trace usages and callers, and read the git history behind each chunk. No API keys, and your code never leaves your machine.
      18
      35
      MIT
    • A
      license
      Not graded
      quality
      D
      maintenance
      Enables AI coding assistants to perform high-speed structural codebase analysis and dynamic context management by mapping repositories as byte-streams and detecting architectural chaos.
      MIT
    • A
      license
      A
      quality
      B
      maintenance
      Enables AI assistants to analyze a local codebase and answer impact questions like 'what breaks if I change Y?' through local indexing, search, and reverse dependency analysis, with no code leaving the machine.
      4
      5 npm
      1
      MIT
    • A
      license
      Not graded
      quality
      B
      maintenance
      Enables AI coding agents to retrieve precise, real-time architectural context—such as domains, models, routes, and events—from a codebase, avoiding the need to dump entire files into prompts.
      19 npm
      1
      MIT