Skip to content

Your first query

All three commands below run locally against the index at .codehub/. None of them open sockets once the index is built (add --offline to analyze to also prove zero network during indexing).

codehub query fuses BM25 lexical search with HNSW vector search (when embeddings are present) to find symbols related to a natural-language concept.

find symbols related to an auth flow
codehub query "auth token refresh"

Expected shape (abridged):

process: auth.refresh_token — 7 steps, 4 files
1. refreshToken (src/auth/handler.ts:42)
2. validateRefreshToken (src/auth/validate.ts:18)
3. ...
process: oauth.rotate_session — 5 steps, 3 files
1. rotateSession (src/oauth/rotate.ts:12)
2. ...

Results are grouped by process (an execution flow the indexer detected during clustering), not a flat symbol list. Use --limit, --bm25-only, or --granularity file to change the shape.

codehub context <symbol> returns callers, callees, and the processes the symbol participates in.

context for a single symbol
codehub context PaymentProcessor

Expected shape:

PaymentProcessor (Class, src/payments/processor.ts:24)
callers:
- checkout.charge (src/checkout/charge.ts:88)
- subscriptions.renew (src/subscriptions/renew.ts:56)
callees:
- validateCard, stripeClient.createCharge, auditLog.write
processes:
- payments.checkout (12 steps)
- payments.renewal (8 steps)
ACCESSES edges:
- ProcessorConfig (read), AuditLog (write)

Pass --json to get the structured envelope that the MCP context tool returns.

codehub impact <symbol> reports how many symbols, files, and processes depend on the target, plus a risk tier (LOW / MEDIUM / HIGH / CRITICAL).

depth-2 blast radius
codehub impact validateUser --depth 2

Expected shape:

impact(target = validateUser, depth = 2)
direct callers: 14
transitive callers (depth 2): 37
affected processes: 3
risk tier: HIGH
confidence: 0.82

--direction up restricts to dependents (who calls me), --direction down restricts to dependencies (who do I call), and --direction both (the default) returns both in one response.