toji
Codebase graph memory: index structure once, answer with evidence forever.
toji parses your codebase (Python, TypeScript, TSX, JavaScript) into a queryable
graph — symbols, signatures, docstrings, call/import/inherit edges — stored in
SQLite. No source is stored; read always fetches live lines from disk. Awesome no?
Built for AI reviewers and anyone tired of skimming ten files to answer
"who calls this?": every answer carries exact path:line evidence, ambiguous
names are surfaced instead of guessed, and unresolved calls are reported as
unknown rather than invented.
Install
pip install toji # or: uv tool install toji
Or install as an agent skill (instructions for AI coding agents):
npx skills add mr-jones123/toji
Quickstart
toji index . # index current directory -> .toji/graph.db
toji map src/ # skeleton of a module: symbols, signatures, docstrings
toji find "classify" # regex search over symbol names
toji callers classify_change # who calls it, with file:line evidence
toji blast classify_change # BFS blast radius: what a change affects, hop-ranked
toji read classify_change # the symbol's actual source lines
Reindexing is incremental and content-hashed: only changed files re-parse. A full 12k-file monorepo indexes in ~40s; unchanged reindex scans are sub-second.
Commands
| Command | Evidence returned |
|---|---|
index [PATH] [--force] |
build/rebuild the graph (incremental by content hash) |
map [FILE|SYM] |
file skeleton or symbol detail |
find <regex> |
matching symbols |
calls <sym> |
forward call edges + unresolved callees |
callers <sym> |
reverse call edges (1 hop) |
blast <sym> [--depth N] [--forward] |
affected symbols across calls/contains/inherits |
deps <file> |
import edges both directions, resolved to files |
read <sym> |
the symbol's live source lines from disk |
stats |
index size, resolution quality metrics |
Every command accepts --json for stable machine-readable output.
How resolution works
Call edges store the callee as written (obj.method, helper). At query
time they resolve through file-local scopes, the importing file's own imports,
then global unique suffix/bare-name matches:
- Confident matches resolve with the exact call-site line attached.
- Ambiguous names list every candidate instead of guessing.
- Unresolved calls (stdlib, dynamic dispatch) are counted and shown —
never fabricated.
toji statsreports the ratio so you know what the graph is confident about.
blast and callers merge same-named definitions (e.g. a method implemented
by several cloud adapters) and traverse from all of them, reporting the count;
read, calls, and map require a single symbol and will ask you to
disambiguate instead.
Releasing
Conventional Commits drive versions automatically on push to main
(fix: → patch, feat: → minor, BREAKING CHANGE: → major). The release
workflow tests, bumps the version, generates the changelog, tags, builds, and
publishes to PyPI. Configure either PyPI trusted publishing or a PYPI_TOKEN
secret to enable publishing.
License
TBD.
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 toji-0.1.3.tar.gz.
File metadata
- Download URL: toji-0.1.3.tar.gz
- Upload date:
- Size: 84.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via:
uv/0.12.5 {"installer":{"name":"uv","version":"0.12.5","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
cd783805ffd83db58cebb2bb16c3f74fc4467e1d1ee46f15992f5116dcf96e77
|
|
| MD5 |
ab0b07c1496a8a973c895b469211bcb4
|
|
| BLAKE2b-256 |
bf5891f7de7ed636a8a7f29f6beed5ce6efb287debd365223fdac1a6fd84fc02
|
File details
Details for the file toji-0.1.3-py3-none-any.whl.
File metadata
- Download URL: toji-0.1.3-py3-none-any.whl
- Upload date:
- Size: 23.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via:
uv/0.12.5 {"installer":{"name":"uv","version":"0.12.5","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
645ee8fef554b45b97a82bcef7051cb835e1ca06a49c0f555e07e7f820fe01ba
|
|
| MD5 |
4958fbb4ea327cbb44caa48e4b545f5b
|
|
| BLAKE2b-256 |
55b6256693f0bd18b00c8df3a2b96a0607d48a978667218e77ba768e91eedee4
|