How do I set up a custom prompt in Cursor?

Updated October 2026 · How we answer

Short answerYou can set up a custom prompt in Cursor by using the 'Rules for AI' feature in Settings. Go to Settings > AI > Rules for AI and enter your instructions there.

Using Rules for AI

Cursor allows you to define custom instructions that the AI will follow when generating code or answering questions. This is done via the 'Rules for AI' setting.

Open Settings (Ctrl+, or Cmd+,), navigate to the 'AI' tab, and find the 'Rules for AI' section. Here you can type a prompt that describes your preferences, coding style, or specific requirements.

For example, you might write: 'Always use TypeScript, prefer functional components, and include JSDoc comments.' The AI will then try to adhere to these rules in its responses.

Project-Specific Prompts

You can also set project-specific rules by creating a `.cursorrules` file in your project root. This file contains plain text instructions that apply only to that project.

This is useful for teams or when working on multiple projects with different conventions. The AI will read the file and adjust its behavior accordingly.

The `.cursorrules` file can include anything from coding standards to architectural guidelines. It's a simple text file, so you can edit it with any text editor.

Using Custom Prompts in Chat

In the Chat interface, you can also provide custom prompts on the fly. Just type your instructions in the chat box before your question or request.

For example, you could write: 'Explain this code as if I'm a beginner' or 'Refactor this function to be more efficient.' The AI will respond based on that prompt.

You can combine both the global rules and ad-hoc prompts for more control. The AI will consider both when generating a response.

Common mistakes

  • Thinking custom prompts are only for chat; they also affect code generation and other AI features.
  • Forgetting that `.cursorrules` is project-specific and won't apply globally.
  • Writing overly complex or contradictory rules that confuse the AI instead of helping it.
From our shopsCaseMorph: Type an idea, see a custom phone case in seconds, then print a one-of-one.