Athena
Your git diff says it is safe. Athena checks the callers.
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
astand 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,
Noneguards, 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
- Quick Start
- How It Works
- AI-Assisted Repair
- MCP and CI Integration
- Benchmarks
- Documentation
- Star History
- License
Installation
Requires Python 3.13 or later and Git.
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
# 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
flowchart LR
Map["Map and Graph"] --> Detect["Detect Breaking Changes"]
Detect --> Fix["Fix or Repair"]
Fix --> Verify["Verify or Roll Back"]
- Map.
athena mapandathena graphindex exports and call sites into a local graph at.athena/graph.json. - Detect.
athena breaking-changesidentifies removed symbols, new required parameters, changed defaults, and argument shifts, then traces every affected caller. Dynamic code paths such asgetattrandevalare reported as partial rather than silently ignored. - Fix.
athena fixapplies patches only when they are provably safe. Semantic changes are routed to review or to AI-assisted repair. - Verify.
athena verify-fixruns the relevant toolchain (for examplepytest,mypy,go test,cargo test,tsc,dotnet test,mvn test) and returnsverified_passonly 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.
| Command | Purpose |
|---|---|
athena map / athena graph | Architectural overview and code graph queries |
athena breaking-changes | AST diff audit with caller blast radius |
athena affected-tests | Ranked impacted test selection |
athena fix | Preview or apply deterministic safe patches |
athena repair | Closed-loop deterministic and AI repair with rollback |
athena verify-fix | Compiler, type checker, test, and AST re-audit |
athena check / athena semver-check | Pre-commit and CI release gates (JSON, SARIF, HTML) |
athena doctor | Environment 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.
# 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
handoffor 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.
# 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:
- 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)
| Metric | Result |
|---|---|
| Historical breaking commits replayed | 74 commits, 15 repositories, 14 languages |
| False edits | 0 across 94 real commits |
| False green verifications | 0 |
| Impacted test recall | 60.75% (top 20), 79.56% (unlimited) |
| Live toolchain verification | 13 of 14 languages |
| Rollback integrity | 18 of 18 bit-exact |
AI-assisted repair: 50 unfiltered Python commits across 11 repositories
| Model | Pass@1 | Pass@3 | Rollback integrity | False greens |
|---|---|---|---|---|
nemotron-3-ultra-550b (hosted) | 6.0% | 8.0% | 46 of 46 | 0 |
qwen3:8b (local, Ollama) | 4.0% | 8.0% | 46 of 46 | 0 |
AI-assisted repair: 12 curated commits across 5 languages
| Model | Pass@1 | Pass@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
- CLI Reference
- Evaluation and Methodology
- Integrations: CI, Docker, MCP, AI Providers
- Changelog
- Security Policy
- Contributing
Star History
License
Released under the Apache 2.0 License. Maintained by Aaryan Rawat.