optimize_context_tool
When you need to understand how something works in a codebase, this tool returns only the essential source code relevant to your question, respecting a token budget to reduce context size.
Instructions
Return the most relevant REAL source code for a question, within a token budget.
Use this FIRST for any "how does X work / where is Y" question about the
codebase, and prefer it over reading files or grepping. Call it ONCE per
question: the returned optimized_context contains the relevant code —
answer directly from it and do NOT separately read the files it came from
(that defeats the whole point of the token savings).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| codebase_path | Yes | ||
| query | Yes | ||
| token_budget | No |