~/repoctx

repoctx v2.5.0 · node · 100% local-first · MIT

repoctx — ~/projects
 ____   _____   ____    ___    ____   _____  __  __
|  _ \ | ____| |  _ \  / _ \  / ___| |_   _| \ \/ /
| |_) ||  _|   | |_) || | | || |       | |    \  /
|  _ < | |___  |  __/ | |_| || |___    | |    /  \
|_| \_\|_____| |_|     \___/  \____|   |_|   /_/\_\

repository context, mapped locally.

A local-first CLI and MCP server that turns a repository into deterministic context for coding agents and reviewers — it maps what a change touches, scores how cheap and safe it is, and gates merge readiness. No cloud. No guessing. Just your repo, mapped.

$ repoctx context "add a new MCP tool"

// a context pack, generated locally in milliseconds

repoctx — context
# task-aware context, fully deterministic
$ repoctx context "add a new MCP tool"

▸ intent      add · mcp, tool, server
▸ primary     src/lib/mcp.js
              src/cli.js
▸ related     src/lib/context-engine.js
              src/lib/repo.js
▸ tests       tests/context-engine.test.js  
▸ pattern     register command → add handler → update help
▸ verify      npm run ci

  ~4,088 context tokens · 100% local · 0 network calls

$ works with claude-code · codex-cli · cursor · vscode · ollama

// trust-layer

Five things an agent has to get right

repoctx turns a repository into a trust layer with five durable parts. Each one is deterministic, inspectable, and produced from your code — not a model's memory.

context

[01]

Task-aware packets before an agent plans or edits — primary files, related files, tests, patterns, and the exact validation commands.

$ repoctx context "add a new MCP tool"

tests

[02]

Every packet surfaces the matching tests and the repo's own quality gate, so changes ship with the checks that prove them.

$ repoctx harness . --out harness.md

permissions

[03]

Scoped to the smallest owner files that actually need to move. Code owners and protected-branch rules stay in the loop.

$ repoctx impact src/lib/pr-review.js

review

[04]

Impact, review context, and the merge gate in one call — changed files, risk prompts, CODEOWNERS, branch protection, and a ship / no-ship verdict with a confidence score.

$ repoctx review . --base origin/main

evidence

[05]

Deterministic, local-first artifacts you can keep — context packs, AX and convergence scores, and merge verdicts as durable Markdown or JSON, not disposable model guesses.

$ repoctx report . --out report.md
context
  └─ tests
      └─ permissions
          └─ review
              └─ evidence

one loop, kept honest every session.

// the loop ends in a verdict — deterministic, from your diff

repoctx — gate
# deterministic merge gate — local diff or a GitHub PR
$ repoctx gate .

▸ changed     9 files · 2 risk paths flagged
▸ secrets     none detected             
▸ owners      CODEOWNERS · 2 required reviewers
▸ release     version + changelog in sync
▸ verdict     PASS    safe to open a PR

  add --pr 477 to gate a GitHub PR · 100% local by default

// features

One CLI for the whole repo-context job

It doesn't replace your editor or your model. It gives developers and agents a single, scriptable source of truth about the code in front of them.

discover & index

Find repo roots under any directory and build local .dev-context indexes. No cloud, no upload.

ast code maps

JSON-first maps of files, domains, imports, exports, symbols, and routes across 8 languages — JS/TS, Go, Python, Java, C#, Ruby, Rust.

search across repos

Rank matches by path, domain, route, controller, imports, exports, and symbols across your whole catalog.

agent harnesses

Generate setup, validation, and runtime commands as the first artifact an agent or CI reads.

merge gates

One ship / no-ship verdict for a local diff or a GitHub PR — secret safety, risk paths, CODEOWNERS, branch protection, release discipline.

agent-experience score

AX 0–100: how cheap and safe is this change? Blends changeability, blast radius, guardrails, and clarity.

convergence score

Score 0–100 for how far the diff drifted from the stated task — coverage, scope, and risk alignment, with a recomputable receipt.

usage dashboard

A local, self-contained HTML dashboard of usage and performance from opt-in telemetry. No server, off by default.

pr review packs

Turn a git diff into review targets, risk flags, and verification commands — posted as a sticky comment.

token-aware

Every artifact estimates its own context-token footprint. Never blow an agent's window by accident.

multi-repo workspaces

One product-level report across related repos — web, API, and everything wired between them.

github actions ready

repoctx init scaffolds a CI quality gate, a PR-review workflow, and an optional pre-commit hook into any repo.

// mcp-server

Wire it straight into your agent

repoctx mcp starts a stdio MCP server that exposes repoctx as agent-callable tools — context, impact, AX and convergence scores, and merge gates — with a persisted repo-index cache that refreshes when files change.

  • repo_inspect
  • repo_map
  • repo_index
  • repo_search
  • context_pack
  • change_impact
  • agent_experience
  • convergence_score
  • review_context
  • review_gate
  • review_verdict
  • workspace_report
  • repo_harness
→ host config for claude · cursor · vscode
claude_desktop_config.json
{
  "mcpServers": {
    "repoctx": {
      "command": "npx",
      "args": ["-y", "@nugehs/repoctx", "mcp"]
    }
  }
}
 ____   _____   ____    ___    ____   _____  __  __
|  _ \ | ____| |  _ \  / _ \  / ___| |_   _| \ \/ /
| |_) ||  _|   | |_) || | | || |       | |    \  /
|  _ < | |___  |  __/ | |_| || |___    | |    /  \
|_| \_\|_____| |_|     \___/  \____|   |_|   /_/\_\

Give your agents context they can trust

Install globally, or run it once with npx. Then point your agent at it.

$ npm install -g @nugehs/repoctx
$ repoctx context "your task" --path .