Athena README

The full upstream README, mirrored for reference. Install config, tool schemas, adoption signals and our own overview live on the Athena listing page.

Athena: Local-First Git and AST Intelligence

Athena

Your git diff says it is safe. Athena checks the callers.

CI Release GitHub Stars Last Commit License
M8ven MCP Score XERJ Corpus Hub contributor

Athena: Local-First, Python and Rust, MCP Server with 18 Tools, AST and Graph across 14 Languages, Verified Fixes with 0 False Greens

Overview

Athena is a local-first CLI and MCP server that detects breaking API changes before they reach your main branch. It maps every caller affected by a change, applies safe deterministic fixes where the intent is unambiguous, and verifies the result against your real compilers and test suites. For semantic changes that static rules cannot resolve, Athena hands bounded, sandboxed context to an AI model or coding agent and rolls back bit-for-bit if verification fails.

Everything runs on your machine. There are no cloud uploads and no vector databases.

Key capabilities

  • Breaking-change detection across 14 languages using Python ast and Tree-sitter, with full caller blast radius.
  • Impacted test selection ranked by changed symbols and their callers.
  • Deterministic fixes for mechanical refactors (renames, keyword changes, argument swaps, None guards, docstring sync) with zero false edits on real-world replays.
  • AI-assisted repair through local models, hosted OpenAI-compatible or Anthropic APIs, or MCP agents such as Claude Code, Codex, and Cursor.
  • Fail-closed verification that reports success only when compilers and tests actually ran and passed.
  • Bit-exact rollback that preserves line endings, BOMs, and unrelated uncommitted work.

Table of Contents

Installation

Requires Python 3.13 or later and Git.

bash
git clone https://github.com/aaryanrwt/athena.git
cd athena
pip install -e ".[ast]"

The [ast] extra installs Tree-sitter grammars for all 14 languages. Use pip install -e . for a lightweight install with a structural fallback parser. Run athena doctor . to confirm your environment.

Quick Start

bash
# Map the repository and query the code graph
athena map .
athena graph . --query "auth"

# Detect breaking changes and affected callers
athena check --staged
athena breaking-changes . --base main --target HEAD

# Preview deterministic fixes and find impacted tests
athena fix . --base main --target HEAD --format diff
athena affected-tests . --base main --target HEAD

# Verify with compilers, type checkers, and impacted tests
athena verify-fix . --base main --target WORKING_TREE

How It Works

mermaid
flowchart LR
    Map["Map and Graph"] --> Detect["Detect Breaking Changes"]
    Detect --> Fix["Fix or Repair"]
    Fix --> Verify["Verify or Roll Back"]
  1. Map. athena map and athena graph index exports and call sites into a local graph at .athena/graph.json.
  2. Detect. athena breaking-changes identifies removed symbols, new required parameters, changed defaults, and argument shifts, then traces every affected caller. Dynamic code paths such as getattr and eval are reported as partial rather than silently ignored.
  3. Fix. athena fix applies patches only when they are provably safe. Semantic changes are routed to review or to AI-assisted repair.
  4. Verify. athena verify-fix runs the relevant toolchain (for example pytest, mypy, go test, cargo test, tsc, dotnet test, mvn test) and returns verified_pass only when checks ran and passed. Missing toolchains are reported as unverified, never as success.

Supported languages: Python, TypeScript, JavaScript, Go, Rust, C#, Java, Kotlin, Swift, PHP, C, C++, Ruby, and Scala.

CommandPurpose
athena map / athena graphArchitectural overview and code graph queries
athena breaking-changesAST diff audit with caller blast radius
athena affected-testsRanked impacted test selection
athena fixPreview or apply deterministic safe patches
athena repairClosed-loop deterministic and AI repair with rollback
athena verify-fixCompiler, type checker, test, and AST re-audit
athena check / athena semver-checkPre-commit and CI release gates (JSON, SARIF, HTML)
athena doctorEnvironment and toolchain diagnostics

The full reference for all 21 subcommands is in docs/cli-examples.md.

AI-Assisted Repair

athena repair sends only the affected caller slices, the definition diff, and any files flagged by compiler or test errors to the model. Edits are restricted to an allowlist of files inside the repository, guarded against syntax errors and test tampering, and verified before being kept.

bash
# Hand context to the active MCP agent (Claude Code, Codex, Cursor)
athena repair . --base main --target WORKING_TREE --provider handoff

# Local model through Ollama
athena repair . --base main --target WORKING_TREE --provider ollama --model qwen3:8b --apply

# Any OpenAI-compatible endpoint
athena repair . --base main --target WORKING_TREE --provider openai-compat \
  --base-url <endpoint-url> --model <model-name> --apply

Supported providers: handoff, ollama, openai-compat, anthropic, claude-code, codex, cursor, hermes, and pi. Use --provider auto to select the first available provider.

Recommendation: On machines with limited GPU memory, keep detection and verification local and use handoff or a hosted model for complex semantic refactors.

MCP and CI Integration

Athena exposes 18 MCP tools, 6 resources, and 4 workflow prompts over stdio or loopback HTTP.

bash
# Generate client configuration (cursor, claude-desktop, vscode)
athena init-mcp cursor

# Start a read-only MCP server
athena mcp --toolsets git,graph,analysis,testing,evidence --read-only

GitHub Actions:

yaml
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
  with:
    fetch-depth: 0
- uses: aaryanrwt/athena@v1.4.0

Docker, pre-commit hooks, optional Rust acceleration, and provider configuration are covered in docs/integrations.md.

Benchmarks

All results are measured on real open-source commit history. No results are filtered or simulated.

Deterministic core (no AI)

MetricResult
Historical breaking commits replayed74 commits, 15 repositories, 14 languages
False edits0 across 94 real commits
False green verifications0
Impacted test recall60.75% (top 20), 79.56% (unlimited)
Live toolchain verification13 of 14 languages
Rollback integrity18 of 18 bit-exact

AI-assisted repair: 50 unfiltered Python commits across 11 repositories

ModelPass@1Pass@3Rollback integrityFalse greens
nemotron-3-ultra-550b (hosted)6.0%8.0%46 of 460
qwen3:8b (local, Ollama)4.0%8.0%46 of 460

AI-assisted repair: 12 curated commits across 5 languages

ModelPass@1Pass@3
nemotron-3-ultra-550b (hosted)50.0%50.0%
laguna-xs-2.1 (hosted)16.7%33.3%
qwen2.5-coder:7b (local, Ollama)16.7%16.7%

The unfiltered suite is intentionally harder: most upstream breaking commits change several modules and tests together, so no caller-only repair can pass. In every unsuccessful case, verification rejected the change and the repository was restored exactly. Methodology and per-repository results are in docs/evaluation.md.

Documentation

Star History

Athena Star History

License

Released under the Apache 2.0 License. Maintained by Aaryan Rawat.