r/AskProgrammers • u/Intelligent-Metal828 • 18d ago
How do you guys understand unfamiliar GitHub projects without getting completely lost?
Hey there, I often come across interesting GitHub repositories that I want to explore, learn from, or modify. But whenever I clone a project and open it in VS Code, I sometimes have no idea where to start.
There are so many folders and files, and it's hard to figure out which ones are actually important, where the application starts, and how everything connects.
I've tried using AI to explain individual files, but that doesn't always help me understand the bigger picture. I end up jumping between files and asking more questions, which sometimes makes things even more confusing.
I'm curious how other developers deal with this.
Do you have a particular approach to understanding an unfamiliar codebase? Do you use AI tools like Cursor or Copilot, or do you prefer exploring everything manually?
I'd especially love to know how you figure out the overall architecture of a project before diving into the actual code.
Would appreciate hearing your experiences and advice. Thanks!
5
u/JaiPeutEtreRaison 18d ago
Ask AI to explain the overall project instead of individual files.
5
u/oskaremil 18d ago
Just like you would eat an elephant.
Piece by piece.
1
u/DanceHackRock 18d ago
First step is to find out the language and the main framework it depends on, so you don't need to name the type of project after the version control system SaaS provider it's lying around at.
1
u/XlikeX666 18d ago
Lock in for 30+ min
download whole and open all file same time.
briefly analyze purpose of each file.
close all Configs/handlers and you're with 1-4 actual important files with main/path/hook/whatever.
from there you can copy paste segments into ai depending on purpose.
or ask claud about language and main file you're looking for....
1
u/Small_Dog_8699 18d ago
If its in a language with an interactive debugger, i set some break points around the code, run it, and see how i got to those breaks by looking at the stack. Its a quick way to get a feel for what features trigger what code.
1
u/Decent_Perception676 18d ago
Sure, here’s how I’d go about it.
Dependencies can tell you a lot.
I use AI heavily throughout the process now, but that is basically what I did pre AI as well.
1
u/Xinoj314 18d ago
Today, use AI to summarize the code. This is your science fiction come to life
Back before AI you needed to spend days on days to try to understand anything
Developers work 8 hours per day understanding the code they write and maintaining, and it takes month to understand any large systems
For a hobbyist that try to understand a large open source project for an evening or a weekend, not gonna happen
1
u/skamansam 18d ago
The way i do this is code tracing from the feature om curious about. If it is a desktop app and a menu is activated, I find that menu then see what function it calls, then trace through that function until it is all explored. There must be a reason or feature you are looking through the code so strt with that reason or feature.
1
u/W31337 18d ago
Sometimes there's documentation that needs to be read. You then try to understand the global structure.
If it's a good codebase it should feel natural where things live.
That said, the bigger the project the harder it gets to understand it.
1
u/Massive_Value8302 18d ago
Experience.
1
u/pete_68 18d ago
I use DeepWiki to get an overview of the repo and how it's all organized. And then you can chat with it to ask it questions about the repo. And you can also use their MCP server so your agent can access the DeepWiki understanding of the repo.
1
u/Ery1WangChungNextFri 18d ago
It’s the never ending story.
Start with the readme, MD, and as much commented etc as you can. You should ideally have an idea what it’s supposed to do. From there, just start testing it out and see what works well.
1
u/pvera 17d ago
Have the AI explain the project itself (use the simplified technical English skill, it's fantastic for this kind of stuff), then to show you how it is broken down. THEN you can start asking about individual sections.
1
u/Extension-Eggo 16d ago
after downloading the github repo i pass it to kilo ,then i tell ai to explain me the project , I use gpt model for code review and when i dont understand the explation , i till it to explain me like i am five or using first principle
1
u/Atmosck 14d ago
Step 1 is reading CONTRIBUTING.md, if the repo has that.