Skip to main content

RepoCodex

Engine tests

Git-native why next to code — with a pin check that proves it still matches.

Coding agents write syntax well and forget why. Comments rot. Instruction files (CLAUDE.md, AGENTS.md, Cursor rules) never prove they still describe live text. Tests check behavior you remembered to assert; they do not keep institutional why attached to the lines that implement it.

RepoCodex stores that why in git beside the code. Agents retrieve it before they edit. A deterministic pin check (ripgrep + git) attests the attachment. Built for repositories where coding agents make the changes.

Not a test suite. Not another instruction file. Not a linter.

Experimental 0.0.1. Requires Python 3.11+ and ripgrep (rg) on PATH.

Install

pip install "repocodex==0.0.1"
# or from a local clone: pip install -e .
repocodex install

repocodex install writes the pre-commit hook, GitHub Action, agent skills, and .repocodex.toml (engine pin). The product is that loop: agents retrieve stored why before they edit, so they do not silently break existing behavior; the pin check fails the turn when why and code diverge, and a first substantive edit of an uncovered file is denied until a pinning concept is written.

repocodex context src/billing/PaymentGateway.ts   # retrieve why before edit
repocodex validate --diff                         # attest pins still hold

Pin the engine in .repocodex.toml. Hook, local CLI, and CI resolve that pin so verdicts agree.

What a concept looks like

Types are orthogonal — one change may write more than one. Three common shapes:

TechnicalDecision (decisions/…) — why this construct exists:

---
title: Capture streams enterprise retries instead of buffering
type: TechnicalDecision
verification:
  engine: ripgrep
  anchors:
    - path: src/billing/PaymentGateway.ts
      all_of: ["yield", "ENTERPRISE", "capturePayment"]
---
Enterprise capture is a generator so retries stay backpressure-aware. Do not
replace with an in-memory list of attempts.

InvariantContract (invariants/…) — must-hold token (requires claims):

---
title: Enterprise capture grace is three attempts
type: InvariantContract
verification:
  engine: ripgrep
  anchors:
    - path: src/billing/PaymentGateway.ts
      all_of: ["ENTERPRISE", "grace", "= 3"]
claims:
  - subject: enterprise_grace_attempts
    literal: "3"
---
Enterprise plans get three capture retries before failure. Do not silently shrink this window.

BusinessWorkflow (workflows/…) — thin cross-package flow (one anchor per site):

---
title: Checkout capture flows api → billing → ledger
type: BusinessWorkflow
verification:
  engine: ripgrep
  anchors:
    - path: src/api/checkout.ts
      all_of: ["capturePayment", "billing"]
    - path: src/billing/PaymentGateway.ts
      all_of: ["capturePayment", "ledger"]
    - path: src/ledger/posting.ts
      all_of: ["postCapture", "idempotency"]
---
Checkout capture crosses api, billing, then ledger. Keep that order; do not
post to the ledger from the API layer.

Docs

Doc Job
How it works Purpose, benefit, and the retrieve → read → edit → update why → pin-check loop
Memory How to read .context/
Agents How coding agents (and optionally humans) run the loop
Install CLI, pin, hook, GitHub Action, optional MCP
Architecture Current engine architecture (further reading)

License and contributing

MIT · Contributing · Security

Created by Ajay Lamba.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

repocodex-0.0.1.tar.gz (83.0 kB view details)

Uploaded Source

Built Distribution

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

repocodex-0.0.1-py3-none-any.whl (77.6 kB view details)

Uploaded Python 3

File details

Details for the file repocodex-0.0.1.tar.gz.

File metadata

  • Download URL: repocodex-0.0.1.tar.gz
  • Upload date:
  • Size: 83.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for repocodex-0.0.1.tar.gz
Algorithm Hash digest
SHA256 f5c94fac84cddaa943a24d89dca332ee0ffdeb8b2aed9477fe176f50e9172423
MD5 d08f86be2dd148d89dc53c4576c138bf
BLAKE2b-256 70de69e9ce1bb385dba6fd1ea465ba659b2a1692894f5fa7b6e5fce3385dc99b

See more details on using hashes here.

Provenance

The following attestation bundles were made for repocodex-0.0.1.tar.gz:

Publisher: publish.yml on azaylamba/repocodex

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

File details

Details for the file repocodex-0.0.1-py3-none-any.whl.

File metadata

  • Download URL: repocodex-0.0.1-py3-none-any.whl
  • Upload date:
  • Size: 77.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for repocodex-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 1c9d5d93b11e5c998fe21fd3d9da3a157b676339f5214b9916859f7236b7b32e
MD5 32bbc847df20f51ea9da7305c131fa3a
BLAKE2b-256 45aaf4a8f0b22ae6986a95689f958933f9057301b54659288dd32def131f1473

See more details on using hashes here.

Provenance

The following attestation bundles were made for repocodex-0.0.1-py3-none-any.whl:

Publisher: publish.yml on azaylamba/repocodex

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

Release history Release notifications | RSS feed

0.0.2

2 files

This release

0.0.1 This release

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page