Skip to main content

Batho

B.A.T.H.O

Give your AI coding agent a map of your codebase — not the whole territory.
Reduce token spend 10x, eliminate hallucinations, and ship faster with graph-powered code intelligence.

PyPI License Documentation Stars

Works with: Claude Code · Cursor · Windsurf · Antigravity · Gemini CLI · Cline · OpenCode · Aider


Quick Setup

The fastest way to set up Batho: give the skill file to your AI agent and let it do everything for you.

1. Download the skill file

curl -O https://raw.githubusercontent.com/sageoz/batho/main/SKILL.md

2. Give it to your AI agent

Paste this into your agent's chat (Claude Code, Cursor, Windsurf, or any agent that supports skills):

Read SKILL.md and set up Batho for this repo

3. Your agent handles the rest

  • Installs Batho globally (pip / uv / pipx)
  • Builds the code graph for your repository
  • Auto-detects all installed AI clients (Claude Desktop, Cursor, Windsurf, VS Code)
  • Configures MCP for each client
  • Verifies the setup works end-to-end

No manual JSON editing. No config file hunting. Your agent does it all.

Multi-repo? Your agent can register multiple repos via the MCP registry — one config serves all. See the Multi-Repo Guide.

Manual Setup (CLI)

Prefer the terminal? Batho works with zero config:

# Install
pip install batho

# Build the code graph
batho build --root . --verbose

# Start the MCP server
batho mcp

Then add to your agent's MCP config:

{
  "mcpServers": {
    "batho": { "command": "batho", "args": ["mcp"] }
  }
}

Full setup guide: docs


Why Batho?

AI coding agents are powerful — but they burn tokens reading files and hallucinate when context is thin. Batho gives your agent a structured code graph so it works smarter, not harder.

  • Slash token costs — Your agent queries a graph instead of reading entire files. 10x fewer tokens per task — no more dumping your repo into the LLM.
  • Eliminate hallucinations — Deterministic, tree-sitter-parsed relationships. Your agent gets facts, not guesses — zero hallucinations on structural queries.
  • Agent superpowers — Bug tracking, security audits, refactoring, code review — your agent handles more, accurately. When cost and quality are solved, automation widens with imagination.

MCP Tools

Batho exposes 10 MCP tools your AI agent can call:

Tool Purpose
graph_overview High-level codebase summary: entities, relationships, communities
graph_query Filtered graph query by file, type, or name pattern
get_entity Detailed info for a single entity + relationships
trace_path Shortest path between two entities (BFS)
get_file_graph All entities and relationships in a file
search_entities Substring/regex search across entity names
get_delta Incremental changes from the latest patch
list_repos List all registered repos with status
add_repo Register a repository in the MCP registry
remove_repo Remove a repository from the registry

Full reference: docs


Features

  • 40+ languages — Python, TypeScript, Rust, Go, Java, C/C++ and more via tree-sitter
  • 10x token compression — your agent uses a fraction of the context window
  • Zero hallucinations — deterministic AST-parsed relationships, not embeddings or guesses
  • Fast incremental updates — hash-based change detection re-parses only modified files
  • Cross-file symbol resolution — your agent sees how functions, classes, and dependencies connect
  • 38 built-in analysis plugins — security, quality, and optimization rules with custom rule support
  • Time-machine — node-level diff history across every indexed run
  • Zero code execution — safe to run in CI or on untrusted repositories
  • MCP-native — works with 8 AI coding agents out of the box

CI/CD

Batho's CI/CD strategy is incremental: download the previous artifact → batho loadbatho patchbatho export → upload.

GitHub Actions composite action:

- uses: sageoz/batho@v1.2.0
  with:
    root: "."
    artifact-name: "batho-index"

Full CI/CD guides (GitHub Actions, GitLab CI, reusable workflows): docs


Configuration

Batho runs with zero config. To customize, copy batho.yaml.example to ./batho.yaml.

Full configuration reference: docs


Developer Setup

git clone https://github.com/sageoz/batho.git
cd batho
uv sync --all-groups --all-extras
uv run pytest
uv run python batho_cli.py --help

Documentation


Acknowledgments

Co-authored with Devin — autonomous AI software engineer by Cognition.


License

Apache License 2.0 — see LICENSE for details.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

batho-1.2.0.tar.gz (286.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

batho-1.2.0-py3-none-any.whl (374.6 kB view details)

Uploaded Python 3

File details

Details for the file batho-1.2.0.tar.gz.

File metadata

  • Download URL: batho-1.2.0.tar.gz
  • Upload date:
  • Size: 286.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for batho-1.2.0.tar.gz
Algorithm Hash digest
SHA256 e9cda1ecf1f0536a70d516c8923967ad88ce7ff3d2a82d38fce62bf5fbc576a7
MD5 3211f54ac4a1728146357637d7006dd5
BLAKE2b-256 4c354db9c135f178a7ddf43676fb69e93457fe0e527fd62e0c70c654f927d264

See more details on using hashes here.

File details

Details for the file batho-1.2.0-py3-none-any.whl.

File metadata

  • Download URL: batho-1.2.0-py3-none-any.whl
  • Upload date:
  • Size: 374.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for batho-1.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 d26ababda73db2088056e2f1248c0d2e8ec6bae23284f305d6f815d050e62937
MD5 bb7460d4b7d89f34e965ef6e7e03a25a
BLAKE2b-256 46e20b90fbb947080d3f8014b621e352c270332a778ad3c0b918a8ee2521ce08

See more details on using hashes here.

Release history Release notifications | RSS feed

1.4.1

2 files

1.4.0

2 files

1.3.2

2 files

1.3.1

2 files

1.3.0

2 files

1.2.1

2 files

This release

1.2.0 This release

2 files

1.1.0

2 files

1.0.0

2 files

0.1.4

2 files

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