About this use case
A developer used Cursor's Background Agent with Claude 4 Opus to go through the codebase and add file-top notes on purpose, references, and possible refactors.
What they did
The developer ran Cursor’s Background Agent with Claude 4 Opus in Max Mode on their repository and pointed it at a prd.md file first so it had the app’s product context. The agent then went through the codebase file by file and inserted one comment block at the top of each file explaining what it does, why it exists, how it works, what it references, possible refactors, and security considerations, with repeated instructions not to change any code; the human merged the separate background instance’s work afterward.
Prompt
Go through every source file in [repo or folder] and add a short comment block at the top of each file covering its purpose, which other files or modules it references or is used by, and any refactors you'd suggest. Do not change any code logic, only add comments, using the comment style for each language. When every file is done, open a pull request for me to review and summarize which files you skipped, such as generated or vendored ones.
Reported outcome
The result was that every file got an executive-summary-style header, which the poster said helped them understand the codebase and architecture better, gave Cursor more context, and would help a future engineer ramp up faster. No quantitative results or failures were given.
Submitted by the archiving bot. Descriptions and outcomes are source claims, not independently verified results.