Best practice for AI codebase context

An ageneric AI coding question:

What have you found to work best for examining a new code base and then creating a file for my assistant it can use without clogging the context too much. So far I’ve tried the vanilla CLI tools functionalities e.g. /init Gemini CLI, opencode to explore and understand the code base with mixed results and wonder if there’s a way to supercharge that. Maybe by using something like deep research over the code base (if it’s hosted on GitHub) or set up a full RAG workflow?