Hey @swapnil66
Thank you for reporting the issue.
First and foremost, Cody has a hard limit in regards to input tokens. They are, for the most models, constraint to 45k tokens. Within this limitations there are a lot use cases, which can be processed successfully. You can read more here: Cody Input and Output Token Limits - Sourcegraph docs
Based on your description, you are using the Agentic Chat model and have difficulties to find a way for Cody understand and comprehend your codebase.
Which works for me with the Agent Chat model in a mid-size till large codebase is to create a kind of rule document, where I include several rules in it for specific scenarios as a Markdown .md file
To understand the project structure, I use the git ls-tree -r --name-only HEAD
command in that rule file with the following prompt:
- **Project Structure:** Use `git ls-tree -r --name-only HEAD` to inspect the project structure
Then in the chat, I reference this rule document without using the @whole_repo
item and let Cody comprehend the project structure. It can mostly derive what purpose a folder have. The advantage of this shell command is, that it follows the .gitignore file and only shows the up-to-date worktree. In follow-up messages, I include the files of a specific folder if I’m interested of a feature or module in general (depending on the size of the file contents).
Here and then, it is advisable to let Cody summarize what it knows so far for later use as reference in future sessions.
Important in all those steps is, that your project is initialized as a git repository and you made a first commit including all files from your project since Cody uses internally git commands for fetching context and in local scenarios indexing the whole repo is beneficial.
You can manually trigger the indexing by open the command palette with CTRL + SHIFT + P and searching for “Cody: Update search index…”. This triggers the local indexing for Codys’ symbol finder code search module which is needed especially if you include the @whole-repo
item. After every commit, the automatic indexing update triggers.
I hope that helps and if you have additional questions, then I’m here.