Composer

Overview

Composer Developer Guide

Welcome to Composer

Composer is an AI programming assistant integrated into the editor. It helps you explore code, write new features, and modify existing code without leaving your workflow. Open it with ⌘I, create new Composers with ⌘N.

https://mintlify.s3.us-west-1.amazonaws.com/cursor/images/composer/empty-composer.png

Agent

Use ⌘. to enable Agent and get a programming partner that actively handles your codebase:

  • Automatically fetch relevant context (try @Recommended)
  • Run terminal commands
  • Create and modify files
  • Semantic code search
  • Execute file operations

Agent can call tools up to 25 times before stopping. If you need more, let us know at [email protected]!

Currently, Agent only supports Claude models.

Each tool operation counts against your quota as a separate request.

Normal Mode

Normal mode provides core functionality for code exploration and generation:

  • Search your codebase and documentation
  • Use web search
  • Create and write files
  • Access extended @ symbol commands

Using Context

Type @ to see context options based on your current work. Navigate with arrow keys, press Enter to select, type after @ to filter. Use Ctrl/⌘ M to toggle file reading method. @Recommended in Agent automatically fetches relevant context.

https://mintlify.s3.us-west-1.amazonaws.com/cursor/images/context/@-symbols-basics.png

# File Selection

Use # followed by a filename to focus on specific files. Combine it with @ symbols for precise control over context.

Context Tags

Tags at the top of the chat show active context. Add or remove tags to adjust what Composer can see. Files selected with # appear as tags.

Generating and Applying Changes

When Composer suggests changes:

  • View changes in the diff view
  • Accept or reject changes using provided buttons
  • Use checkpoints for undoing when needed

Checkpoints

Composer creates a checkpoint every time code is generated. You can return to any previous version by clicking checkout next to the checkpoint. This is useful when you don't like current changes and want to revert to an earlier state.

https://mintlify.s3.us-west-1.amazonaws.com/cursor/images/composer/checkpoints.png

History

Access previous Composer sessions and chats through history. Open it from the history icon to the right of the Cursor Tab. You'll see a list of past composers and chats that you can revisit, rename, or delete.

Open it with ⌘+⌥+L or Ctrl+Alt+L when Composer is focused.

https://mintlify.s3.us-west-1.amazonaws.com/cursor/images/composer/history.png

Layout

Composer offers two layout modes:

  • Panel: A sidebar for chat on the left with code editor on the right.
  • Editor: A single editor window, similar to viewing code normally. You can move it, split it, and even put it in a separate window.

Beta Features

Iterating on Lint Issues

Composer attempts to fix linting issues in generated code for most programming languages. When enabled, if Composer detects lint errors, it will try to automatically fix them. Currently only supports one iteration.

https://mintlify.s3.us-west-1.amazonaws.com/cursor/images/composer/iterate-on-lint.png

Some languages (like Rust) require saving files before lint errors appear, which may limit this feature's effectiveness across all languages.

Common Questions

What's the difference between Chat and Composer?

Cursor Chat helps you search and understand code. Use it to explore your codebase, ask questions, and get explanations. You can search code with ⌘⏎.

Composer helps you write and edit code. It provides a workspace where you can generate new code and apply changes directly to files.