Code intelligence for AI agents — local-first structural analysis of git diffs
Project description
GitScope
Catches the bugs that pass code review.
The catch
Flask PR #5898 changed redirect()'s default from 302 to 303. Here's what GitScope finds:
$ gitscope review main..feature
⚠ GitScope: 2 changes need review
1. DEFAULT VALUE CHANGED: redirect(location, code=302) → redirect(location, code=303)
File: src/flask/helpers.py:241
Impact: 5 callers rely on the default:
auth.py:25 `return redirect(url_for("auth.login"))`
auth.py:77 `return redirect(url_for("index"))`
blog.py:81 `return redirect(url_for("blog.index"))`
Review: Verify callers expect HTTP 303 instead of 302
2. BREAKING CHANGE: dispatch_request(self) → dispatch_request(self, ctx: AppContext)
File: src/flask/app.py:965
Impact: 3 external callers need updating:
views.py:78 `return current_app.dispatch_request()`
views.py:110 `rv = self.dispatch_request()`
Review: These callers will break — missing required argument
A code reviewer sees 302 → 303. GitScope sees 5 callers that silently break.
What GitScope is
GitScope is a verification layer for code changes, not a review tool. Reviews give opinions — GitScope gives facts. It uses AST-powered structural analysis of git diffs to catch signature changes, removed symbols, and default value changes, then shows you exactly which callers are affected. 100% precision: when it speaks, it's right. When there's nothing to say, it stays silent.
Quick Start
pip install gitscope
gitscope review main..feature
Exit codes: 0 = nothing noteworthy, 1 = findings, 2 = error.
How It Works
- Parses the diff using tree-sitter AST analysis (not regex)
- Extracts symbols — functions, classes, signatures
- Detects high-signal changes — signature changes, removed symbols, default value changes
- Scans for callers — finds files that reference changed symbols
- Outputs actionable context — or stays silent if nothing matters
Why not X?
vs CodeRabbit — They review your code on their servers for $15–30/seat/month. GitScope runs locally, is free, and catches the structural breaks their LLM misses. They comment on every PR; GitScope only speaks when something is actually wrong.
vs GitHub Copilot / claude-code-action — Complementary, not competitive. Run GitScope first as cheap, instant triage. If it finds nothing, the diff is structurally safe. Then let the expensive model review what actually matters.
vs Aider repo-map — Aider's repo-map uses tree-sitter too, but it's locked inside Aider. GitScope works with any agent, any workflow, any CI pipeline.
Agent Integration
Add to your CLAUDE.md, .cursorrules, or equivalent:
Before reviewing PRs, run: gitscope review <ref-range> --format json
Exit code 1 means findings — read the JSON output.
Exit code 0 means nothing noteworthy — proceed normally.
JSON output for programmatic consumption:
gitscope review main..feature --format json
Languages
- Python
- TypeScript / JavaScript
- Go
- More coming (Rust, Java, C# planned)
Philosophy
- Silence is a feature. No findings? No output. Most diffs don't need structural analysis.
- Local-first. Your code never leaves your machine. No SaaS, no API keys, no accounts.
- Agent-native. CLI + JSON output.
pip installand go. Works with any agent or workflow. - Precision over recall. We'd rather miss a minor issue than cry wolf on every PR.
Roadmap
- v0.2 — GitHub Action, TypeScript/JS improvements
- v0.3 — Persistent symbol graph (
.gitscope/directory) - v0.4 —
gitscope callers,gitscope deps,gitscope impactqueries - Future — 8 language support, review rules engine
License
Apache 2.0 — see LICENSE for details.
Project details
Release history Release notifications | RSS feed
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 gitscope-0.1.0.tar.gz.
File metadata
- Download URL: gitscope-0.1.0.tar.gz
- Upload date:
- Size: 147.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5177e47d719db2cf21f782c0be35988d996579f7c23e95778d82c2d9080d32e0
|
|
| MD5 |
c93b316b82bb024419543808d124bf33
|
|
| BLAKE2b-256 |
766d39a1d49801d945950f8fe4590e31531ad6b782c51d8e58b68658b31aed25
|
Provenance
The following attestation bundles were made for gitscope-0.1.0.tar.gz:
Publisher:
publish-to-pypi.yml on ostehost/gitscope-v2
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
gitscope-0.1.0.tar.gz -
Subject digest:
5177e47d719db2cf21f782c0be35988d996579f7c23e95778d82c2d9080d32e0 - Sigstore transparency entry: 941843486
- Sigstore integration time:
-
Permalink:
ostehost/gitscope-v2@4482977e7f7a0968a1438605d42dd7c42e45fc7b -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/ostehost
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-to-pypi.yml@4482977e7f7a0968a1438605d42dd7c42e45fc7b -
Trigger Event:
push
-
Statement type:
File details
Details for the file gitscope-0.1.0-py3-none-any.whl.
File metadata
- Download URL: gitscope-0.1.0-py3-none-any.whl
- Upload date:
- Size: 37.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6de3a1b9d76400b612d1336992a63ec4d0c88b9a9c9d1d0ae9d60c1e62636008
|
|
| MD5 |
21d9ecfb2fc3470a097f7f990997a9ce
|
|
| BLAKE2b-256 |
5d7289d230f767e9d79365de757b34d414a46fecb2c61f307d990cefa768b8fc
|
Provenance
The following attestation bundles were made for gitscope-0.1.0-py3-none-any.whl:
Publisher:
publish-to-pypi.yml on ostehost/gitscope-v2
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
gitscope-0.1.0-py3-none-any.whl -
Subject digest:
6de3a1b9d76400b612d1336992a63ec4d0c88b9a9c9d1d0ae9d60c1e62636008 - Sigstore transparency entry: 941843495
- Sigstore integration time:
-
Permalink:
ostehost/gitscope-v2@4482977e7f7a0968a1438605d42dd7c42e45fc7b -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/ostehost
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-to-pypi.yml@4482977e7f7a0968a1438605d42dd7c42e45fc7b -
Trigger Event:
push
-
Statement type: