Local pre-commit review briefs from your git diff — scrutinize changes, stage, and commit with confidence
Project description
Scrutin
Review local git changes before you commit — risk highlights, file diffs, stage/unstage, and commit from the browser. Everything runs on your machine.
Install with Python (PyPI)
Step 1 — Check requirements
python3 --version
git --version
Step 2 — Install from PyPI
pip install scrutin
scrutin --help
If scrutin: command not found, ensure pip’s script directory is on your PATH, or use python3 -m scrutin.cli --help.
Step 3 — Start the server
cd /path/to/your-project
scrutin serve
Your browser should open http://127.0.0.1:8787. To start without opening a tab:
scrutin serve --no-open
To pin a specific repository on startup:
scrutin serve --repo /path/to/your-project
Step 4 — Set the repository in the UI
In the left Workspace panel:
- Repository — full path to your git root (e.g.
/Users/you/your-project) - Click ◎ Detect repo if the field is empty or wrong
- Confirm the hint under Compare shows changed paths
Step 5 — Choose compare mode and refresh
Use the Compare dropdown, then click ↻ Refresh brief:
| Mode | What it shows |
|---|---|
| working | Staged + unstaged vs HEAD (default for pre-commit) |
| staged | Index vs HEAD only |
| unstaged | Working tree vs index only |
| branch | base…head (e.g. main…HEAD) — set Base and Head when selected |
Step 6 — Review, stage, and commit
- Read the dashboard (KPIs, risk overview, summary)
- In Files to scrutinize, open View diff and click Mark reviewed on each flagged file
- Stage per file or use Stage all in the Commit panel
- Write a commit message or click Suggest message, then Commit staged
Commit gate: Commit staged stays disabled until every file in Files to scrutinize is marked reviewed and at least one change is staged. Files under Other changed files do not require “Mark reviewed” but can still be staged and committed.
More UI detail: Browser guide (step by step) below.
IDE plugins — coming soon
Sidebar plugins are not listed on the Marketplace yet. Until they ship, use the browser UI from the Python.
Planned:
- VS Code — Scrutin brief in the activity bar, connected to
scrutin serveon port 8787 - Cursor — same experience as the VS Code extension
- IntelliJ — JetBrains plugin for IDEA and compatible IDEs
All plugins will use the same local server — no cloud required.
First run
-
Open a terminal and go to your project:
cd ~/your-project
-
Make sure you have something to review (edit files, or stage them):
git status -
Start the server (Python)
-
Click Refresh brief after you change files
Browser guide (step by step)
Start the server
From your project directory (or any path; you can set the repo in the UI):
cd ~/your-project
scrutin serve
Alternative — brief in terminal, then open UI:
scrutin brief --open
Read the dashboard
The main panel is your pre-commit brief:
- KPIs — files changed, review progress, lines added/removed, brief engine (Sharpen vs LLM)
- Diff activity / File mix — size and risk breakdown
- Risk overview — categories (secrets, CI/CD, migrations, etc.)
- Summary / Why — what changed and why it matters
- Risk areas — tags for the kinds of risk detected
Review flagged files (“Files to scrutinize”)
- Click View diff — side-by-side Original / Modified panes
- In the diff modal:
- Stage / Unstage — update the git index for that file
- Mark reviewed — track that you have looked at this file (required before commit is enabled)
- On the card you can also Stage / Unstage without opening the diff
The File review bar shows progress (e.g. 5 / 12 reviewed).
Handle all other changes (“Other changed files”)
Same actions: View diff, Stage, Unstage. These files do not require “Mark reviewed” for the commit button.
Optional: configure LLM
Expand LLM (optional) in the sidebar → set provider, model, key → Save LLM settings → Refresh brief. See Optional: LLM polish.
Stage and commit
- Per file: Stage on a card or in the diff modal
- Bulk: Stage all in the Commit panel
- Suggest message → Commit staged
Self-checks and rollback
- Ask yourself — 5 self-checks — prompts before you push
- Rollback — quick reference for
git restore,git revert, etc.
Compare modes
| Mode | Git equivalent | Typical use |
|---|---|---|
| working | git diff HEAD (+ untracked where supported) |
“What am I about to commit?” |
| staged | git diff --cached |
“What’s already in the index?” |
| unstaged | git diff |
“What’s changed but not staged?” |
| branch | git diff base...head |
Feature branch vs main |
Switch mode → Refresh brief.
Review, stage, and commit
What “scrutinize” means
Scrutin does not hide other files. It prioritizes a subset:
- Risky paths (secrets, config, migrations, CI/CD, large API surface, etc.)
- If nothing is risky, the largest edits in the current scope
Everything else appears under Other changed files.
Review gate
Commit staged stays disabled until:
- Every file in Files to scrutinize is Mark reviewed (or the list is empty), and
- Git has staged changes (
git diff --cachednot empty)
What gets committed
The button runs git commit with your message. It commits whatever is staged in that repo — including files you staged from “Other changed files” or from the terminal.
Suggested workflow:
Edit files → Refresh brief → Review scrutinize list → Stage (per file or Stage all)
→ Suggest message → Commit staged
Optional: LLM polish
Without a key, Scrutin uses Sharpen heuristics (local rules, no API calls).
With a key, summary, why, and self-checks can be enhanced. Configure via UI or .env:
| Provider | Environment variables |
|---|---|
| OpenAI | OPENAI_API_KEY, OPENAI_MODEL |
| Anthropic | ANTHROPIC_API_KEY, ANTHROPIC_MODEL |
| Google Gemini | GOOGLE_API_KEY, GOOGLE_MODEL |
| Groq | GROQ_API_KEY, GROQ_MODEL |
| Mistral | MISTRAL_API_KEY, MISTRAL_MODEL |
Active provider: SCRUTIN_LLM_PROVIDER=openai (or none).
Env file locations (first match wins):
SCRUTIN_ENVif set.envin the repo~/.scrutin/.env(legacy:~/.reviewpack/.envstill read)
Copy .env.example to .env as a starting point.
Privacy: LLM calls send metadata (paths, stats, risk tags) — not full diff bodies.
Optional: ignore noisy paths
Create .scrutinignore in the repo root (one pattern per line):
.venv/
node_modules/
dist/
*.egg-info/
Legacy name .reviewpackignore is still honored if .scrutinignore is missing.
CLI reference
Terminal-only brief (no UI):
cd ~/your-project
scrutin brief
scrutin brief --json
Modes:
scrutin brief --mode working
scrutin brief --mode staged
scrutin brief --mode unstaged
scrutin brief --mode branch --base main --head HEAD
Server:
scrutin serve
scrutin serve --port 8788 --no-open
scrutin serve --repo /path/to/repo
From a saved diff file:
scrutin brief --diff changes.patch --repo .
Troubleshooting
| Problem | What to do |
|---|---|
scrutin: command not found |
pip install scrutin from PyPI or activate the venv where you installed it |
Not inside a git repository |
cd to the repo root, or run git init |
No diff to analyze |
Save edits, git add some files, or switch compare mode |
| UI empty / wrong repo | Set Repository → Detect repo → Refresh brief; or scrutin serve --repo /full/path |
| Port 8787 in use | Stop old server (Ctrl+C), or scrutin serve --port 8788 |
| Brief only in terminal | Use scrutin serve or scrutin brief --open |
| LLM panel missing / save fails | pip install -U scrutin; restart serve |
| Commit button disabled | Mark all scrutinize files reviewed and stage at least one file |
Quick command cheat sheet
# Python (PyPI)
pip install scrutin
cd ~/your-project
scrutin serve
# → http://127.0.0.1:8787 → Detect repo → Refresh brief → review → Stage all → Commit staged
curl http://127.0.0.1:8787/health
scrutin brief --json
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 scrutin-0.1.4.tar.gz.
File metadata
- Download URL: scrutin-0.1.4.tar.gz
- Upload date:
- Size: 62.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e428aacbf017e6d97dbf7575db7c3001b89ef0c49b98f78b3bad1ffa67bafdde
|
|
| MD5 |
14363bf855dafe6ae0442c738c283eb5
|
|
| BLAKE2b-256 |
7cbe262652fdf585112aff57d43518ca3ed3e925b1485531b4e6b5402b95afd0
|
File details
Details for the file scrutin-0.1.4-py3-none-any.whl.
File metadata
- Download URL: scrutin-0.1.4-py3-none-any.whl
- Upload date:
- Size: 59.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1b0393b5de423412822b3e76b38ce1224b8a391f16db804f580420ef2aaae590
|
|
| MD5 |
a8ad7fe60fe6b7a1f0d39343c8dbece1
|
|
| BLAKE2b-256 |
b905483bf9dc1d2bc51175b57e1b7056d6c28e5c7eab2d00efd04ab4497b08c0
|