AI-powered code review CLI for GitLab Merge Requests. Sensei learns your review style from past comments and applies it consistently to new MRs using Claude as the review engine.
- Learns your style — Scrapes your past GitLab review comments, analyzes tone/priorities/patterns, and builds a reusable style profile.
- Reviews MRs — Fetches diffs, reads full file context, and generates review comments that match your voice.
- Posts intelligently — Must-fix issues go inline on the exact line. Nits get grouped into one summary comment. Test coverage gaps get a single consolidated table.
- Python 3.9+
- Claude Code CLI installed and authenticated
- A GitLab personal access token with
apiscope
From PyPI:
pip install sensei-reviewOr from source:
git clone https://github.com/pulkit004/sensei.git && cd sensei
python -m venv .venv && source .venv/bin/activate
pip install -e .# Initialize with your GitLab credentials
sensei init --pat <your-gitlab-pat>
# Learn your review style (scrapes last 365 days of comments)
sensei learnConfig is stored at ~/.sensei/ with restricted permissions (0600).
# Review a single MR
sensei review https://gitlab.com/org/project/-/merge_requests/123
# Dry run (preview without posting)
sensei review https://gitlab.com/org/project/-/merge_requests/123 --dry-run
# Review multiple MRs in parallel
sensei review-batch --file mrs.txt
# Or pass URLs directly
sensei review-batch \
https://gitlab.com/org/project/-/merge_requests/123 \
https://gitlab.com/org/project/-/merge_requests/456
# Control concurrency (default 3, max 10)
sensei review-batch --file mrs.txt --concurrency 5
# Dry run batch
sensei review-batch --file mrs.txt --dry-runThe --file option reads MR URLs from a text file (one per line, # comments and blank lines ignored).
After review, you're prompted to approve (post to GitLab), edit (save to file for manual editing), or discard. In batch mode, results are shown sequentially after all reviews complete.
| Type | Confidence | How it's posted |
|---|---|---|
| Must-fix | >= 90% | Inline on the exact diff line |
| Nit | 80-89% | Grouped into one summary comment |
| Test gap | any | Consolidated into a single test coverage table |
Comments below 80% confidence are dropped.
Sensei loads rules from multiple sources (in order):
~/.sensei/rules/{org_project}.md— Per-project rules you writeCLAUDE.md— From the repo being reviewed.claude/rules.md— From the repoCODING_PRINCIPLES.md— From the repo
Each file is reviewed in two phases:
- Code review — Bugs, type safety, naming, architecture, security
- Silent failure hunting — Only runs if the diff has error handling patterns (try/catch, optional chaining, etc.)
Files are reviewed in parallel (up to 8 concurrent workers, configurable batch size).
source .venv/bin/activate
pip install -e ".[dev]"
pytest tests/ -v # Run tests
pytest tests/ -v -x # Stop on first failuresrc/sensei/
cli.py # Click CLI commands
config.py # ~/.sensei config management
gitlab_client.py # GitLab API (diffs, file content, posting comments)
reviewer.py # Review prompts, parsing, consolidation
learner.py # Style profile learning from past comments
formatter.py # Comment formatting for terminal and GitLab
tests/ # Unit and integration tests
MIT — see LICENSE for details.