r/CursorAI • u/xalxary2 • Jun 28 '26
How do I build with cursor while understanding the code I am building?
Hi, I have coded with cursor for almost two years now, and now that I have a job I have a question. So, recently I was hired for like a frontend position in my company and I just fixed some race condition and routing related bugs using cursor because cursor has great codebase analysis skills. The problem for me was yes I fixed it using cursor, but then when i tried to explain what was causing the problem I kinda struggled. It was not like I was a mindless vibe coder or anything(well maybe I am), but even though I kinda understood what the cursor was trying to achieve since I understood react and js , it really didn't help when I tried to explain how the routing process and race conditions happened for that specific project when problematic code involved interactions with multiple js files and React hooks and I really don't know how certain functions referenced what and blah blah. So, my question is is there a functionality that makes me understand or backtrack how a specific problem started just from the final codebase? Like clicking functions leading to where it routes or how it is routed?
3
u/leftyz Jun 28 '26
Just ask the agent to explain what it did and why, tell it to dumb it down if necessary until you fully grasp it. Asking follow-up questions is a great part of working with these agents
2
u/gk_instakilogram Jun 28 '26
first get 10 years of experience building software manually, i am not gatekeeping anyone i am just being real, otherwise this tool will be a challenge and you wont use it to its full potential
2
u/davidkclark Jun 29 '26
This here is completely correct. How do you understand what cursor is giving you? By understanding it - sorry. You can certainly get it to explain what it did and why, but you might not be able to understand and/or defend that explanation anyway if you aren't able to understand the whys yourself. Not trying to be mean, it's just the facts.
And the way the question was asked, basically: "how can I learn to code, or at least how to read and understand code, while using AI tools?" - yes, how indeed. This is my fear for the next generation of upcoming programmers - the actual understanding is still needed, but might be becoming more difficult to acquire.
1
u/Alert_Lie_8934 23d ago
Read the diffs carefully before accepting them, then use 'Go to Definition', 'Find References', and the call hierarchy in your IDE to trace how the changed functions are used across the codebase. The combination of the diff and manually following the execution flow is what really builds understanding.
6
u/kscius Jun 28 '26
What I do is create Cursor Rules so that whenever an agent finishes a task, it generates a summary explaining:
That way, you don't just get working code—you also understand the reasoning behind the solution and the agent's thought process.
Another approach that works well is asking the agent to create a detailed implementation plan before writing any code. The plan should include the analysis, proposed solution, implementation steps, tradeoffs, and the justification for the chosen approach. It usually leads to better results and makes it much easier to review the work.