A deep-dive into how Cursor constructs the system prompt for its AI coding agent — using a real, live system prompt as the working example. Written for developers who want to understand the machinery so they can use it better.
When you open a chat in Cursor and type a message, you're not just talking to a raw language model. Cursor assembles a carefully structured system prompt before your message ever reaches the model. That prompt is the difference between a generic chatbot and a context-aware coding agent that knows your repo, your rules, your tools, and your current editor state.