Skip to main content

gitcortex

A code knowledge graph for Git repositories. GitCortex indexes your codebase on every commit and answers questions like "what calls this function?" or "what changed between these two branches?" — so your AI coding assistant can work with real structure instead of scanning raw files.

Install

pip install gitcortex
# or
pipx install gitcortex
# or
uv tool install gitcortex

Supports macOS (Apple Silicon + Intel), Linux (x86_64 + arm64), and Windows (x64). No Rust or compiler required — a pre-built binary is bundled in the wheel.

Quick start

cd your-repo
gcx init       # index the repo + install git hooks
gcx serve      # start the MCP server for your AI assistant

After gcx init, the graph updates automatically on every git commit, merge, rebase, and checkout. No manual re-runs needed.

What it does

GitCortex builds a queryable graph of your codebase — functions, structs, classes, interfaces, call relationships, inheritance chains — and keeps it current automatically.

  • Works with: Rust, Python, TypeScript, JavaScript, Go, Java
  • Integrates with: Claude Code, Cursor, Windsurf, GitHub Copilot, Antigravity
  • Per-branch graphs: switching branches gives you the graph for that branch instantly
  • Zero runtime dependency: single self-contained binary, nothing else to install

Commands

gcx init

Index the current repo, install git hooks, and register the MCP server with your editor.

gcx init                     # auto-detects your editor
gcx init --editor cursor     # target a specific editor: claude, cursor, windsurf, copilot
gcx init --editor all        # write configs for every supported editor

gcx serve

Start the MCP server so your AI assistant can query the knowledge graph.

gcx serve

Once running, your AI assistant has access to tools like find_callers, lookup_symbol, list_definitions, trace_path, and more.

gcx query

Query the graph from the terminal without an AI assistant.

gcx query lookup-symbol MyStruct
gcx query find-callers process_request
gcx query list-definitions src/lib.rs

gcx blast-radius

See which parts of the codebase are affected by changes between two branches — useful before merging.

gcx blast-radius --base main --head feat/my-feature
gcx blast-radius --base main --head feat/my-feature --format github-comment

gcx viz

Open an interactive graph in your browser.

gcx viz                         # opens on port 5678
gcx viz --port 9000
gcx viz --branch feat/my-feature
gcx viz --format dot > graph.dot   # export as Graphviz DOT

gcx export

Generate a readable Markdown map of the codebase at .gitcortex/context.md. The git hook keeps it up to date automatically.

gcx export

gcx status

Show node and edge counts for the current branch.

gcx status

gcx clean

Wipe the local graph store and re-index from scratch on the next commit.

gcx clean

MCP tools available to your AI assistant

Tool What it answers
lookup_symbol Where is MyStruct defined?
find_callers What calls process_request?
find_callees What does handle_request call?
list_definitions What's defined in src/auth.rs?
find_implementors What implements AuthProvider?
trace_path How do you get from main to validate_token?
find_unused_symbols What's never called (dead code candidates)?
get_subgraph Everything within 2 hops of UserService
detect_changes What changed + who's affected vs main?
symbol_context Callers, callees, and uses for a symbol

All tools accept an optional branch parameter.

Configuration

.gitcortex/config.toml (committed to your repo, shared with your team):

[index]
languages = ["rust", "typescript", "python", "go"]
max_file_size_kb = 500

.gitcortex/ignore (.gitignore syntax — files to exclude from indexing):

target/
build/
**/*.generated.rs

License

MIT — free for commercial and open-source use.

GitHub · Issues

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

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

gitcortex-0.7.5-py3-none-manylinux2014_x86_64.whl (21.6 MB view details)

Uploaded Python 3

gitcortex-0.7.5-py3-none-manylinux2014_aarch64.whl (19.1 MB view details)

Uploaded Python 3

gitcortex-0.7.5-py3-none-macosx_11_0_arm64.whl (15.6 MB view details)

Uploaded Python 3macOS 11.0+ ARM64

gitcortex-0.7.5-py3-none-macosx_10_12_x86_64.whl (17.4 MB view details)

Uploaded Python 3macOS 10.12+ x86-64

File details

Details for the file gitcortex-0.7.5-py3-none-manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for gitcortex-0.7.5-py3-none-manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 0b5aded465311f67bdc8819d1fef3f0adec3cdeda035c2adc47ec5b82636f6b5
MD5 c25b99553bf815772ae2239bdb757dc3
BLAKE2b-256 79550e4df256db7e195aaf4375a3d25150a7156e57cd6f9132cdcf36eac1f177

See more details on using hashes here.

File details

Details for the file gitcortex-0.7.5-py3-none-manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for gitcortex-0.7.5-py3-none-manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 a18cc7d9a58586c83c6d5677d2c6502427aed8002b4cd60bb9d409b039911a10
MD5 c6aa390fb81920d19a11df0962f7056c
BLAKE2b-256 59d3fed97e5e6bba3ec2276e0377fafc372c9091b997de85519cac83400d3f41

See more details on using hashes here.

File details

Details for the file gitcortex-0.7.5-py3-none-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for gitcortex-0.7.5-py3-none-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 630ca553c530c68d410490967ebc858a19a1f36fcdd5733c7978224f010dd04e
MD5 28e463132cb0db603f5d76d51f9a7068
BLAKE2b-256 c684d8c540264d1006c365364561fbbccbb4442790ff26cd3076af4e072530c3

See more details on using hashes here.

File details

Details for the file gitcortex-0.7.5-py3-none-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for gitcortex-0.7.5-py3-none-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 ff78ff79d424492b990765e7a82cbb32353481537592abf94733e54ac1f3cd37
MD5 842ef984c4107b5fb75dd13b060bec69
BLAKE2b-256 6dabb00f335c8a4501d61c8c1d5df25576226ff9d901144836b608bf954b5020

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

0.7.5 This release

4 files

0.7.3

4 files

0.7.2

4 files

0.7.1

4 files

0.7.0

4 files

0.6.3

4 files

0.6.0

4 files

0.5.1

4 files

0.5.0

4 files

0.4.0

4 files

0.3.0

4 files

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page