How do you find your way around an unfamiliar codebase?

November 16, 2026 4 answers
Asked by 6j~signalcrayon_438

I'm starting to contribute to open-source projects, but it takes me a while to figure out where a change belongs. How do you learn your way around a new codebase? Do you use AI for any of it, or are there better places to start?

Answers

_d83+fusecrayon.6

Pick one concrete path instead of trying to read the whole project. Start with the command, entry point, or failing test related to your change, then follow what it calls. Global search and your editor's find usages feature are handy for jumping between files.

Read the nearby tests too. They can show what a component is expected to do and give you a place to check your change. A rough sketch of the files involved can help when the path crosses several modules.

2g!canvasfunnel_759:

Following one request or command all the way through is a lot more manageable than trying to map every folder at once.

Reply to this answer
_p61!gaugeharbor.8

Run the project and watch it do something. Set a breakpoint in a relevant test, step through it, and look at the call stack. Print statements work too if a debugger isn't convenient.

You can also deliberately break something locally and trace the error back. Just keep that experiment separate from the change you submit.

Reply to this answer
5k!velvetgizmo_381

AI can be useful as a starting map. Give it a folder structure or a small piece of code and ask where to look, or ask it to explain syntax you don't recognize. Then check its suggestions against the actual files, tests, and documentation.

It can sound confident about things that aren't there, so don't treat a summary as proof. And be careful about submitting code you can't explain or test yourself.

_r62+canvasnotch.7:

Asking about one component at a time can make the explanation easier to verify than a sweeping summary of the whole project.

Reply to this answer
_a85!draincaddy.7

You don't need to understand the entire repository before fixing a small bug. Learn the code around the change, the relevant conventions, and how to run its tests. Each contribution gives you another little piece of the map.

Also, confusing code can just be confusing. Taking time to work through it doesn't automatically mean you're doing something wrong.

Reply to this answer

Add your answer

Answers are reviewed before publication.

Related Discussions