Extract lessons learned (REX) from code repositories
Project description
rex-machine
Your codebase has lessons no one wrote down. This finds them.
rex-machine scans any code repository and extracts structured technical lessons learned — what problems the team faced, what they tried, what worked. Claude navigates your repo autonomously (reading files, grepping, following imports) and produces a grounded report, not a vague summary.
Works on any language, any framework, any repo size.
Install
pip install rex-machine
Usage
# Set your API key (one time)
export ANTHROPIC_API_KEY=sk-ant-...
# Analyze a repo
rex extract /path/to/repo
# Save as Markdown
rex extract /path/to/repo -o markdown -f report.md
# Save as JSON
rex extract /path/to/repo -o json -f report.json
# Analyze in French
rex extract /path/to/repo --lang fr
# See what Claude is reading in real time
rex extract /path/to/repo -v
What you get
Each finding is structured, not prose:
REX #1: Error Handling Strategy [Strongly Inferred]
Context: REST API with 23 endpoints
Problem: Inconsistent error responses across modules
Approach Worked? Details
Global exc handler Yes Centralized in middleware
Per-endpoint catch No Led to code duplication
Learning: Centralized error handling > scattered try/catch
Recommendation: Implement global exception middleware early
Source files: src/middleware/errors.py, src/api/deps.py
Every REX has: a problem, approaches tried (what worked and what didn't), a learning, a confidence level grounded in code evidence, and the exact source files.
Multi-provider
Works with any Claude provider. Auto-detects from environment variables.
| Provider | Auth |
|---|---|
| Anthropic (default) | ANTHROPIC_API_KEY |
| Azure AI Foundry | ANTHROPIC_FOUNDRY_RESOURCE + ANTHROPIC_FOUNDRY_API_KEY |
| AWS Bedrock | AWS credentials |
| Google Vertex AI | GCP credentials |
rex configure # interactive setup
How it works
Claude gets three read-only tools (read_file, list_files, grep) and decides what to explore on its own — same agentic loop as Claude Code. No files are pre-selected by heuristics. Claude reads what it needs, follows leads, and stops when it has enough evidence.
All tools are read-only and sandboxed to the repository. No writes, no network, no code execution.
Built with the raw Anthropic SDK. No LangChain, no agent framework. The core loop is a while stop_reason == "tool_use" — about 20 lines.
Configuration
rex init # create .rex-machine.json in your project
rex configure # set up provider & credentials
rex status # show current config
Contributing
Issues and PRs welcome. See CONTRIBUTING.md.
License
Star History
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 rex_machine-0.3.1.tar.gz.
File metadata
- Download URL: rex_machine-0.3.1.tar.gz
- Upload date:
- Size: 36.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2c02c4e02d47e094acbb213a832f0299a3199262efd9f7a558790e42df7b4183
|
|
| MD5 |
60c58f1e19d6dd0606c9a233b2858f89
|
|
| BLAKE2b-256 |
cdefe8acbef648a68645dea7f394611045006ded13fcea1da775a90e3f2b1685
|
Provenance
The following attestation bundles were made for rex_machine-0.3.1.tar.gz:
Publisher:
ci.yml on NicoJuiced/rex-machine
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
rex_machine-0.3.1.tar.gz -
Subject digest:
2c02c4e02d47e094acbb213a832f0299a3199262efd9f7a558790e42df7b4183 - Sigstore transparency entry: 1853015080
- Sigstore integration time:
-
Permalink:
NicoJuiced/rex-machine@0e5373dadd95cb6dad046586a2a3c4f36bcdca79 -
Branch / Tag:
refs/tags/v0.3.1 - Owner: https://github.com/NicoJuiced
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
ci.yml@0e5373dadd95cb6dad046586a2a3c4f36bcdca79 -
Trigger Event:
push
-
Statement type:
File details
Details for the file rex_machine-0.3.1-py3-none-any.whl.
File metadata
- Download URL: rex_machine-0.3.1-py3-none-any.whl
- Upload date:
- Size: 37.1 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 |
b38ccccb2d223a7bd6235300d8c9fe0d77d131791e7ac6520c9a0eb9d1c18ed3
|
|
| MD5 |
86d8cceb05dadbd007b3ba39168a50e2
|
|
| BLAKE2b-256 |
b1693df8b776e194fd31646d2a6d2a6a68c977c372cbb9b6f1fe3d12af3d2aaf
|
Provenance
The following attestation bundles were made for rex_machine-0.3.1-py3-none-any.whl:
Publisher:
ci.yml on NicoJuiced/rex-machine
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
rex_machine-0.3.1-py3-none-any.whl -
Subject digest:
b38ccccb2d223a7bd6235300d8c9fe0d77d131791e7ac6520c9a0eb9d1c18ed3 - Sigstore transparency entry: 1853015163
- Sigstore integration time:
-
Permalink:
NicoJuiced/rex-machine@0e5373dadd95cb6dad046586a2a3c4f36bcdca79 -
Branch / Tag:
refs/tags/v0.3.1 - Owner: https://github.com/NicoJuiced
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
ci.yml@0e5373dadd95cb6dad046586a2a3c4f36bcdca79 -
Trigger Event:
push
-
Statement type: