Multi prong attack, first build a index you and your agent can work on. Prompt 1.
I have very big file that really cannot be separated and we somehow need to extract as much information as possible while staying under a tight token limit. I need you to scan the first 1000 line of code and extract all the function names with a very very short technical overview if the function name is not clear in its task and it must have a line reference for each functions. Save the information in l.index.
repeat untill you have the local index completed.
Then when you need something done.
I added a quick index of all the function of the current application, i would like to implement X what would be the optimal way to do it. Make sure to integration point, function to be updated with proper line reference.
Agent does his search, give his plan.
From there you can either work with the agent to add-remove details to the plan or use specialised agent you built for your application howw exactly how you want the plan to be formulated. Then
I would like you to read tasks.md and complete the task number X, make sure to follow proper procedure outlined in fileY (Or can be change for a please read all the various .md file, omit file x/y/z or folder/z). Once you are done make sure to run unit and integration test for the updated function/addition and fix issues. Then update the tasks document and signal completion with a summary of your work.
Thats how i work with my agents and i have a codebase over 20 thousand line of code if not more, i stopped counting at about 15k and kept working on it for weeks. My app work nicely and i know craptastic in coding, but i know a lot about managing and organisation and agents are basicly that, assets you have to manage not tell what to do. Use their expertise, THEY should come up with a plan and you then approuve, edit or ask for a totally new plan taking X y Z into consideration.
I dont care about models to be honest, once you get a good structure, grok-1 fast or any other “decent” coding LLM can do the trick, make sure to leverage MCP, lots of MCP can help.
If your coding language is less known you might want to include some API documentation. Another thing you can do is ask the agent to split that index into multiple version, like if you know you will be working front end for the next 2-week or whatever, ask the agent to isolate all the function in the l.index.md and save it in fr.index.md. The reason why i say index.md instead of other type is that YOU can also tailor the index the way you want it manually, its not in a machine-only readable format and can still be use since agent are conversational.
Hell i even asked an agent to gather and make an docuemented API for the game stormwork for modding but also LUA coding, gave him browser access and watched him build that local API to use with the game. Dont tell them what to do, tell them what you want and how can they do it FOR you. That way not only will you know how they will do it, but after working like that for a long period of time you will start to know each model quiirks and bonus in their reflection pattern and identify gaps before they even appear, i try to share as much as i can, but there is so many tiny difference that it ends up being a gut-feeling guiding you than simply being able to describe. Like that “something feel off” kinda feeling, cannot explain you just know, well its kinda like that with agents.