code_query
Locate code symbols, references, callers, and file contents in a workspace without creating a task. Use read-only modes to outline, search, map impact, or validate changes.
Instructions
Look things up fast, no task needed: where is X, who calls it, what's in this file. mode: outline|symbols|body|map|search|impact|references|callers|callees|tests|validate|capabilities. Read-only.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| dir | No | map only: subdir inside workspace_dir (escapes rejected). | |
| file | No | Required for outline/callers/callees/impact/tests/validate; optional with symbol for references. | |
| kind | No | references only: filter by kind (call,import,use,assign,extends,implements; comma-separated). | |
| line | No | callers/callees: disambiguate a line. | |
| mode | Yes | map=compact paged overview (+dir drill); body=read file/symbol content without a task; search=code_search intent search; tests=find_tests candidates; validate=sandbox_validate content; capabilities=list; capability=describe by name. | |
| name | No | capability mode: exact original tool name. | |
| page | No | map only: page number (default 1; pass next_page). | |
| rich | No | body only: include rich projection (outline). | |
| depth | No | callers/callees/impact: traversal depth. | |
| limit | No | Max rows (symbols, references). | |
| query | No | Required for symbols (substring); capabilities: optional name/summary filter. | |
| cursor | No | capabilities mode: pagination offset (from next_cursor). | |
| symbol | No | Required for references; optional with file for callers/callees/impact. | |
| options | No | Advanced per-mode passthrough to the original tool (e.g. callers: max_callers; impact: symbols/change_type; body: locators/context_lines). Protected keys rejected; full schema via mode=capability. | |
| category | No | capabilities mode: filter by category (e.g. query/audit/maintain). | |
| page_size | No | map only: entries per page (default 12; packing hint). | |
| max_tokens | No | map only: map token budget (default 700). | |
| budget_hint | No | body only: max chars (default 1200; 0 = full, hard-capped). | |
| new_content | No | validate only: candidate full content to check (no write). | |
| workspace_dir | Yes | Root (abs). Any workspace path works — a fresh one is indexed automatically on first read. |