Advanced Usage Guide for Cursor

Explore the advanced features of Cursor, a VSCode-based tool that enhances coding efficiency and context management.

Settings

Cursor is developed as a branch of VSCode, allowing seamless integration. You can import your VSCode settings directly.

After importing, all your plugins, theme configurations, etc., will remain consistent with VSCode without needing to reinstall them manually. The import is incremental, meaning that any plugins or settings already in Cursor but not in VSCode will not be removed.

Why Use VSCode Import?

VSCode has an automatic synchronization feature (including settings, plugins, themes), but Cursor does not provide synchronization. To avoid repetitive settings when installing Cursor on a new device, download VSCode, log in, sync your data, and then import it into Cursor for a seamless transition.

Toolbar Position

In VSCode, the default toolbar is on the left side, while Cursor has a smaller horizontal toolbar at the top. If you prefer a vertical arrangement, open settings, search for “orientation,” and change it to vertical.

Codebase Indexing

Codebase Indexing is a vital tool in Cursor for understanding project structure. Cursor traverses each file, recording its relative position, effectively creating a project file map. This indexing allows for more accurate results when using the file search tool during programming.

Pro users can support up to 50,000 files, while enterprise users can support 250,000 files.

Docs

Docs allows you to add special documents to the context. This is useful when Cursor cannot supplement context information through model calls, online queries, or rules, leading to bugs or misunderstandings. You can add user-defined documents to Docs, typically technical documents, personal blogs, or declarative documents that are not easily found via search engines.

Docs only accepts URL links, so the documents added should be from online sites that AI can crawl.

Context

The efficiency of AI in completing tasks relies heavily on the completeness and clarity of the context definition.

Definition

What is context? Context is the AI’s memory, encompassing all its knowledge about the current project, serving as the basis for logical reasoning.

Context is divided into two categories: instructions (user prompts) and states (various information contained in the current project).

Length

The length of context is limited, measured in tokens. You can use the tool tiktokenizer.vercel.app to calculate the token length of your input text.

The built-in model in Cursor has a different context length than those provided on model websites due to internal system prompts and optimizations that occupy some space.

Construction

Before each conversation, you should construct a detailed and clear context for the AI, which is the most effective way to reduce AI hallucinations.

In Cursor, context includes many types. Here are some core methods to add context:

  • File & Folders: The easiest way is to drag and drop files or folders into the conversation. This can include text, CSV, MD, and various source code files (character-based text files). Word, PDF, and PPT files are not supported.
  • Code: Select a piece of code and click “Add to chat.”
  • Git: When performing a code review, you can add a specific commit to the context.
  • Past Chats: If you have new ideas based on previous conversations, you can reference relevant historical chats without re-explaining the context.
  • Web: Used for manually specifying documents from websites that AI can crawl.
  • Image: Screenshots can be pasted directly into the chat to add them.
  • Terminals: Similar to code, select output information in the terminal and click “Add to chat.”

Prompt

Prompts are also part of the context and directly influence model output. Each built-in model in Cursor has internal system prompts. This repository collects various internal system prompts from AI tools: github.com/elder-plini.

Writing Principles

To write clear and understandable prompts, follow these key points:

  1. Use Markdown format, employing ordered and unordered lists, proper line breaks, and spacing.
  2. Focus on one task at a time, with the entire prompt centered around that task.
  3. Provide positive examples, as AI excels at analogy reasoning.
  4. Be as detailed and purpose-driven as possible, avoiding vague instructions and actively adding context.

Writing Tips

You can explicitly include context as part of descriptive statements.

When using multiple images, you can use numbers to indicate them.

Press Shift + Enter to create a new line.

Model Switching

First, identify which models you need for your daily tasks. Here are some categories:

  1. Simple tasks requiring quick responses: claude-4-sonnet.
  2. Tasks requiring more context while ensuring quality: claude-4-sonnet-thinking, genimi-2.5-pro.
  3. Complex tasks with extensive context and no initial ideas for AI: o3.

To avoid the hassle of switching models for each conversation, keep it set to claude-4-sonnet by default.

Enabling Models

If you notice some models are missing from the list after clicking “add model,” you may not have enabled the switch in settings. Generally, only enable the most commonly used models and avoid older ones, adhering to the principle of “favoring the new over the old.”

Auto & Max

Do not enable the Auto option, as you cannot determine which model Cursor is using behind the scenes; it could be an outdated or free model. Always specify the model manually to ensure you get your money’s worth from your subscription.

The MAX mode should also generally be avoided, as it incurs additional charges and significantly increases the context length for models, suitable only for very complex tasks, consuming tokens at about five times the normal rate.

Three Modes

Ask

This mode should be your most frequently used setting. Set it as the default mode.

Ask is primarily used for multi-turn conversations with AI to reach conclusions or agreements. It has the following features:

  • Access to context.
  • Ability to call tools, perform web searches, and read files.
  • Can invoke MCP.
  • Does not modify or create any code files.
  • Does not execute terminal commands proactively.

Before using AI for a task, you should have about 10 rounds of conversation, with 7 rounds in Ask mode discussing and refining details, followed by 3 rounds using the Agent model to finalize code construction.

Agent

This mode is used for producing results, allowing you to add, delete, modify, and query files in your project, write various codes, and generate detailed Markdown documents. It is the builder mode.

Manual

This mode is rarely used and may be removed in future versions of Cursor.

Parallel Conversations

Creating Parallel Conversations

Scenario: You are currently in a conversation but need to query another question.

Tip: You can create a new chat, but this will exit the current conversation window, making previous chats invisible. The best approach is to create a parallel conversation, which is independent of the current chat context and does not affect other conversations, essentially adding a separate sub-conversation window within the current chat.

Trigger: First, click to focus on the chat (otherwise, it will trigger VSCode shortcuts), then press Command + T to create.

Creating Task Branches

Scenario: You are in conversation 1 but suddenly have an idea and want to try another approach based on conversation 1.

Tip: Copy conversation 1 (including all context) to create a completely independent new conversation identical to conversation 1.

Other Features

Terminal Smart Suggestions

If you forget how to execute a command in the terminal, press Command + K, describe the operation you need to perform, and AI will generate the corresponding command.

Chart Drawing

However, rendering errors often occur due to Cursor’s built-in Mermaid renderer being outdated (version 8.x), while AI often uses syntax from version 10.x for drawing commands.

Was this helpful?

Likes and saves are stored in your browser on this device only (local storage) and are not uploaded to our servers.

Comments

Discussion is powered by Giscus (GitHub Discussions). Add repo, repoID, category, and categoryID under [params.comments.giscus] in hugo.toml using the values from the Giscus setup tool.