Leviathan
Borrow before you build — a local full-text index of every repository you own, searched in a second before a line of new code is written.
Leviathan is a command-line search index over one developer's own GitHub repositories. It shallow-clones every non-archived repository into a local cache, splits the code into sixty-line chunks and writes them into a SQLite FTS5 index, so that the question "have I already solved this somewhere?" takes one command instead of an afternoon of memory. Search ranks by BM25 with file paths weighted above bodies, filters by language and repository, and prints the best few lines around each hit. Fact cards summarise a repository's languages, licence, dependencies and build recipes, and a reverse dependency lookup lists every repository that uses a package. Indexing your own code means indexing your own mistakes, so the indexer never opens key files, environment files or databases, and drops any chunk that looks like a credential before it is stored. A second phase — searching public open-source code, with a licence gate and a ledger of everything borrowed — exists as a stub. Version 0.1, a working local tool, with no site of its own.
- Python 3.12
- SQLite FTS5
- git
- GitHub CLI
- uv
- just
- pytest
Leviathan answers one question before any new code gets written: have I already built this somewhere? After enough years and enough repositories, the honest answer is usually "yes, in a project I have half forgotten", and finding it by memory is slower than writing it again. Leviathan makes finding it a single command.
Sync, index, find
sync lists every non-archived repository for an account
and an organisation through the GitHub CLI and shallow-clones them
into a local cache, six at a time, with large blobs filtered out and
a stop if free disk drops under ten gigabytes. The clones are a
read-only mirror: their push URL is deliberately set to something
that cannot work. index walks the clones, maps file
extensions to some forty languages, splits each file into sixty-line
chunks and writes them into a SQLite FTS5 table with Porter stemming.
find takes plain words, quoted phrases, OR
and prefix wildcards; words are ANDed and fall back to OR when
nothing matches, hyphenated names are treated as phrases, and hits
are ranked by BM25 with the file path weighted above the body, then
printed with the best few lines around the match. Filters narrow by
language and repository.
Fact cards and dependencies
repo prints a card for one repository — what kind of
project it is, its licence, its languages, the top of its README and
its just recipes — and deps reads every
package.json, go.mod,
pyproject.toml, composer.json and
Cargo.toml to say which repositories already use a
given package, which is often the faster way to find prior art.
An index that will not hold secrets
Your own repositories are exactly where stray credentials live, so the indexer is built not to collect them. It never opens environment files, private keys, certificate bundles, keystores, credential files or databases; it skips dependency and build trees, binaries and anything over 512 KB; and every chunk is checked against patterns for cloud keys, payment-provider keys, source-host and chat tokens, PEM headers and literal password assignments. A matching chunk is dropped, and the run reports only how many were dropped — never what they contained. The clones and the index stay in a local cache and are never committed or pushed anywhere.
Borrowing from outside — phase two
The next step is the same question asked of public code.
oss is a stub today: it searches public GitHub
repositories and marks each result ok to borrow or
look only by licence, where only MIT, Apache-2.0, BSD,
ISC and similar permissive licences qualify. Anything taken gets a
row in a borrowing ledger — source URL at a commit, licence, what
was taken and where it went — and keeps its upstream copyright
notice.
Status
Version 0.1, built in October 2026: a working local tool with tests for chunking, query parsing and the secret filter. The public-code phase is a stub, and there is no site.
Build something like this
Want a tool like this for your shop?
We've shipped this kind of thing before. Twenty-minute intro call, no slides.