AI-powered CLI that decomposes PR diffs into causal threads for human code reviewers
Project description
Unravel
AI-powered CLI that decomposes PR diffs into causal threads for human code reviewers.
Instead of reviewing a diff file-by-file, Unravel groups changes by why they were made — each thread tells a story from root cause to effect, so reviewers build understanding progressively.
Installation
Pick whichever channel fits your setup — they all install the same package.
uv (recommended)
uv tool install unravel-review
pipx
pipx install unravel-review
pip
pip install unravel-review
Homebrew
brew tap roo-oliv/unravel
brew install unravel-review
brew install unravel works too — it's a tap-level alias.
One-liner (auto-detects uv/pipx)
curl -fsSL https://raw.githubusercontent.com/roo-oliv/unravel/main/install.sh | bash
Docker
docker run --rm -v "$(pwd):/repo" -e ANTHROPIC_API_KEY \
ghcr.io/roo-oliv/unravel diff HEAD~1
Quick Start
# Analyze the last commit
unravel diff HEAD~1..HEAD
# Analyze a range
unravel diff main..feature-branch
# Analyze a GitHub PR (requires gh CLI)
unravel pr 42
# JSON output for piping
unravel diff HEAD~1..HEAD --json | jq .
# Compact tree view
unravel diff HEAD~1..HEAD --tree-only
Requirements
- Python 3.12+
- Git
- An API key for a supported LLM provider
- GitHub CLI (only for
unravel pr)
Configuration
Set your API key as an environment variable:
export ANTHROPIC_API_KEY=sk-ant-...
CLI Options
| Flag | Description |
|---|---|
--model, -m |
Model to use (default: claude-sonnet-4-6) |
--provider, -p |
LLM provider (default: anthropic) |
--json, -j |
Output raw JSON |
--tree-only, -t |
Compact tree view |
--thinking-budget |
Extended thinking token budget (default: 10000) |
--staged |
Analyze only staged changes (diff command only) |
--remote |
Git remote name (pr command only, default: origin) |
Environment Variables
| Variable | Description |
|---|---|
ANTHROPIC_API_KEY |
API key for Anthropic/Claude |
OPENAI_API_KEY |
API key for OpenAI (future) |
UNRAVEL_PROVIDER |
Default provider |
UNRAVEL_MODEL |
Default model |
UNRAVEL_THINKING_BUDGET |
Default thinking budget |
How It Works
- Extract — Pulls the diff from git or GitHub
- Parse — Breaks the diff into hunks using unidiff
- Analyze — Sends hunks to an LLM with a specialized prompt that decomposes changes into causal threads
- Validate — Checks all hunks are covered and thread dependencies are consistent
- Render — Displays threads in rich terminal output, JSON, or tree view
Multi-Provider Support
Unravel is designed to work with multiple LLM providers. Currently supported:
- Anthropic (Claude) — default, with extended thinking support
Planned: OpenAI, Gemini, and more. The provider abstraction is ready — contributions welcome.
Development
See CONTRIBUTING.md for the full local setup, testing conventions, code style, and release process. TL;DR:
git clone https://github.com/roo-oliv/unravel.git
cd unravel
uv sync --extra dev
uv run pytest
uv run ruff check .
License
AGPL-3.0-or-later
Project details
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 unravel_review-0.2.1.tar.gz.
File metadata
- Download URL: unravel_review-0.2.1.tar.gz
- Upload date:
- Size: 142.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9b2f008b5959b9f223c2eee7b9254fb13d3af5cd94b5c56461a13c1fe12b3bd2
|
|
| MD5 |
e8d934dd0d9a57fee30f155090f519ca
|
|
| BLAKE2b-256 |
3220e313cb5c321c60512a806e8deb72f08a33d7194208162e72a2e045f68412
|
Provenance
The following attestation bundles were made for unravel_review-0.2.1.tar.gz:
Publisher:
release.yml on roo-oliv/unravel
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
unravel_review-0.2.1.tar.gz -
Subject digest:
9b2f008b5959b9f223c2eee7b9254fb13d3af5cd94b5c56461a13c1fe12b3bd2 - Sigstore transparency entry: 1312631504
- Sigstore integration time:
-
Permalink:
roo-oliv/unravel@82cd47baf49c9ad50ea92145218bd43128b7067b -
Branch / Tag:
refs/tags/v0.2.1 - Owner: https://github.com/roo-oliv
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@82cd47baf49c9ad50ea92145218bd43128b7067b -
Trigger Event:
release
-
Statement type:
File details
Details for the file unravel_review-0.2.1-py3-none-any.whl.
File metadata
- Download URL: unravel_review-0.2.1-py3-none-any.whl
- Upload date:
- Size: 54.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0dc5f57af2df7b59f9b60f440282ae2f98f4d5547cc05c3061bed38da5a9b9eb
|
|
| MD5 |
794f9d98a921d309b3795689b9ed9276
|
|
| BLAKE2b-256 |
321378e2b69d39ed988a3b3ea741ba565e389a48ee8cdcec8b18b0727b9e8f7f
|
Provenance
The following attestation bundles were made for unravel_review-0.2.1-py3-none-any.whl:
Publisher:
release.yml on roo-oliv/unravel
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
unravel_review-0.2.1-py3-none-any.whl -
Subject digest:
0dc5f57af2df7b59f9b60f440282ae2f98f4d5547cc05c3061bed38da5a9b9eb - Sigstore transparency entry: 1312631598
- Sigstore integration time:
-
Permalink:
roo-oliv/unravel@82cd47baf49c9ad50ea92145218bd43128b7067b -
Branch / Tag:
refs/tags/v0.2.1 - Owner: https://github.com/roo-oliv
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@82cd47baf49c9ad50ea92145218bd43128b7067b -
Trigger Event:
release
-
Statement type: