Skip to main content

CodeAtlas

CI PyPI Python Zero Dependencies License: MIT

Zero-config local codebase architecture, call-graph, blast-radius & MCP tool.

Inspect functions, classes, call-graph hubs, unreferenced ("dead") code, circular dependencies, and shortest call paths in your terminal or browser—with zero cloud uploads, zero configuration files, and zero runtime dependencies for the CLI.

CodeAtlas interactive Svelte call-graph demo

More screenshots (Overview, Focus 1-hop, File-level Graph)
Symbol Graph & Path Finder Focus 1-Hop Isolation File Dependency Map
CodeAtlas Symbol Graph CodeAtlas Focus 1-Hop CodeAtlas File Graph

Key Features

  • Zero Runtime Dependencies: Pure Python standard-library CLI (pip / pipx ready), with optional codeatlas-viz[treesitter] extra for Tree-sitter AST parsing.
  • Multi-Language Analysis (9 Languages):
    • Python: Full iterative ast parsing for classes, methods, nested functions, docstrings, relative imports, and import aliases.
    • JavaScript / TypeScript / Svelte: Structural analysis (or optional Tree-sitter AST) of functions, arrow functions, ES6 classes, methods, getters/setters, class arrow properties, and <script> blocks.
    • Go / Rust / Java / C / C++: Structural parsing (or optional Tree-sitter AST) of structs, traits/impl blocks, receiver methods, classes, and member call sites.
  • Change Impact / Blast Radius (codeatlas impact):
    • Reads local git diff (or explicit --file / --symbol / --diff REF) and traces every upstream caller, affected entrypoint, and test reaching changed code.
  • CI Architecture Gate (codeatlas check):
    • Enforces --max-cycles, --min-health, --max-dead-ratio, and module boundary rules (--rule ui/*:db/* or .codeatlas.toml) in CI pipelines.
  • Built-in Stdio MCP Server (codeatlas mcp):
    • Zero-dependency Model Context Protocol server exposing call-graph, shortest-path, dead-code, and blast-radius tools to Claude Code, Cursor, or Windsurf.
  • Architectural Health Score & Standalone Exports (export):
    • Computes a 0–100 repository health score and exports standalone .html, GitHub-flavored .md, .mmd (Mermaid), and .json.
  • Interactive Svelte 5 Web UI (codeatlas serve):
    • Switch between Symbol, File, and Folder Cluster views with interactive folder drill-down and spatial grid force layout.
    • Hubs, Circular Dependencies (Cycles), Unreferenced (Dead), and Blast Radius (Impact) tabs.
    • Shortest Call-Path Finder (BFS): Highlight the exact call chain (A → ... → B) between any two symbols.
    • Focus 1-Hop Mode, Live Source Preview, and .svg/.mmd downloads.

Architecture Overview

flowchart LR
    CLI["cli.py (main)"] --> Scanner["scanner.py (scan_directory)"]
    CLI --> Server["server.py (serve_graph)"]
    Scanner --> AnalyzerRegistry["analyzers/__init__.py (analyze_file)"]
    AnalyzerRegistry --> PyAnalyzer["python_analyzer.py (analyze_python)"]
    AnalyzerRegistry --> JsAnalyzer["js_analyzer.py (analyze_js)"]
    Scanner --> GraphModel["models.py (CodeGraph)"]
    Server --> WebUI["Svelte 5 Web UI (/api/graph & /api/file)"]

Installation

# Run directly with pipx / uvx
pipx install codeatlas-viz

# Optional: install Tree-sitter AST backend for non-Python languages
pip install "codeatlas-viz[treesitter]"

# Or install from source
git clone https://github.com/kutyfuty/codeatlas.git
cd codeatlas
pip install -e .

Usage

1. Terminal Summary (scan)

codeatlas .
# or explicitly:
codeatlas scan /path/to/repo

2. Interactive Web UI (serve)

codeatlas serve .
# Custom port / without auto-opening browser:
codeatlas serve /path/to/repo --port 4173 --no-open

The UI server listens on 127.0.0.1 only, previews nothing but the scanned source files, and refuses requests from other websites (no CORS, Host-header and Sec-Fetch-Site checks). Passing --host 0.0.0.0 exposes your source code to everyone on the network.

3. Export Graph (export)

# Export as self-contained single-file HTML report
codeatlas export . --format html -o report.html

# Export as GitHub-flavored Markdown summary (great for PR comments / CI)
codeatlas export . --format markdown -o SUMMARY.md

# Export as Mermaid flowchart
codeatlas export . --format mermaid -o architecture.mmd

# Export full graph analytics as JSON
codeatlas export . --format json -o graph.json

4. Change Blast Radius (impact)

# Trace upstream callers, entrypoints & tests affected by git working-tree diff
codeatlas impact .

# Or check a specific git diff / file / symbol as Markdown (ideal for PR comments)
codeatlas impact . --diff HEAD~1 --format markdown
codeatlas impact . --symbol scan_directory

5. CI Architecture Gate (check) & Baseline Diff (diff)

# Enforce rules on the full repo
codeatlas check . --max-cycles 0 --min-health 80 --rule "src/ui/*:src/db/*"

# Baseline mode: ignore pre-existing tech debt, fail ONLY on new cycles or rule violations
codeatlas check . --baseline origin/main --max-cycles 0

# Architecture diff + PR blast-radius Markdown report
codeatlas diff . --base origin/main --with-impact --format markdown

Or define persistent rules in .codeatlas.toml:

[check]
max_cycles = 0
min_health = 80

[[rules]]
name = "UI must go through service layer"
from = "src/ui/*"
forbid = "src/db/*"

6. GitHub Action (Automated PR Architecture Comments & CI Gate)

Drop this into .github/workflows/codeatlas.yml to post a deduplicated Blast Radius & Architecture Diff comment on every Pull Request and block newly introduced cycles:

name: CodeAtlas Architecture
on: [pull_request]
permissions:
  contents: read
  pull-requests: write

jobs:
  architecture:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
        with:
          fetch-depth: 0
      - uses: kutyfuty/codeatlas@v0.4.0
        with:
          baseline-only: "true"
          comment-on-pr: "true"

7. Built-in MCP Server (mcp)

Add CodeAtlas to Claude Code / Cursor / Windsurf via zero-dependency stdio JSON-RPC:

{
  "mcpServers": {
    "codeatlas": {
      "command": "codeatlas",
      "args": ["mcp", "/path/to/repo"]
    }
  }
}

Development & Testing

# Backend tests
pip install -e ".[dev]"
pytest -v

# Rebuild Svelte static bundle (outputs to src/codeatlas/web/)
cd frontend
npm install
npm run build

License

MIT

Metadata

Release files for codeatlas-viz 0.4.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for codeatlas-viz 0.4.2
File Size Uploaded Provenance Actions
codeatlas_viz-0.4.2.tar.gz 91.1 kB With provenance Details for codeatlas_viz-0.4.2.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for codeatlas-viz 0.4.2
File Interpreter ABI Platform Actions
codeatlas_viz-0.4.2-py3-none-any.whl Python 3 none any Details for codeatlas_viz-0.4.2-py3-none-any.whl

Total release size: 173.0 kB

Release files / codeatlas_viz-0.4.2.tar.gz

Download URL codeatlas_viz-0.4.2.tar.gz
Size 91.1 kB
Tags Source
SHA-256 checksum
How to use checksums
bf3fda20cbf38a417320791b33e56b9e50a4e5253b792060e4bd482b9e9f5685
BLAKE2b-256 checksum
How to use checksums
2def512e4e1bafb5b3196b9f02d6336edef0c8db1dc3f06372b9ed63af0093be
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 29, 2026.

Transparency log

Release files / codeatlas_viz-0.4.2-py3-none-any.whl

Download URL codeatlas_viz-0.4.2-py3-none-any.whl
Size 81.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
23ab2644753ce43aa4705251f194652bad5cd6c550329cba910e6e2baba04b36
BLAKE2b-256 checksum
How to use checksums
de801b0229bbe31517f2cde667ba86e0103edc35b3320e3efe54aa726bda64f3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 29, 2026.

Transparency log

Security for codeatlas-viz 0.4.2

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for codeatlas_viz-0.4.2.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 29, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page