Inside Cursor: how can an AI coding assistant remember project conventions, find code, and review changes?

July 30, 2025

On July 28, I was browsing PocketFlow's source on GitHub and opened a file called .cursorrules at the repository root. Why would a Python project ship instructions for an editor? The following afternoon I looked at its code generation example and read a line by its author, Zachary Huang: “You design the high-level flow, AI implements the details”. He suggested a specific way to work: discuss the design in Cursor's Chat mode, then switch to Agent mode, which can read and write project files, to implement it. The rules file in the project template tells the assistant how to use the framework.1

I've long wanted to build my own AI coding assistant and automate more of my everyday development work. On July 30 I searched for cursor rule, then read about Memories and Codebase Indexing. That afternoon I found Bugbot. One example can tie these features together. Suppose I ask an assistant to add a Retry button. How does it know the project's conventions? How does it find the code that actually sends the request? Once I submit the change, who can help me notice that clicking twice sends two requests?

How can an assistant remember project conventions? Start with who wrote them down

Suppose the project has a convention: “All requests go through one client, including retries.” If I write that into the project rules, anyone who opens the same code can see and edit the convention. PocketFlow demonstrates keeping instructions in a single .cursorrules file. By January 2025, Cursor also supported multiple repository rules in the .cursor/rules directory and let the assistant select the applicable ones.12

To build a simple version, start with an agreed filename. When a task arrives, the program reads the file and passes the rules to the model along with “add a Retry button.” The material the model can actually read on this invocation is called its context. Even in a brand-new conversation, reading those rules again brings back “retries go through the same client.”

Now suppose I happen to say in a conversation, “In this project I like to test the Retry button by disconnecting the network.” If I want the assistant to remember it next week without turning it into a team testing standard, that's closer to Cursor's Memories. The Cursor 1.0 release notes say memories come from conversations, are stored per user and project, and can be managed in settings. Version 1.2, released July 3, added user approval for memories generated in the background.34

In my own implementation I'd show the statement the assistant extracted, ask the user to confirm it, and then save it with the user and project identifiers. Next time we discussed retries in the same project, I'd retrieve it and include it in context. If the assistant mistook “let's disconnect the network for this test today” for a lasting preference, I'd have a chance to correct it before saving.

Once it knows to use the same client, how does it find the file?

A rule tells the assistant how to make a change. Suppose the user asks, “Let me try again when a request fails,” while the function that sends requests is called sendRequest. Searching for “try again” might return nothing. Conversely, if I know the function name, searching for it and checking who calls it is an inexpensive first step.

Cursor also offered codebase indexing at the time. An index is a lookup structure prepared in advance to help select code worth reading when a question arrives. The Cursor 1.2 release notes mentioned a new embedding model for semantic codebase search. Here an embedding turns text or code into a set of numbers. This gives related content a chance of being found together even when the wording differs.4

For a Retry button prototype, I'd split the code into small chunks by function and save each chunk's numerical representation, file path, and location. When a question arrives, I'd use the same model to represent the question numerically and find the nearest chunks. This might retrieve both the UI that displays the error and the client that sends the request. The assistant would then open the current files and trace the button's click handler through to the client before deciding where to connect the retry. That's one possible implementation. Cursor's release notes establish that it used an embedding model, but there are several ways to chunk and select code.4

The next page I visited was MCP, followed by Ignore files. For a prototype, they raise two more concrete questions. Should generated build files be searchable? If the code says only “follow the ticket for retry behavior,” can the assistant read that ticket? For the first, filter directories during indexing. For the second, integrate MCP (Model Context Protocol) and have the issue tracker expose a query tool the assistant can call. The application decides both the search scope and the available tools.3

Once the code changes, how does Bugbot get its review back to the developer?

Suppose the Retry button works, I've pushed the change to GitHub, and I've opened a pull request (PR) for someone to check and merge. Now there's a different question. On a slow network, if someone clicks twice before the first request returns, will it send a second request? If every review depends on me remembering to copy the change into a chat and say “take a look,” that step is easy to miss.

On the afternoon of July 30 I clicked through from Cursor's pricing page to Bugbot, then returned the next morning. Cursor 1.0 described the workflow concretely. Bugbot automatically reviews PRs and leaves a GitHub comment when it spots a potential issue. A developer can click “Fix in Cursor” to return to the editor with a prompt for that issue already filled in. That saves the work of explaining a review comment to the coding assistant all over again.3

If I added this capability to my own assistant, I'd start with one small, testable task. When a repository change needs review, the program retrieves the lines added and removed: the diff. Suppose the only change is the button's click handler. The assistant still needs to read the client it calls to check whether that client already prevents duplicate requests. If neither layer handles it, the comment can be concrete: “While the first request is pending, the button can trigger again. Try clicking twice on a slow network to verify.” The maintainer knows which line to look at and how to test the claim.

There may have been a more immediate reason I looked at Bugbot. I'd considered hooking Claude up to my own repository to help with reviews. In May 2025 Anthropic opened its Claude Code on GitHub beta, letting developers mention Claude in a PR and ask it to address feedback or change code.5 For my workflow, there's a small design decision worth making first: should I call it in when I'm unsure, or should it do an initial review whenever someone submits a change? Calling it myself lets me choose the questions; automatic review also takes care of remembering to ask someone to look.

References

Footnotes

  1. Huang, Z. (2025, March 22). Agentic Coding: Let Agents Build Agents for you! Pocket Flow, Substack. Third bullet under “Introducing Pocket Flow: Simple by Design”; see “Cursor AI” for the template and mode switch. ↩ ↩2

  2. Cursor. (2025, January 23). .cursor/rules, Better Codebase Understanding, New Tab Model. Cursor Changelog. First 0.45.x update. ↩

  3. Cursor. (2025, June 4). Bugbot, Background Agent access to everyone, and one-click MCP install. Cursor Changelog. “Automatic code review with Bugbot,” paragraph 2, and the Memories and MCP sections. ↩ ↩2 ↩3

  4. Cursor. (2025, July 3). Agent Planning, Better Context & Faster Tab. Cursor Changelog. “Memories (now GA)” covers approval; “Improved embeddings for semantic search” covers codebase search. ↩ ↩2 ↩3

  5. Anthropic. (2025, May 22). Introducing Claude 4. Anthropic. “Claude Code,” paragraph introducing the GitHub beta. ↩

© 2025 borui. All rights reserved. This content may be freely reproduced, displayed, modified, or distributed with proper attribution to borui and a link to the article: borui (2025-07-30). Inside Cursor: how can an AI coding assistant remember project conventions, find code, and review changes?. https://caiborui.com/blog/2025-07-30-zh-cursor-rules-memories-codebase-indexing-bugbot-entrans

@misc{borui2025-465ab311,
  author = {borui},
  title = {{Inside Cursor: how can an AI coding assistant remember project conventions, find code, and review changes?}},
  year = {2025},
  publisher = {borui's blog},
  url = {https://caiborui.com/blog/2025-07-30-zh-cursor-rules-memories-codebase-indexing-bugbot-entrans}
}