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.
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 load → batho patch → batho 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
- Quick Start — CLI setup guide
- Setup with AI Agent Skill — Let your agent set up Batho
- MCP Server — Connect AI agents to your code graph
- Whitepaper — Deep technical reference
- CLI Reference — Complete command documentation
- CI/CD — GitHub Actions, GitLab CI, and more
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file batho-1.2.1.tar.gz.
File metadata
- Download URL: batho-1.2.1.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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
56786090889c0623f4e2ddaa29709a6b28c0f7599d427761639bd559ea52bde0
|
|
| MD5 |
d27715bb3ea059ba07286d45d1c24a03
|
|
| BLAKE2b-256 |
8a4e5d074d71a0c052bb3ff3e19abaf38523675d7232e21fb469ac6466baa659
|
File details
Details for the file batho-1.2.1-py3-none-any.whl.
File metadata
- Download URL: batho-1.2.1-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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
fe45a31de2645d1500d27058b1e2d175b32e74258e85bedc9bd9c19eeb672bc0
|
|
| MD5 |
4597d496aef6fbb0f08417e51dda23e6
|
|
| BLAKE2b-256 |
7e82fc782f3f54c161e740faf7aef95696afb6ed6ca27730682bf542c811590e
|