ECC
The agent harness performance optimization system. Skills, instincts, memory, security, and research-first development for Claude Code, Codex, Opencode, Cursor and beyond.
npx ecc-install --profile fullThe agent harness performance optimization system. Skills, instincts, memory, security, and research-first development for Claude Code, Codex, Opencode, Cursor and beyond.
npx ecc-install --profile fullFair-code workflow automation platform with native AI capabilities. Combine visual building with custom code, self-host or cloud, 400+ integrations.
npx n8nAn open-source AI agent that brings the power of Gemini directly into your terminal.
npx @google/gemini-cliFormerly known as Antigravity Workspace Template β same project, new name.
Sponsored placement: DolOffer (GitHub project) offers discounted GPT and Claude membership recharge, official subscriptions, and after-sales support. Use code AI8888 for 10% off. Disclaimer: This is a paid sponsor placement. DolOffer services, pricing, availability, and support are provided by DolOffer; please review their terms before purchase.
# 1 β Install (Claude Code plugin marketplace)
/plugin marketplace add study8677/repobrain
/plugin install repobrain@repobrain
# 2 β Pick LLM provider, build the knowledge base
/repobrain:rb-setup
/repobrain:rb-refresh
# 3 β Ask anything, grounded in real code with file paths + line numbers
/repobrain:rb-ask "How does auth work?"
Note: the plugin/package ID is still
repobrain; it will migrate in a future release.
99% factual Β· 2.1Γ faster than Codex CLI Β· works in any AI IDE. Head-to-head benchmark β Codex CLI users β drop the
repobrain:prefix; the same four slash commands ship there too.
Cross-IDE repository knowledge engine for grounded codebase Q&A. Same .repobrain/ knowledge layer reads in every IDE; one engine, every host.
An AI Agent's capability ceiling = the quality of context it can read.
rb-refresh deploys a multi-agent cluster that autonomously reads your code β each module gets its own Agent that generates a knowledge doc. rb-ask routes questions to the right Agent, grounded in real code with file paths and line numbers.
Instead of handing Claude Code / Codex a repo-wide grep and making it hunt on its own, give it a ChatGPT for your repository.
Traditional approach: RepoBrain approach:
CLAUDE.md = 5000 lines of docs Claude Code calls ask_project("how does auth work?")
Agent reads it all, forgets most Router β ModuleAgent reads actual source, returns exact answer
Hallucination rate stays high Grounded in real code, file paths, and git history
| Problem | Without RepoBrain | With RepoBrain |
|---|---|---|
| Agent forgets coding style | Repeats the same corrections | Reads .repobrain/conventions.md β gets it right the first time |
| Onboarding a new codebase | Agent guesses at architecture | rb-refresh β ModuleAgents self-learn each module |
| Switching between IDEs | Different rules everywhere | One .repobrain/ folder β every IDE reads it |
| Asking "how does X work?" | Agent reads random files | ask_project MCP β Router routes to the responsible ModuleAgent |
Architecture is files + a live Q&A engine, not plugins. Portable across any IDE, any LLM, zero vendor lock-in.
Asymmetric benchmark on three real-world Python codebases β fastapi/fastapi,
psf/requests, fastapi/sqlmodel β asking each tool the same 36 questions
across three difficulty bands. All three tools used gpt-5.5 with high
reasoning effort; Codex and Claude had full read access to the workspace.
Codex was the grader (4-axis 0β3 rubric, scores verified against actual source).
| Question type | RepoBrain | Codex CLI | Claude Code |
|---|---|---|---|
| 15 factual lookups | 179/180 (99%) | 179/180 (99%) | 178/180 (99%) |
| 12 synthesis (project / arch tour) | 116/144 (81%) | 144/144 (100%) | 136/144 (94%) |
| 9 audit / security | 105/108 (97%) | 104/108 (96%) | 98/108 (91%) |
Combined factual + audit (24 cells): RepoBrain 284/288, Codex 283/288, Claude 276/288. RepoBrain edges out both β at lower latency than Codex on every single question.
Latency (mean wall-clock per question, same proxy):
| Question type | RepoBrain | Codex | Claude |
|---|---|---|---|
| Factual | 56s | 119s | 42s |
| Audit | 160s | 177s | 100s |
RepoBrain is 2.1Γ faster than Codex on factual and on par with Codex on audit, while matching or beating it on correctness. Claude is fastest on audit but loses 7 percentage points of correctness.
Two engine fixes landed during the benchmark, both committed in this branch:
_ask_with_agent_md now surfaces project-level docs (conventions.md,
module_registry.md, map.md, structure.md) into its answer prompts.
Removes the "module knowledge does not include project-wide conventions"
refusal pattern.search_code, read_file,
list_directory, read_file_metadata, search_by_type bound at runtime,
so the LLM can grep and read actual source instead of paraphrasing the KG.Full report (data, methodology, per-cell tables, caveats):
artifacts/benchmark-2026-05-09/REPORT.md.
Plugin install for Claude Code / Codex CLI (recommended β the engine CLI auto-installs on first session via SessionStart hook):
# Claude Code
/plugin marketplace add study8677/repobrain
/plugin install repobrain@repobrain
/repobrain:rb-setup # interactive: pick LLM provider, paste API key, writes .env
/repobrain:rb-refresh # first refresh auto-creates .repobrain/
/repobrain:rb-ask "How does this project work?"
# Codex CLI (manual engine install β Codex hooks are not yet supported)
pipx install "git+https://github.com/study8677/repobrain.git#subdirectory=engine"
codex plugin marketplace add study8677/repobrain
/rb-setup
/rb-refresh
/rb-ask "How does this project work?"
Codex auto-discovers slash commands from the plugin's commands/ directory, so the same four commands work without the repobrain: namespace prefix. The raw CLI calls (rb-refresh --workspace ., rb-ask "..." --workspace .) also still work. If your Codex build supports MCP, register rb-mcp --workspace <project> separately.
# 1. Install engine + CLI
pip install "git+https://github.com/study8677/repobrain.git#subdirectory=cli"
pip install "git+https://github.com/study8677/repobrain.git#subdirectory=engine"
# 2. Configure .env with any OpenAI-compatible API key
cd my-project
cat > .env <<EOF
OPENAI_BASE_URL=https://your-endpoint/v1
OPENAI_API_KEY=your-key
OPENAI_MODEL=your-model
RB_ASK_TIMEOUT_SECONDS=120
EOF
# 3. Build knowledge base (ModuleAgents self-learn each module)
rb-refresh --workspace .
# 4. Ask anything
rb-ask "How does auth work in this project?"
# 5. (Optional) Register as MCP server for Claude Code
claude mcp add repobrain rb-mcp -- --workspace $(pwd)
pip install git+https://github.com/study8677/repobrain.git#subdirectory=cli
rb init my-project && cd my-project
# IDE entry files bootstrap into AGENTS.md; dynamic knowledge is in .repobrain/
See INSTALL.md for full details and troubleshooting.
Same four slash commands ship to both Claude Code and Codex CLI. Claude namespaces them as /repobrain:<name>; Codex auto-discovers commands/ and surfaces the bare /<name> form. No retraining β same flow on both hosts.
| Claude Code | Codex CLI | Purpose |
|---|---|---|
/repobrain:rb-setup | /rb-setup | First-time setup β pick LLM provider, write .env |
/repobrain:rb-refresh [quick] | /rb-refresh [quick] | Build / incrementally refresh the project knowledge base |
/repobrain:rb-ask <question> | /rb-ask <question> | Routed Q&A on the current codebase |
/repobrain:rb-init <name> | /rb-init <name> | Scaffold a new multi-agent repo from this template |
A typical first session is rb-setup β rb-refresh β rb-ask.
rb-setup β first-time configurationRun this once per project, right after installing the plugin. Interactive picker for the LLM provider (OpenAI / DeepSeek / Groq / ιΏιη΅η§― / NVIDIA NIM / Ollama local / any OpenAI-compatible endpoint), then writes .env to the project root with OPENAI_BASE_URL, OPENAI_API_KEY, OPENAI_MODEL, RB_ASK_TIMEOUT_SECONDS. It can also write an explicit local Codex host-runner config for experimental no-API-key rb-ask. Also ensures .env is in .gitignore. Skip it if you already have a working .env.
rb-refresh β build / refresh the knowledge baseDeploys the multi-agent cluster to read your code: each module gets its own Agent that produces a knowledge doc under .repobrain/agents/*.md, plus a map.md routing index. Run after install, after significant code changes, or when rb-ask returns stale answers. The first refresh auto-creates .repobrain/ β no separate init step needed. Pass quick for an incremental update, failed-only to rerun only previously failed modules.
Time: a few minutes for small repos, longer for large ones. Requires rb-setup to have completed. Full LLM refresh requires an API-key/OpenAI-compatible provider; local host-runner mode can use RB_REFRESH_SCAN_ONLY=1 rb-refresh --workspace . for scan artifacts.
rb-ask β routed Q&A on the codebaseThe main reason this plugin exists. Routes your question to the right ModuleAgent (and GitAgent when applicable), then returns an answer grounded in actual source with file paths and line numbers. Use it before manually grepping or reading files β it's faster and more accurate. Good question shapes: "where is X defined/handled?", "why was Y done this way?", "how does the auth flow work?", "what depends on module Z?".
Requires a knowledge base β if you see "no index" or empty answers, run rb-refresh first.
rb-init β scaffold a new multi-agent repoCreates a new project from the RepoBrain template. Two modes: quick (fast scaffold, clean copy) and full (adds runtime profile, .env, mission file, sandbox config, optional git init). This is for starting a new repo β you do not need it before rb-refresh on an existing project.
The plugin also bundles the
agent-repo-initskill (the same backend thatrb-initinvokes β Codex / Claude can also match it by description) and the optionalrb-mcpMCP server (ask_project+refresh_project) for tool-style integration.
| Layer | Channels | Contract |
|---|---|---|
| Native plugins | Claude Code, Codex CLI | Bundled slash commands for rb-setup, rb-refresh, rb-ask, and rb-init. |
| Compatible IDEs | Cursor, Windsurf, Gemini CLI, VS Code + Copilot, Cline, Aider | Use shared context files, the rb/rb-* CLI entrypoints, or an MCP client. |
| Advanced tool integration | rb-mcp | Exposes ask_project and refresh_project for hosts that can call MCP tools. |
| Workspace bootstrapping | rb-init, rb init | Starts a new repo or injects portable agent context into an existing one. |
The native plugins are the first-class install path today. Other environments are supported through the same repository knowledge artifacts rather than separate host-specific plugin packages.
rb init Inject context files into any project (--force to overwrite)
β
βΌ
.repobrain/ Shared knowledge base β every IDE reads from here
β
ββββΊ rb-refresh Dynamic multi-agent self-learning β module knowledge docs + structure map
ββββΊ rb-ask Router β ModuleAgent Q&A with live code evidence
ββββΊ rb-mcp Optional MCP server β IDE tool integration
Dynamic Multi-Agent Cluster β During rb-refresh, files are grouped by import graph, directory co-location, and filename prefix. Each sub-agent gets ~30K tokens of focused, related code pre-loaded (no tool calls needed) and writes a comprehensive Markdown knowledge doc to agents/*.md. Large modules β multiple agent docs in parallel (no merging, no information loss). A Map Agent indexes everything into map.md. During rb-ask, the Router reads map.md to pick modules, then feeds their agent docs to answer agents. Fully language-agnostic β pure directory-structure module detection, LLM-driven code analysis.
GitAgent β Dedicated agent for analyzing git history β who changed what and why.
NLPM Audit Feedback β Improved by NLPM, a natural-language programming linter by xiaolai.
rb-refresh β Multi-agent self-learning (8-step pipeline)rb-refresh --workspace my-project
conventions.mdstructure.md β language-agnostic file tree with line countsknowledge_graph.json + mermaid)agents/*.md). Large modules get multiple agent docs (one per group, no merging). Global API concurrency control prevents rate-limiting. Fully language-agnostic β works with any programming language._git_insights.mdmap.md (module routing index with descriptions and key topics)rb-ask β Router-based Q&Arb-ask "How does auth work in this project?"
Router reads map.md β selects modules β reads agents/*.md β LLM answers with code references. Multiple agent docs are read in parallel, then a Synthesizer combines answers.
Falls back to the legacy Router β ModuleAgent/GitAgent swarm when agent docs are not yet generated.
agent.md files β no merging or compression. Parallel reads + Synthesizer recombines at answer time.RB_API_CONCURRENCY limits total simultaneous LLM calls.__init__.py or any language-specific marker required.Architecture is encoded in files β any agent that reads project files benefits:
| IDE | Config File |
|---|---|
| Cursor | .cursorrules |
| Claude Code | CLAUDE.md |
| Windsurf | .windsurfrules |
| VS Code + Copilot | .github/copilot-instructions.md |
| Gemini CLI / Codex | AGENTS.md |
| Cline | .clinerules |
| Google Antigravity | .repobrain/rules.md |
All are generated by rb init: AGENTS.md is the single behavioral rulebook, IDE-specific files are thin bootstraps, and .repobrain/ stores shared dynamic project context.
Instead of reading hundreds of documentation files, Claude Code can call ask_project as a live tool β backed by a dynamic multi-agent cluster: Router routes questions to the right ModuleAgent, returning grounded answers with file paths and line numbers.
Setup:
# Install engine
pip install "git+https://github.com/study8677/repobrain.git#subdirectory=engine"
# Refresh knowledge base first (ModuleAgents self-learn each module)
rb-refresh --workspace /path/to/project
# Register as MCP server in Claude Code
claude mcp add repobrain rb-mcp -- --workspace /path/to/project
Tools exposed to Claude Code:
| Tool | What it does |
|---|---|
ask_project(question) | Router β ModuleAgent/GitAgent answers codebase questions. Returns file paths + line numbers. |
refresh_project(quick?) | Rebuild knowledge base after significant changes. ModuleAgents re-learn the code. |
MCPClientManager lets your agents connect to external MCP servers (GitHub, databases, etc.), auto-discovering and registering tools.
// mcp_servers.json
{
"servers": [
{
"name": "github",
"transport": "stdio",
"command": "npx",
"args": ["-y", "@modelcontextprotocol/server-github"],
"enabled": true
}
]
}
Set MCP_ENABLED=true in .env to make configured servers available, and set RB_ALLOW_MCP=true only when you want rb-ask to auto-connect those external servers. Stdio MCP servers inherit process environment plus configured env values, so treat enabled servers as local-permission code.
| Variable | Default | Options |
|---|---|---|
SANDBOX_TYPE | local | local Β· microsandbox |
SANDBOX_TIMEOUT_SEC | 30 | seconds |
RB_RETRIEVAL_MODE | compact | off Β· compact Β· full |
The default sandbox is for trusted local workspaces, not untrusted code isolation. Retrieval graph files redact common secrets before writing to disk, but full mode can still preserve source snippets. See Sandbox docs.
| Command | What it does | LLM needed? |
|---|---|---|
rb init <dir> | Inject cognitive architecture templates | No |
rb init <dir> --force | Re-inject, overwriting existing files | No |
rb refresh --workspace <dir> | CLI convenience wrapper around the knowledge-hub refresh pipeline | Yes |
rb ask "question" --workspace <dir> | CLI convenience wrapper around the routed project Q&A flow | Yes, or local Codex host runner |
rb-refresh | Multi-agent self-learning of codebase, generates module knowledge docs + conventions.md + structure.md | Yes |
rb-ask "question" | Router β ModuleAgent/GitAgent routed Q&A | Yes, or local Codex host runner |
rb-mcp --workspace <dir> | Start MCP server β exposes ask_project + refresh_project to Claude Code | Yes |
rb report "message" | Log a finding to .repobrain/memory/ |
rb ask / rb refresh are available when both cli/ and engine/ are installed. rb-ask / rb-refresh are the engine-only entrypoints.
repobrain/
βββ cli/ # rb CLI β lightweight, pip-installable
β βββ templates/ # .cursorrules, CLAUDE.md, .repobrain/, ...
βββ engine/ # Multi-agent engine + Knowledge Hub
βββ repobrain_engine/
βββ _cli_entry.py # rb-ask / rb-refresh / rb-mcp + python -m dispatch
βββ config.py # Pydantic configuration
βββ hub/ # β
Core: multi-agent cluster
β βββ agents.py # Router + ModuleAgent + GitAgent
β βββ contracts.py # Pydantic models: claims, evidence, refresh status
β βββ ask_pipeline.py # agent.md + graph-enriched ask
β βββ refresh_pipeline.py # LLM-driven refresh β agents/*.md + map.md
β βββ ask_tools.py
β βββ scanner.py # multi-language project scanning
β βββ module_grouping.py # smart functional file grouping
β βββ structure.py
β βββ knowledge_graph.py
β βββ retrieval_graph.py
β βββ mcp_server.py
βββ mcp_client.py # MCP consumer (connects external tools)
βββ memory.py # Persistent interaction memory
βββ tools/ # MCP query tools + extensions
βββ skills/ # Skill loader
βββ sandbox/ # Code execution (local / microsandbox)
CLI (pip install .../cli) β Zero LLM deps. Injects templates, logs reports & decisions offline.
Engine (pip install .../engine) β Repository knowledge runtime. Powers rb-ask, rb-refresh, rb-mcp. Uses the OpenAI-compatible endpoint written by rb-setup (OpenAI, DeepSeek, Groq, DashScope, NVIDIA NIM, Ollama, or custom). Experimental local mode can set RB_HOST_RUNNER=codex so rb-ask runs through the user's local codex login instead of an API key; this is for personal/local use and is not a hosted product backend.
Skill packaging:
engine/repobrain_engine/skills/graph-retrieval/ β graph-oriented retrieval tools for structure and call-path reasoning.engine/repobrain_engine/skills/knowledge-layer/ β project knowledge-layer tools for semantic context consolidation.For local work on this repository itself:
python3 -m venv venv
source venv/bin/activate
pip install -e ./cli -e './engine[dev]'
pytest engine/tests cli/tests
Ideas are contributions too! Open an issue to report bugs, suggest features, or propose architecture.
MIT License. See LICENSE for details.
Built for the AI-native development era
Friendly Link: LINUX DO
| No |
rb log-decision "what" "why" | Log an architectural decision | No |