Structure-Aware Context Gathering for Agentic tools

Problem:
The assistant currently reads entire source files instead of focusing on their structural elements (e.g., function or class declarations).

Because the AI consumes more code than it can fit into its context window, it sometimes misses the specific function i am asking about.

As a side effect, models such as Sonnet 4.0 often regenerate functions that already exist, giving them almost identical names and parameters and appending them to the end of the file.

My Suggestion:
Provide a user-controllable “Read Structure-Only” search tool or API flag that guarantees the assistant works from the indexed structural outline - signatures of functions, methods, classes, and top-level constants.

I think Codebase indexing should do the same but it does not work all time as i am expect

My request probably similiar to this one git37 - A clean and easy way to refresh the project directory and file structure in memory Feature Requests