rb-ask

rb-ask is a command for Claude Code from study8677/repobrain. It costs 33 tokens per session (605 once invoked), scanned A, original, MIT.

A command for asking questions about the current codebase through RepoBrain, a code knowledge tool.

In plain words
What is it for?
Use it to investigate how code works, then follow up with targeted file searches when the returned explanation lacks detail.
Why use it?
It can provide project-specific answers without requiring you to manually search through every file.

Command for Claude Code

Written for Claude Code: allowed-tools in frontmatter. Also seen: mentions Codex.

Part of the repobrain plugin — 4 skills, 7 commands, 1 hook shipped together

Good fit Use it to investigate how code works, then follow up with targeted file searches when the returned explanation lacks detail.

Compare 6 commands from other repositories ↓
Install with agentmods
npx agentmods add commands/study8677/repobrain/rb-ask
About the project

RepoBrain is a repository knowledge engine that lets coding agents ask grounded questions about a codebase and receive answers linked to source files and lines. It is for developers using Claude Code, Cursor, Codex, Windsurf, and other AI coding tools. Catalogue add-ons extend its commands, instructions, skills, rules, plugin, and hook workflows.

study8677/repobrain · 1,346 stars · on GitHub · deepwiki.com

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Clone the repo
git clone --depth 1 https://github.com/study8677/repobrain

Made for: Claude Code.

Or install repobrain, the plugin that ships this one along with the rest of its 4 skills, 7 commands, 1 hook.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for rb-ask

README.md
[![agentmods](https://agentmods.dev/badge/commands/study8677/repobrain/rb-ask/github.svg)](https://agentmods.dev/commands/study8677/repobrain/rb-ask)
Your own site
<a href="https://agentmods.dev/commands/study8677/repobrain/rb-ask"><img src="https://agentmods.dev/badge/commands/study8677/repobrain/rb-ask/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for rb-ask

Your own site · 80×15
<a href="https://agentmods.dev/commands/study8677/repobrain/rb-ask"><img src="https://agentmods.dev/badge/commands/study8677/repobrain/rb-ask.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 33 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 605 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00033 $0.00605
Opus 5.5 $0.00013 $0.00242
Sonnet 5.5 $0.00007 $0.00121
Haiku 4.5 $0.00003 $0.00060

Measured 2d ago against content hash a611b5a8e368, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

rb-ask scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

commands/rb-ask.md · 56 lines

What it actually says

Run the RepoBrain CLI for the current workspace:

通过 RepoBrain CLI 询问当前工作区:

The engine prefers knowledge for HEAD, otherwise a compatible ancestor on the current history. Uncommitted edits are allowed: use knowledge as background, inspect current source for changed behavior, and keep freshness notices. Never use unrelated sibling knowledge or automatically start a refresh. If no usable knowledge exists on current history, report the rb-refresh hint.

允许边改边问。引擎优先读当前提交的知识,没有时读当前分支祖先版本;旧知识作为背景, 修改处以当前源码为准,保留时效提示。不要借用其他分支独有的知识,也不要自动刷新。 当前历史上没有可用知识时,再提示先运行 rb-refresh。

$ARGUMENTS

Use Bash:

RB_ASK_TIMEOUT_SECONDS="${RB_ASK_TIMEOUT_SECONDS:-120}" rb-ask "$ARGUMENTS" --workspace "$PWD"

If .env sets RB_HOST_RUNNER (codex or generic), the same command drives the user's local logged-in CLI (Codex / Trae / Claude / …) for rb-ask instead of an API key. The same host-runner backend also powers rb-refresh (tool-free stages run through the CLI; conventions and git insights degrade to deterministic output).

如果 .env 设置了 RB_HOST_RUNNER(codex 或 generic),同一个命令会通过 用户本机已登录的 CLI(Codex / Trae / Claude / …)运行 rb-ask,不走 API key。 同一套 host-runner 后端也支撑 rb-refresh(无工具阶段走 CLI,conventions 与 git insights 降级为确定性产物)。

使用 Bash:

RB_ASK_TIMEOUT_SECONDS="${RB_ASK_TIMEOUT_SECONDS:-120}" rb-ask "$ARGUMENTS" --workspace "$PWD"

If rb-ask is not found, tell the user the engine CLI is not installed and suggest:

如果找不到 rb-ask,说明 engine CLI 尚未安装,建议用户运行:

pipx install "git+https://github.com/study8677/repobrain.git#subdirectory=engine"

Prefer rb-ask over manual file search. If the answer returns insufficient detail, follow up with targeted Read/Grep.

优先使用 rb-ask,不要先手动搜索文件。如果返回的信息不够,再用有目标的 Read/Grep 补充。

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2d ago Changed · +10 lines a611b5a8e368
  2. 1mo ago First seen · 46 lines · 33 tokens per session scan A 971b9ef387d2

Subscribe to this mod's changes

rb-ask is a command published in the GitHub repository study8677/repobrain (1,346 stars, last pushed 2d ago), licensed MIT. It adds 33 tokens to every session and 605 once invoked, about $0.0001 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.