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
- Either the Claude CLI installed and authenticated, or an Anthropic API key
- GitHub CLI (only for
unravel pr)
Configuration
By default Unravel runs in auto mode: it uses the local Claude CLI if claude is on your PATH, and falls back to the Anthropic API otherwise. No extra configuration needed if you already have claude installed.
For the API path, set your key as an environment variable:
export ANTHROPIC_API_KEY=sk-ant-...
Backends
| Mode | When it's used | What it needs |
|---|---|---|
auto (default) |
Picks the first available backend | claude on PATH or ANTHROPIC_API_KEY |
claude-cli |
Always use the local Claude CLI | claude binary, authenticated |
claude-api |
Always hit the Claude API | ANTHROPIC_API_KEY |
Pin a specific backend any of these ways:
unravel conf set provider claude-api # persistent
UNRAVEL_PROVIDER=claude-cli unravel ... # one session
unravel diff HEAD~1 --provider claude-api # single invocation
CLI Options
| Flag | Description |
|---|---|
--model, -m |
Model to use (default: claude-sonnet-4-6) |
--provider, -p |
LLM provider: auto, claude-cli, or claude-api (default: auto) |
--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 the Claude API (not needed with claude-cli backend) |
OPENAI_API_KEY |
API key for OpenAI (future) |
UNRAVEL_PROVIDER |
Default provider: auto, claude-cli, or claude-api |
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:
- Claude CLI (
claude-cli) — uses your local, authenticatedclaudebinary - Claude API (
claude-api) — direct HTTP via the Anthropic SDK, 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
Metadata
Release files for unravel-review 0.4.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| unravel_review-0.4.0.tar.gz | 167.9 kB | With provenance | Details for unravel_review-0.4.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| unravel_review-0.4.0-py3-none-any.whl | Python 3 | none | any | Details for unravel_review-0.4.0-py3-none-any.whl |
Total release size: 237.0 kB
Release files / unravel_review-0.4.0.tar.gz
| Download URL | unravel_review-0.4.0.tar.gz |
|---|---|
| Size | 167.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
751d48f2028136e5057eb2ea2995568ead33a2c800e50ada8a7a4a512e72925d
|
|
BLAKE2b-256 checksum How to use checksums |
39318f4b04a5c99bbabdbbec308b510b95a20ebce9afeedfe39488bffa8b9a27
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Apr 29, 2026.
Transparency logRelease files / unravel_review-0.4.0-py3-none-any.whl
| Download URL | unravel_review-0.4.0-py3-none-any.whl |
|---|---|
| Size | 69.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
dd495fd2d0394e9807ddc5fdebea2130420f5fc47d86a8aff60b06e2045fee54
|
|
BLAKE2b-256 checksum How to use checksums |
1bb91c915e6f2018b35b34b07e38665214b398e15215585b3f0bab5aee779607
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Apr 29, 2026.
Transparency logSecurity for unravel-review 0.4.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
All 2 files in this release have been uploaded with provenance metadata.
Attestation for unravel_review-0.4.0.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Apr 29, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.