crowl

module
v0.5.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 29, 2026 License: MIT

README

Crowl

AI-native, commit-driven knowledge graph for source code. Built on git, MIT-licensed.

Crowl lets developers and AI agents navigate a codebase across structure, dependencies, and history — composing static graph queries with a temporal layer (drift, blame, why, as-of, history) that persists across sessions.

Five languages supported out of the box: Go, TypeScript, Python, Java, Rust. One unified tree-sitter pipeline does symbols, edges, type inference, and cross-file call resolution; Go gets an additional go/types-based pass for cross-package interface satisfaction.

Quick start

# Build
go build -o crowl ./cmd/crowl

# Index a repo (Go / TypeScript / Python / Java / Rust all picked up)
./crowl analyze --repo /path/to/repo

# Look up a symbol at HEAD
./crowl query --repo /path/to/repo 'github.com/foo/bar.User.Save'

# Impact (upstream callers, blast radius)
./crowl impact --repo /path/to/repo 'github.com/foo/bar.User.Save'

# Blame (commits that touched this symbol)
./crowl blame --repo /path/to/repo 'github.com/foo/bar.User.Save'

# Why (chronological narrative — commits + messages + authors)
./crowl why --repo /path/to/repo 'github.com/foo/bar.User.Save'

# Drift (what changed since a historical commit)
./crowl drift --repo /path/to/repo --since <sha>

# History (lineage chain across renames)
./crowl history --repo /path/to/repo 'github.com/foo/bar.User.Save'

# Repo summary
./crowl status --repo /path/to/repo

# MCP stdio server (point your AI client at this command)
./crowl mcp --repo /path/to/repo

State lives at ~/.crowl/index/<repo-id>.db (SQLite). Repo identity defaults to a slug of git remote origin, falling back to local_<root-commit-prefix>. Override with --name <alias>.

Languages

All 5 languages get the same edge surface: Contains, HasMethod, HasField, Implements, Extends, Calls, Returns, Accepts. The tree-sitter pipeline does the heavy lifting; Go gets an extra go/types post-pass for cross-package interface satisfaction.

Language Notes
Go Full coverage. go/types post-pass adds cross-package Implements edges. Switch to --extractor=types for maximum call-resolution precision.
TypeScript .ts and .tsx. Module-path FQNs derived from file path.
Python PEP 484 annotations + walk-and-fixpoint for unannotated locals. __init__.py-bounded module paths.
Java Package-aware FQNs from package x.y.z; declarations.
Rust ::-separated FQNs. Trait + impl heritage edges.
Extractor backends
--extractor= What runs
treesitter (default) Unified tree-sitter pipeline for all 5 languages, plus go/types Implements post-pass for Go
types Legacy go/types extractor for Go (richer call-resolution precision); per-language tree-sitter for TS/Python; Java/Rust unsupported in this mode

MCP tools (for AI agents)

crowl mcp exposes 9 tools: crowl_query_symbol, crowl_neighbors, crowl_impact, crowl_blame, crowl_history, crowl_as_of, crowl_list, crowl_drift, crowl_why.

Build

crowl builds as a single binary. The default build pulls in smacker/go-tree-sitter for the unified extraction pipeline (CGo). Tree-sitter grammars for Go, TypeScript, Python, Java, and Rust are all bundled — no per-language tooling installs required.

Running the test suite

go test ./... -count=1
# Or the full local gate (matches what CI runs):
make verify

Engineering guidelines

See CLAUDE.md — behavioral guidelines for working on this code (think before coding, simplicity first, surgical changes, goal-driven execution, plus 13 Crowl-specific Go rules).

See CONTRIBUTING.md for the contributor workflow: prerequisites, make verify, what each gate enforces.

License

MIT. No CLA. See LICENSE.

Directories

Path Synopsis
cmd
crowl command
Command crowl is the v0.1 CLI entrypoint.
Command crowl is the v0.1 CLI entrypoint.
internal
cli
Package cli wires Pipeline / Query / Store / Extractor / Source into user-facing commands.
Package cli wires Pipeline / Query / Store / Extractor / Source into user-facing commands.
core
Package core defines the L0 contracts for Crowl: types, interfaces, hashing, and format version constants.
Package core defines the L0 contracts for Crowl: types, interfaces, hashing, and format version constants.
extract
Package extract defines the Extractor interface (FOUNDATION §5).
Package extract defines the Extractor interface (FOUNDATION §5).
extract/golang
Package golang implements the Go-language extractor using the standard library (go/parser, go/ast, go/token, go/types) plus golang.org/x/tools/go/packages for module-aware loading.
Package golang implements the Go-language extractor using the standard library (go/parser, go/ast, go/token, go/types) plus golang.org/x/tools/go/packages for module-aware loading.
extract/golang/fqn
Package fqn centralizes Go FQN composition.
Package fqn centralizes Go FQN composition.
extract/golang/implements
Package implements computes Go cross-package interface satisfaction edges using go/types, intended as a post-pass on top of the tspipeline tree-sitter Go provider.
Package implements computes Go cross-package interface satisfaction edges using go/types, intended as a post-pass on top of the tspipeline tree-sitter Go provider.
extract/python
Package python implements a Python extractor backed by tree-sitter.
Package python implements a Python extractor backed by tree-sitter.
extract/scope
Package scope is the cross-extractor pre-filter that decides whether a file should be considered for symbol extraction.
Package scope is the cross-extractor pre-filter that decides whether a file should be considered for symbol extraction.
extract/tspipeline
Package tspipeline implements the v0.5 unified tree-sitter extraction pipeline.
Package tspipeline implements the v0.5 unified tree-sitter extraction pipeline.
extract/tspipeline/languages/golang
Package golang is the v0.5 tspipeline LanguageProvider for Go via tree-sitter.
Package golang is the v0.5 tspipeline LanguageProvider for Go via tree-sitter.
extract/tspipeline/languages/java
Package java is the v0.5 tspipeline LanguageProvider for Java.
Package java is the v0.5 tspipeline LanguageProvider for Java.
extract/tspipeline/languages/python
Package python is the v0.5 tspipeline LanguageProvider for Python.
Package python is the v0.5 tspipeline LanguageProvider for Python.
extract/tspipeline/languages/rust
Package rust is the v0.5 tspipeline LanguageProvider for Rust.
Package rust is the v0.5 tspipeline LanguageProvider for Rust.
extract/tspipeline/languages/typescript
Package typescript is the v0.5 tspipeline LanguageProvider for TypeScript (and .tsx).
Package typescript is the v0.5 tspipeline LanguageProvider for TypeScript (and .tsx).
extract/typescript
Package typescript implements a v0.3 TypeScript extractor backed by tree-sitter.
Package typescript implements a v0.3 TypeScript extractor backed by tree-sitter.
lineage
Package lineage implements rename detection for v0.1: body-hash exact match.
Package lineage implements rename detection for v0.1: body-hash exact match.
mcp
Package mcp implements a minimal Model Context Protocol server over stdio, exposing the Crowl Query primitives as tools.
Package mcp implements a minimal Model Context Protocol server over stdio, exposing the Crowl Query primitives as tools.
migrate
Package migrate forward-migrates record types across format versions.
Package migrate forward-migrates record types across format versions.
mutate
Package mutate orchestrates the per-commit mutation flow: extract → diff against parent KC → write CommitWriter → produce KC.
Package mutate orchestrates the per-commit mutation flow: extract → diff against parent KC → write CommitWriter → produce KC.
pipeline
Package pipeline orchestrates per-commit processing.
Package pipeline orchestrates per-commit processing.
query
Package query implements the L1 read-side primitives over a core.Store.
Package query implements the L1 read-side primitives over a core.Store.
source
Package source provides implementations of mutate.SourceProvider — objects that can hand the Mutator a source tree, commit message, and commit metadata for a given git SHA.
Package source provides implementations of mutate.SourceProvider — objects that can hand the Mutator a source tree, commit message, and commit metadata for a given git SHA.
store/memory
Package memory implements core.Store entirely in memory.
Package memory implements core.Store entirely in memory.
store/sqlite
Package sqlite implements core.Store backed by SQLite (modernc.org/sqlite, pure Go, no CGo).
Package sqlite implements core.Store backed by SQLite (modernc.org/sqlite, pure Go, no CGo).

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL