Idea: Provide File Tree Context to AI for Better Structural Understanding #97
mazuralexandru
started this conversation in
Ideas
Replies: 1 comment 2 replies
-
|
Ideally you should have header file for your large utils, don't you agree? I'm not sure what value plain paths provide to the model. |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment


Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Problem:
My C++ project has large utils (>100k tokens). While the large context window allows including them fully, it's inefficient as the AI primarily needs to know about the files' existence and location. This forces a choice between excessive context window usage with largely irrelevant code (including them) or incomplete structural context (excluding them).
Solution:
Provide AI context with the project file tree (paths/names) alongside selected file contents.
Benefit:
This ensures the AI understands the full project structure, enabling it to better handle imports, suggest cross-file function calls, and generate more contextually accurate code, without cluttering the prompt unnecessarily.
Example Scenario:
Consider this project structure:
In this scenario, if I'm working on
src/core_logic.cpp, I want the AI to knowutils/data_parser.cppandutils/image_processor.cppexist for accurate include suggestions or understanding potential dependencies, but I don't want their 100k+ tokens consuming the context window unnecessarily. Providing just the tree structure would solve this.Here's how where I would place the button:

If you like the idea but don't have time, I can try implementing it and send a pull request.
Beta Was this translation helpful? Give feedback.
All reactions