ask_codebase
Ask natural-language questions about your local codebase and receive synthesized answers with file:line references. Reuse thread names for turn-based steering to maintain context.
Instructions
Ask a natural-language question about the local codebase, with turn-based steering.
Headless Claude Code explores the repo READ-ONLY (Read/Grep/Glob) and returns a synthesized answer with file:line references -- no need to attach or paste files.
thread: optional name (e.g. "auth-investigation"). Reuse the SAME name across questions to STEER: each follow-up keeps the prior session's context, so you can redirect ("no, the token check is in middleware.py -- re-check there") and it stays cheap (prompt-cache hits). Omit for a one-off fresh session. model: optional model (e.g. "sonnet", "opus"). For a thread it BINDS on the first call; a DIFFERENT model on an existing thread is refused, because switching forces a full-context reprocess -- start a new thread instead. Ephemeral (no-thread) calls just use the given model. effort: optional reasoning effort -- low, medium, high, xhigh, max. Per-call (safe to vary within a thread; unlike model it does not invalidate the cache). Lower = cheaper/faster; raise it for hard cross-file reasoning. show_steps: when true, append the exploration trail (which files it read, what it grepped) so you can see HOW it reached the answer and steer the next turn.
Each answer ends with a [bridge] cost footer (call cost + cache hit rate, plus the thread's running total). Call bridge_cost for the full ledger.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| model | No | ||
| effort | No | ||
| thread | No | ||
| question | Yes | ||
| show_steps | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |