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.
## 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
@filesyntax - 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
- Mode-specific behavior — switch instructions based on the context (inline completion vs chat vs agent). Cursor does this explicitly.
- Style mirroring — instruct your model to adapt to the user’s existing code rather than imposing its own style.
- Diff-first output — for code edits, a targeted diff is almost always better than a full file rewrite.
Community resources
- nicholmikey/cursor-tools — community-documented prompt analysis
- Cursor changelog — Cursor announces behavior changes here; significant ones reflect prompt changes
## embed this badge
cache ✓ in cache.directory
