by aaryanrwt
Provides deterministic Git and AST change intelligence, detects breaking API changes, maps caller blast radius, tracks documentation drift, and drafts evidence‑grounded release notes with optional local LLM acceleration.
Athena is a local‑first code‑intelligence engine that analyses Git diffs and abstract syntax trees (AST) across 14 programming languages. It surfaces potential breaking changes, quantifies the impact on callers, highlights documentation drift, predicts affected tests, and can generate release‑note narratives without relying on external cloud services.
# Clone and install (editable mode)
git clone https://github.com/aaryanrwt/athena.git
cd athena
pip install -e .
# Interactive terminal UI
athena ui
# Quick map of a repository (≤2 KB JSON payload)
athena map .
# Pre‑commit safety gate – fail on breaking API changes
athena check --staged
# Run the MCP server (stdio or HTTP loopback)
athena mcp --toolsets git,graph --read-only
The CLI offers many focused commands (graph, breaking-changes, affected-tests, debt, install, etc.) and can be integrated into CI pipelines or GitHub Actions.
.athena/graph.json and exports a ≤2 KB architectural map in seconds.athena affected-tests predicts which pytest or Playwright tests are likely to fail after a change.# shortcut: markers and reports debt linked to specific AST symbols.capabilities, repo/map, evidence/recent, evidence/{id}) and 13 toolsets via a stdio or streamable‑HTTP interface.athena install injects skills into Hermes, OpenClaw, Claude Code, Codex, Cursor, and Pi.Q: Do I need an internet connection? A: No. All analyses run locally; the only optional online component is a local Ollama model for release‑note generation.
Q: Which languages are supported? A: 14 languages, including Python, JavaScript/TypeScript, Go, Rust, C/C++, C#, Java, Kotlin, PHP, CUDA, TeX, and more.
Q: How does Athena handle dynamic calls like getattr or eval?
A: Such calls are recorded as ResidualUnknown (unk_<sha256>) entries, making the uncertainty explicit rather than silently ignoring it.
Q: Can I run Athena inside a container? A: Yes. A root‑less Dockerfile is provided; the container includes the Python package and optional Rust accelerators.
Q: How do I integrate with GitHub Actions?
A: Use the pre‑built action aaryanrwt/athena@v1.3.2 after checking out the repository. The action posts a breaking‑change summary on each PR.
Q: What if I want to use a custom LLM for release notes?
A: Pass the --llm flag with a compatible Ollama model name, or set ATHENA_OLLAMA_ENDPOINT to point to your own server.
Athena is a local-first code intelligence tool (CLI, Terminal UI, and MCP server). It runs offline on your machine—no cloud APIs or vector databases required—to help both developers and AI coding agents:
None defaults, unit-shift hints, recursion bugs, and broken callers).athena graph & athena map), cutting agent token usage by 49x–81,438x on real repositories.athena affected-tests for pytest/Playwright + athena debt for # shortcut: markers).athena install)—Hermes, OpenClaw, Claude Code, Codex, Cursor, and Pi—with safe, backed-up configs and optional Hybrid Rust acceleration.git clone https://github.com/aaryanrwt/athena.git
cd athena
pip install -e .
# Open the interactive Terminal Studio
athena ui
# Get a <=2KB architectural map of any repo
athena map .
# Check for breaking changes before committing
athena check --staged
| Command | What it does |
|---|---|
athena ui |
Launches the interactive terminal studio (auto-starts when run in a terminal). |
athena doctor . |
Checks live Python, Git, MCP SDK, Rust acceleration, evidence store, and repo state. |
athena mcp --toolsets git,graph --read-only |
Runs Athena's MCP server (stdio or loopback streamable-http) with toolset/read-only scoping, resources, and workflow prompts. |
athena map . |
Prints a <=2000-character export map of shared modules and symbols. |
athena graph . --query "auth" |
Builds/queries .athena/graph.json with trigram search + hub-guarded BFS. |
athena breaking-changes . --base main --target HEAD |
Finds potential breaking API changes, caller impact, and doc drift (--detail summary retains ev_<sha256> on disk). |
athena view <ev_id> --facet potential_breaking_changes |
Pages through retained ev_<sha256> evidence bundles across CLI/MCP sessions. |
athena check --staged |
Pre-commit gate: exits non-zero if staged changes break public APIs. |
athena affected-tests . |
Predicts pytest, Playwright .spec.ts, and unit tests impacted by a diff (supports --offset/--limit). |
athena debt . |
Lists shortcut: <limit>, <when to upgrade> debt markers with AST symbols (supports --offset/--limit). |
athena install --agent hermes |
Installs Athena skills/hooks for hermes, openclaw, claude-code, codex, cursor, or pi. |
athena init-mcp cursor |
Generates ready-to-paste MCP config JSON (claude-desktop, cursor, vscode). |
qwen2.5-coder:7b / gemma:latest) is strictly optional (--llm).getattr, eval, oversized files) are tracked explicitly as ResidualUnknown (unk_<sha256>) records instead of being hidden.detail="summary" with cross-process disk-backed ev_<sha256> paging (inspect_analysis_view / athena view), while athena mcp exposes 4 read-only Resources/Templates (athena://server/capabilities, athena://repo/map, athena://evidence/recent, athena://evidence/{evidence_id}), 3 guided workflow prompts, --toolsets/--read-only scoping, and loopback-guarded streamable-http transport.athena/
├── src/athena/
│ ├── cli.py # CLI entry point (ui, doctor, mcp, graph, map, view, affected-tests, debt, install, check, report, semver-check)
│ ├── tui.py # Interactive Athena Studio Terminal UI
│ ├── mcp_server.py # Scoped stdio / loopback streamable-http MCP server (13 tools, resources, URI templates & prompts)
│ ├── git_inspector.py # Safe git diff & batched cat-file extractor (GIT_NO_LAZY_FETCH=1, TOCTOU drift guard)
│ ├── ast_analyzer.py # Python ast contract/unit-shift/recursion differ + 14-language structural scanner
│ ├── graph_store.py # Persistent .athena/graph.json builder, TS barrel/PHP/CUDA/TeX graph & atomic snapshots
│ ├── graph_query.py # Trigram+IDF scorer, hub-guarded BFS, god_nodes & shortest_path
│ ├── test_selector.py # Predictive test selection (pytest, Playwright .spec.ts/.e2e.ts, unit tests)
│ ├── repo_map.py # <=2KB zero-search architectural export map
│ ├── debt_tracker.py # AST-bound `shortcut:` technical debt scanner
│ ├── evidence_store.py # Canonical ev_<sha256> & unk_<sha256> store + paged inspection
│ ├── agent_installer.py # Transactional installer for Hermes, OpenClaw, Claude Code, Codex, Cursor & Pi
│ ├── gates.py # Staged pre-commit & SemVer bump gates
│ ├── sarif.py # SARIF 2.1.0 exporter
│ ├── html_report.py # CSP-hardened single-file HTML report renderer
│ ├── release_notes.py # Deterministic & optional Ollama release-note pipeline
│ ├── ollama_engine.py # Optional local Ollama integration (gemma:latest / qwen2.5-coder:7b)
│ ├── symbol_cache.py # Content-addressed parsed symbol cache
│ ├── mcp_config.py # MCP client config generator (Claude Desktop, Cursor, VS Code)
│ ├── verifier.py # Ground-truth evidence verifier & hallucination guard
│ ├── security.py # Path jail, symlink defense, NTFS ADS guard & Rust-accelerated secret redaction
│ ├── _fast_kernels.py # Plain-data hot kernels with verified Rust PyO3 fast-anything ports
│ └── models.py # Pydantic v2 schemas
├── skills/athena/SKILL.md # Portable Athena agent protocol skill
├── docs/ # CLI examples, evaluation reports, CI/Docker integrations & demo tape
├── tests/ # Automated unit, MCP stdio, release-readiness & evaluation suites
├── .github/ # CI workflows (athena-audit, action-smoke) & PR comment renderer
├── action.yml # Reusable GitHub Action
├── Dockerfile # Rootless container image
└── pyproject.toml # Package & Python 3.13-3.15 metadata
Tested offline across 5 fresh enterprise repositories (1,050–1,091 commits each; 5,291 commits and 63.8M raw tokens / 255.2 MB total). Across these repositories, Athena surfaced 366 potential breaking API changes (274 high, 92 medium), 893 affected caller sites (148 findings with direct in-repo callers), and 2,180 impacted tests, alongside 1,991 graph unknowns (80 unresolved dynamic calls):
google/go-github, Go — 1,050 commits): Found 111 breaking changes (92 high, 19 medium), 151 affected callers across 31 findings, and 238 impacted tests. Caught breaking signature rewrites in github/actions_secrets.go and github/dependabot_secrets.go where CreateOrUpdateRepoSecret / CreateOrUpdateOrgSecret changed (..., eSecret *EncryptedSecret) to (..., name string, body SecretRequest) / SecretOrgRequest (10 callers each), GetEnvPublicKey / ListEnvSecrets / ListEnvVariables replaced repoID int with (owner, repo, env string), and DependabotService.getPublicKey (8 callers) and ActionsService.EditActionsAllowed (5 callers) were removed.ml-explore/mlx, C++/Python — 1,050 commits): Found 39 breaking changes (39 high), 45 affected callers across 14 findings, and 69 impacted tests. Caught array::set_data(allocator::Buffer buffer, Deleter d) rewritten to array::set_data(allocator::Data data) in mlx/array.cpp, stride arguments (lda, ldb, ldc, ld) added to simd_gemm / load_block (mlx/backend/cpu/gemms/simd_gemm.h), float* acc added to _qmm (mlx/backend/cpu/quantized.cpp), plus removed free(Buffer) (mlx/allocator.cpp) and backend is_available() symbols (10 callers each).openai/openai-python, Python — 1,091 commits): Found 132 breaking changes (73 high, 59 medium), 460 affected callers across 65 findings, and 397 impacted tests. Caught SyncAPIClient.request in src/openai/_base_client.py dropping positional remaining_retries (10 callers), AsyncAPIClient.request changing signature (9 callers), and removed CLI command handlers under src/openai/cli/ (CLIChatCompletion.create, CLICompletions.create, CLIFile.create/get/list, CLIImage.create, CLIModels.get/list, cli/_cli.py:main, 10 callers each).meta-llama/llama-stack, Python/TS — 1,050 commits): Found 61 breaking changes (47 high, 14 medium), 113 affected callers across 23 findings, and 482 impacted tests. Caught removal of LlamaCLIParser.parse_args, LlamaCLIParser.run, Subcommand.create, src/llama_stack/cli/llama.py:main, OpenAPI client SDK CLI entrypoints (client-sdks/openapi/merge_stainless_config.py:main, shield CLI commands, 10 callers each), and shared helpers (print_subcommand_description, print_table, parse_endpoint). Also exposed a real 300.14s timeout in v1.3.1 that v1.3.2 fixed down to 37.57s.microsoft/semantic-kernel, C#/Python — 1,050 commits): Found 23 breaking changes (23 high), 124 affected callers across 15 findings, and 994 impacted tests. Caught the .NET Agent Framework signature redesign of InvokeAsync and InvokeStreamingAsync in AzureAIAgent.cs, BedrockAgent.cs, and ChatCompletionAgent.cs (changing return types from IAsyncEnumerable<ChatMessageContent> to IAsyncEnumerable<AgentResponseItem<ChatMessageContent>> and replacing threadId/sessionId/ChatHistory with (ICollection<ChatMessageContent> messages, AgentThread? thread = null, ...), 10 callers each) plus removed methods in ChatHistoryKernelAgent.cs (10 callers each).| Company & Repo | Commits | Found (Breaking / Callers) | Scan Time (v1.3.1 -> v1.3.2) |
Map Token Savings |
|---|---|---|---|---|
Google (google/go-github, Go) |
1,050 |
111 breaks · 151 callers |
133.26s -> 22.15s (6.02x faster) |
5,103.0x |
Apple (ml-explore/mlx, C++/Py) |
1,050 |
39 breaks · 45 callers |
176.68s -> 11.12s (15.89x faster) |
6,026.7x |
OpenAI (openai/openai-python, Py) |
1,091 |
132 breaks · 460 callers |
284.69s -> 30.98s (9.19x faster) |
11,246.0x |
Meta (meta-llama/llama-stack, Py/TS) |
1,050 |
61 breaks · 113 callers |
TIMEOUT 300.14s -> 37.57s (>8.0x) |
81,438.6x |
Microsoft (microsoft/semantic-kernel, C#/Py) |
1,050 |
23 breaks · 124 callers |
223.71s -> 12.48s (17.92x faster) |
24,290.1x |
Across these runs, v1.3.2 cut breaking-change scan times 6.02x–17.92x (fixing the llama-stack timeout), compressed 3.13–12.03 MB JSON payloads to 644–646 B summaries with working disk-backed athena view (rc=1 -> rc=0 on 5/5 repos), and passed strict contract checks (INVALID_MAX_CHARS, paged affected-tests, athena doctor). Full timings, SHA-256 parity hashes, and v1.3.1 -> v1.3.2 CLI checks: docs/evaluation.md.
Tested offline across 13 new repositories (3 NVIDIA 2026 & CUDA repos over 1,000+ commits + 10 diverse high-star repos across JS, TS/Go, Rust, C/C#, Kotlin, Ruby, PHP, TeX): 13/13 passed with 0 errors.
| Repository | Language | Stars | Span | Files | Nodes / Edges | Cold -> Warm Cache | Token Reduction |
|---|---|---|---|---|---|---|---|
NVIDIA/auto-ontology |
Python (2026) | 14,568 | HEAD~1000 |
897 | 7,486 / 23,258 | 33.3s -> 1.9s | 618.6x |
NVIDIA/NeMo-Relay |
Rust (2026) | 257 | HEAD~1000 |
1,560 | 32,331 / 48,324 | 82.3s -> 6.7s | 3,025.0x |
NVIDIA/cuvs |
CUDA / C++ | 903 | HEAD~1000 |
1,269 | 6,148 / 7,184 | 34.2s -> 1.8s | 1,330.2x |
facebook/react |
JavaScript | 252,934 | HEAD~100 |
4,161 | 20,714 / 19,216 | 236.8s -> 12.5s | 1,453.0x |
microsoft/PowerToys |
C / C# | 141,325 | HEAD~100 |
2,415 | 9,088 / 6,780 | 128.3s -> 6.3s | 1,258.6x |
microsoft/TypeScript |
TypeScript / Go | 111,875 | HEAD~100 |
503 | 7,879 / 7,907 | 29.3s -> 2.8s | 1,052.1x |
fatedier/frp |
Go | 110,732 | HEAD~100 |
247 | 2,653 / 2,436 | 11.7s -> 1.0s | 250.3x |
denoland/deno |
Rust | 109,038 | HEAD~100 |
1,697 | 33,010 / 35,688 | 107.6s -> 8.6s | 2,411.5x |
laravel/laravel |
PHP / Blade | 85,480 | HEAD~1000 |
24 | 81 / 69 | 1.4s -> 0.2s | 4.4x |
rails/rails |
Ruby | 59,182 | HEAD~1000 |
3,099 | 20,635 / 19,311 | 129.3s -> 12.0s | 1,335.2x |
JetBrains/kotlin |
Kotlin | 53,614 | HEAD~100 |
4,406 | 16,278 / 12,611 | 183.1s -> 9.7s | 1,794.9x |
dotnet/runtime |
C# | 18,461 | HEAD~100 |
4,334 | 18,661 / 14,424 | 229.6s -> 11.4s | 1,978.0x |
latex3/latex2e |
TeX | 2,523 | HEAD~1000 |
154 | 561 / 393 | 9.8s -> 0.4s | 1,527.1x |
Athena keeps its Python CLI, MCP server, Pydantic schemas, and Python ast precision intact (pip install athena-mcp works anywhere with pure-Python fallback), while porting its hottest pure kernels to Rust PyO3 extensions via EL4CTEO/fast-anything and batching Git blob reads (git cat-file --batch).
1,000+ Commit Before vs. After Quality & Parity AuditVerified side-by-side (FAST_ANYTHING_DISABLE=1 pure Python vs. Rust PyO3 enabled) across NVIDIA, Google, and Microsoft repositories over 1,000–1,472 commits each (HEAD~1000..HEAD):
| Company & Repo | Span (HEAD~1000..HEAD) |
Scale (Files / Nodes / Edges) |
Graph Build (Before -> After) | 20 Queries (Before -> After) | Total Pipeline (Before -> After) | Quality & SHA-256 Parity |
|---|---|---|---|---|---|---|
NVIDIA (NVIDIA/cuvs) |
1,472 commits (8b03db68..0bc18670) |
1,269 / 6,152 / 7,188 |
29.89s -> 1.33s (22.48x) |
6.04s -> 0.74s (8.19x) |
89.49s -> 28.78s (3.11x) |
14/14 checks identical (21 breaks, 306 tests, ev_ddbf63fa...5b07d) |
Google (google/flatbuffers) |
1,000 commits (e08da4de..5eb190f0) |
1,196 / 11,954 / 19,419 |
43.39s -> 1.62s (26.73x) |
3.22s -> 2.21s (1.46x) |
74.31s -> 24.12s (3.08x) |
14/14 checks identical (34 breaks, 831 tests, ev_c1075fe1...f9fe6) |
Microsoft (microsoft/playwright-python) |
1,000 commits (f6726115..c830b5f8) |
725 / 12,176 / 100,818 |
45.78s -> 12.22s (3.75x) |
14.90s -> 15.96s (0.93x*) |
112.03s -> 87.93s (1.27x*) |
14/14 checks identical (18 breaks, 604 tests, ev_dacea634...74a8) |
*Note on microsoft/playwright-python: it is predominantly .py files (Python ast.parse stays in Python) with 100,818 edges iterated in Python's _build_adj on each query (14.90s -> 15.96s); in that single run, Python's run_breaking_change_detection took 35.89s -> 52.27s due to cold/warm Windows git.exe/OS cache variance on Python AST diffs while predict_affected_tests dropped 15.47s -> 7.48s (2.07x), yielding 1.27x total.
graph_evidence_id, completeness status, node/edge/unknown count, community label, 20 query subgraphs, breaking-change finding list, doc drift count, and predicted test list matched bit-for-bit across all 3 enterprise repositories.fast-anything verify) & Batch Git: redact_secrets 41x (237.3us -> 5.8us, 776/776), score_graph_trigrams 8.8x (37.3ms -> 4.2ms, 330/330), compute_community_assignments 3.5x (9.6ms -> 2.7ms, 206/206), extract_structural_symbols_raw 1.9x (16.2us -> 8.6us, 800/800), plus batched git cat-file --batch cutting Athena (v1.0.0..v1.3.1) breaking-change analysis 4.02x (12.74s -> 3.17s). (parse_unified_diff_raw matched 229/229 calls but measured 3.1x slower via PyO3 FFI allocation overhead, so it was intentionally kept in Python.)# Optional: compile native Rust accelerations locally into .fast/lib/
python scripts/build_rust_accel.py
# Toggle pure-Python fallback at any time
FAST_ANYTHING_DISABLE=1 athena graph . --query "auth"
Full version-by-version test history (v1.0.0 -> v1.3.2) and Rust parity audit: docs/evaluation.md.
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
fetch-depth: 0
- uses: aaryanrwt/athena@v1.3.2
Posts one sticky breaking-change & blast-radius summary per PR. See docs/integrations.md for Docker, pre-commit, and permissions setup.
Maintainer: Aaryan Rawat (aaryan28rwt@gmail.com) · Licensed under Apache-2.0.
Please log in to share your review and rating for this MCP.
Explore related MCPs that share similar capabilities and solve comparable challenges
by headroomlabs-ai
Compress tool outputs, logs, files, RAG chunks, and conversation history before they reach the LLM, keeping answers identical while saving up to 95% of tokens for JSON payloads.
by modelcontextprotocol
A Model Context Protocol server for Git repository interaction and automation.
by zed-industries
A high‑performance, multiplayer code editor designed for speed and collaboration.
by modelcontextprotocol
Model Context Protocol Servers
by modelcontextprotocol
A Model Context Protocol server that provides time and timezone conversion capabilities.
by cline
An autonomous coding assistant that can create and edit files, execute terminal commands, and interact with a browser directly from your IDE, operating step‑by‑step with explicit user permission.
by upstash
Provides up-to-date, version‑specific library documentation and code examples directly inside LLM prompts, eliminating outdated information and hallucinated APIs.
by daytonaio
Provides a secure, elastic infrastructure that creates isolated sandboxes for running AI‑generated code with sub‑90 ms startup, unlimited persistence, and OCI/Docker compatibility.
by continuedev
Enables faster shipping of code by integrating continuous AI agents across IDEs, terminals, and CI pipelines, offering chat, edit, autocomplete, and customizable agent workflows.