Skip to main content

Extract lessons learned (REX) from code repositories

Project description

rex-machine

Your codebase has lessons no one wrote down. This finds them.

Star History Chart

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.

PyPI · GitHub

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

Apache 2.0

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

rex_machine-0.2.0.tar.gz (32.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

rex_machine-0.2.0-py3-none-any.whl (33.3 kB view details)

Uploaded Python 3

File details

Details for the file rex_machine-0.2.0.tar.gz.

File metadata

  • Download URL: rex_machine-0.2.0.tar.gz
  • Upload date:
  • Size: 32.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for rex_machine-0.2.0.tar.gz
Algorithm Hash digest
SHA256 bb238e05cf831289cf4f7c75f4a79254fde4619fecf90e362c6ada3c2e036759
MD5 7c9ee675cf8588a6c20d680c1ea2cd21
BLAKE2b-256 00763d136ba3a2e028bfa002fc701e90ea7b22c09eb15e3975c6db5d4b25c939

See more details on using hashes here.

Provenance

The following attestation bundles were made for rex_machine-0.2.0.tar.gz:

Publisher: ci.yml on NicoJuiced/rex-machine

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file rex_machine-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: rex_machine-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 33.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for rex_machine-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 649f1b2fce5ad77fff1d5ca5a796cbf0f94eaed353cf6e093c9899586f2f6dc6
MD5 d49671da5c96d68190902a95b90ea4da
BLAKE2b-256 cd533e4a8b272218b38fb9aa1c94ee195eed4792b7a21c79df57d5c95da4d06a

See more details on using hashes here.

Provenance

The following attestation bundles were made for rex_machine-0.2.0-py3-none-any.whl:

Publisher: ci.yml on NicoJuiced/rex-machine

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page