Searching a large codebase fills the conversation with the files that get read. For a search like that, ask the agent to give the job to a subagent, and the files it reads stay in the subagent's conversation.
You can write your own subagent as a file in the repo's .claude/agents/ folder, or have the agent write it. If you want to set up shared settings for your team together, look at Work with me.