Skip to content

Cursor Chat Overview

Cursor Chat allows you to ask questions or solve problems in your codebase using the most powerful language models directly in the editor.

For language models to provide good answers, they need to know specific things about your codebase—context.

Cursor has multiple built-in features to provide context in chats, such as automatically including context from the entire codebase, searching the web, indexing documentation, and user-specified code block references. These are designed to eliminate the tedious copy-pasting usually needed when working with language models on code.

By default, Cursor Chat is located in the AI panel, which is opposite your main sidebar. You can toggle the AI panel by pressing Ctrl/⌘ + L, which will focus on the chat when opened. To submit your query, press the Enter key.

Chat

User and AI Messages

User messages contain the text you input and the context you reference. You can return to any previous user message to edit and rerun your query. This will override all messages after that one and generate new ones.

AI messages are responses generated by your chosen AI model. They are paired with the user messages that precede them. AI messages may contain parsed code blocks that can be added to your codebase through instant application.

All user/AI messages in the same thread are collectively called a chat thread, and each chat thread is saved in your chat history.

Chat History

By clicking the "Previous Chats" button in the top right of the AI panel, or by pressing Ctrl/⌘ + Alt/Option + L, you can see your chat history. You can click any chat thread to return and view the messages that make up that thread. You can also modify a thread's title by clicking the pencil icon, or delete a thread by clicking the trash can icon that appears when hovering over a thread in history.

Cursor thread titles are simply the first few words of the first user message.

Default Context

By default, Cursor Chat includes the current file as context. You can submit a query without any context by pressing Alt/Option Enter when submitting, or by enabling Default No Context under Cursor Settings > Features > Chat. Chats started with no context won't add context for any messages.

You can see what will be included as context in the pills below the input box as you type.

Adding Context

By default, user messages will include your input text and the context you reference. You can add more custom context to each bubble through the @ symbol, and by default, the currently viewed file is also included as context in user messages.

See the @ symbols page for more information.

AI Fixes in Chat

A convenient feature is using AI fixes in chat to fix linter errors in your codebase. To do this, hover over an error in the editor and click the blue AI fix button that appears.

The keyboard shortcut for this is Ctrl/⌘ + Shift + E.

AI Fix

Long Context Chat (Beta)

You can enable long context chat by going to Cursor Settings > Beta > Long Context Chat. Once enabled, you can switch between different chat modes using Ctrl/⌘ ..

Long context chat allows you to use entire folders as context since the supported models have larger context windows. See more about long context models only here.

Released under the MIT License