Skip to main content

toji

Codebase graph memory: index structure once, answer with evidence forever.

PyPI Python Release License

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 stats reports 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

toji-0.1.2.tar.gz (84.3 kB view details)

Uploaded Source

Built Distribution

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

toji-0.1.2-py3-none-any.whl (23.8 kB view details)

Uploaded Python 3

File details

Details for the file toji-0.1.2.tar.gz.

File metadata

  • Download URL: toji-0.1.2.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

Hashes for toji-0.1.2.tar.gz
Algorithm Hash digest
SHA256 e3a9cfacd2643408e088e24b54ef553b49870ea44a10e481a2473cf7b4413f02
MD5 c1d2ceb84af622a621fe0b1087483af8
BLAKE2b-256 91a1d7a501692307516940eec88ccf150b676a83d4d6fe957703285910cc681a

See more details on using hashes here.

File details

Details for the file toji-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: toji-0.1.2-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

Hashes for toji-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 1e02f54e9dff5a8b0e35269eb79293c263cf2291ed9355641609a496afc7301e
MD5 c588acf8f3a6d568172f56797526291f
BLAKE2b-256 ecf01561996230e7dfb07daec57b33129b8812385f25db537bc9df1a48e03e12

See more details on using hashes here.

Release history Release notifications | RSS feed

0.1.3

2 files

This release

0.1.2 This release

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