system prompts

Cursor AI System Prompt

Documentation and analysis of Cursor's internal system prompt — the prompt that shapes Cursor's inline completions, chat behavior, and agent mode. Widely reverse-engineered by the community.
by Cursor (Anysphere) updated Nov 1, 2024 proprietary

## what it does

Overview

Cursor (by Anysphere) is a code editor built on VS Code that uses Claude and GPT-4o for code completions, chat, and agent mode. The community has reverse-engineered significant portions of its system prompt through responses that “leak” it under certain prompting conditions.

This entry documents the known structural patterns — useful for building your own coding assistant or understanding how Cursor constrains model behaviour.

Key behavioral Instructions

Code generation mode

Cursor instructs the model to:

  • Output code without explanation unless asked
  • Prefer minimal diffs over rewrites
  • Match the indentation, style, and conventions of the surrounding file
  • Never add comments unless they exist in the original

Chat mode

In chat (Cmd+L / Ctrl+L), the prompt shifts to:

  • Allow longer explanations
  • Reference specific file locations using the @file syntax
  • Prefer code blocks with language identifiers

Agent mode

In agent/composer mode, the system prompt enables:

  • Multi-step planning before execution
  • Tool calls for terminal, file creation, and search
  • Verification loops (“run the tests, fix any failures”)

Patterns worth borrowing

  1. Mode-specific behavior — switch instructions based on the context (inline completion vs chat vs agent). Cursor does this explicitly.
  2. Style mirroring — instruct your model to adapt to the user’s existing code rather than imposing its own style.
  3. Diff-first output — for code edits, a targeted diff is almost always better than a full file rewrite.

Community resources

## embed this badge

cache ✓ in cache.directory
![cached](https://cache.directory/badge/cursor-system-prompt.svg)