ask

A codebase question command that chooses between code-graph tracing, meaning-based search, risk analysis, or direct file reading.

In plain words
What is it for?
Use it to trace how code works, find files or functions, assess a change's blast radius, or answer a narrow question from a specific file.
Why use it?
It helps answer questions about unfamiliar code without manually searching every file. It matches the method to whether you need architecture, location, or change-impact information.

Command for Claude Code

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.

agentmods
npx agentmods add commands/brain-bootstrap/claude-code-brain-bootstrap/ask
Clone the repo
git clone --depth 1 https://github.com/brain-bootstrap/claude-code-brain-bootstrap

Made for: Claude Code.

Per session 17 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 466 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
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 $0.00017 $0.00466
Opus 5 $0.00009 $0.00233
Sonnet 5 $0.00003 $0.00093
Haiku 4.5 $0.00002 $0.00047

Measured 2d ago against content hash 3ef48f152891, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

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.

.claude/commands/ask.md · 48 lines

What it actually says

Codebase Question Router

Answer this question about the codebase: $ARGUMENTS

Route to the right tool based on question type. Don't search files manually when a smarter tool exists.

Routing rules

Classify the question and use the corresponding tool:

Architecture / flow / how does X work / trace a call

Use mcp__codebase-memory-mcp__trace_path or mcp__codebase-memory-mcp__get_architecture. Also read graphify-out/GRAPH_REPORT.md if it exists — it contains god nodes, community structure, and surprising cross-module connections already analyzed.

Find / search / locate / what file / which function

Use mcp__cocoindex-code__search with a semantic query. This finds code by meaning, not exact text — useful when you don't know the exact name.

Safe to change / impact / blast radius / what breaks / risk score / dependencies

Use mcp__code-review-graph__detect_changes_tool with base_branch="main". Reports: risk score 0–100, blast radius (files affected), breaking changes, dependent modules.

General code question (no plugin available / question is narrow / specific file)

Read the file directly. Grep for the symbol. Don't over-route simple questions.

Decision logic

  1. If $ARGUMENTS contains architecture/flow/trace/how/explain → codebase-memory-mcp + graphify
  2. If $ARGUMENTS contains find/search/locate/where/what file → cocoindex
  3. If $ARGUMENTS contains safe/impact/blast/breaks/risk/change/affect → code-review-graph
  4. If none match → read directly, use Grep/Glob

Answer format

Give a direct, concise answer. Include:

  • The tool used and why
  • The finding (file path + line if applicable)
  • Any surprising connections the graph revealed (if applicable)

If the question cannot be answered from graph/search alone, fall back to reading the relevant files.

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 First seen · 48 lines · 17 tokens per session scan A 3ef48f152891

Subscribe to this mod's changes

ask is a command published in the GitHub repository brain-bootstrap/claude-code-brain-bootstrap (11 stars, last pushed 4mo ago), licensed MIT. It adds 17 tokens to every session and 466 once invoked, about $0.0001 per session on Opus 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.