Dylan AndersenDylan Andersen's Docs
Cursor + SalesforceGetting Started with Cursor

Cursor Fundamentals

Chat, Agent, Inline Edit, Tab, context, and models. The baseline that makes everything else click.

Cursor Fundamentals

Before MCPs, rules, and skills, there's the editor. This page is the part most guides skip, and the part you'll wish you'd read first. Give it fifteen minutes and your output in the next week goes up by a lot.

The surfaces, and when to use each

Cursor puts AI in four places. You'll use all of them in a normal hour of work.

Tab (inline autocomplete)

When you're typing in a file and a gray ghost suggestion appears, that's Tab. Press Tab to accept the whole thing, or Cmd+→ on macOS (Ctrl+→ on Windows) to accept word by word.

Tab is underrated for Salesforce work because so much of Apex and LWC is ritualistic. Imports, constructor boilerplate, @AuraEnabled wiring, and SLDS classes all fall out of Tab with very little effort. The trick is to keep typing. Tab gets smarter the more signal it sees.

Inline Edit (Cmd+K on macOS, Ctrl+K on Windows)

Select some code and press Cmd+K. A small box pops up where you can describe a change in plain English. The model rewrites the selection in place.

Use it for: renaming a variable everywhere it's used, converting a for loop to a map, adding null checks, bumping an API version in a .js-meta.xml, or cleaning up a SOQL string you just pasted. Inline Edit is the fastest way to "fix this one thing" without a chat round trip.

Chat (Cmd+L on macOS, Ctrl+L on Windows)

The side panel. This is where you think out loud with the agent, ask questions about the codebase, and give longer instructions. Chat has modes:

  • Ask mode is read-only. The agent can look at your files and answer, but cannot edit. Use it when you're orienting yourself in an unfamiliar repo.
  • Plan mode is also read-only, but the agent's job is to propose a plan before touching anything. Use it for big changes where you want to review the plan first.
  • Agent mode lets the agent read and write files, run commands, and use MCP tools. Use it when you've decided what to do and want the agent to do it.

You can switch modes from the dropdown at the top of the chat panel. Switch early and often. Asking a Plan-mode agent to "just go ahead and run the deploy" is a recipe for frustration.

Background Agents

A long-running agent that works in a sandboxed environment while you keep typing. Good for "deploy this full project and run all Apex tests while I start on the next component." Start one from the Chat panel's background agent button.

The rule of thumb

If it's one line, use Tab. If it's one selection, use Inline Edit. If it's one thought, use Chat. If it's one hour of work, use a Background Agent.

Context: the @ menu

The single biggest jump in your Cursor output comes from mastering @. Inside any chat or inline prompt, type @ and a menu opens. These are the context sources you can pull in.

SourceWhat it doesSE example
@FilesAttach one or more files@AccountService.cls write a test class that hits 90%
@FoldersAttach an entire folder@force-app/main/default/lwc refactor all cards to SLDS 2
@CodeAttach a named symbol (class, function, method)@handleClick why is this firing twice?
@DocsSearch indexed documentation@Salesforce Developers how do I paginate SOQL with offset?
@WebLive web search@Web Agentforce Spring 26 release notes
@GitDiffs, commits, branches@Git main...demo what changed for the ACME POC?
@Recent ChangesYour in-session editsreview my @Recent Changes for PICKLES violations
@Linter ErrorsThe current file's lintsfix @Linter Errors without changing behavior
@DefinitionsPull in definitions for symbols in scopeuseful when the agent is missing a type or class signature

If you remember one thing from this page, remember this: when an agent gets something wrong, the fix is almost always more or better context, not a different prompt.

Models, quickly

Cursor exposes a model picker in the bottom of the chat panel. You don't need to memorize all of them, but here's how an SE should think about the choice:

  • Auto is the safe default. Cursor picks a frontier model based on what you're doing.
  • Claude Sonnet or Opus is strong at long-context refactors, careful Apex, and agent-style multi-step work. Good default for anything non-trivial.
  • GPT-5 / GPT-5 Pro is strong at planning, analysis, and reasoning-heavy tasks. Good when you want a second opinion or a structured plan.
  • Gemini is strong at very large context windows. Good when you need to pull in a big chunk of a customer's metadata.
  • Fast / lightweight models are fine for Tab and quick edits.

A rough SE-shaped cheat sheet:

  • Writing or reviewing an Apex class: Claude Sonnet or Opus.
  • Asking "what does this 4,000-line trigger do?": Gemini or Claude with large context.
  • "Plan out a three-day Agentforce POC for me": GPT-5 Pro in Plan mode.
  • "Type out the SLDS imports": whatever Auto gave you.

Models shift every few months. Trust the picker in the IDE more than any list on the internet.

Checkpoints and restore

The agent sometimes makes a mess. Cursor's checkpoint system lets you roll a session back to a prior state without touching Git.

Every time the agent edits files, Cursor creates a checkpoint. Click the Restore button next to any message in chat and you're back to that moment. This is a safety net, not a replacement for commits. Commit before you let a long-running agent loose, and you'll never lose work.

Auto-run (and why to scope it)

"Auto-run" is the toggle that lets the agent execute commands without asking you every time. Enormously useful when the agent is running sf project deploy start in a loop against a scratch org. Enormously dangerous when that same agent has access to your customer's production alias.

Scope it. In Cursor's settings, you can choose which commands auto-run and which always require confirmation. A sensible SE default is:

  • Auto-run sf org list, sf project retrieve, sf apex run test, and other read-only calls.
  • Require confirmation for sf project deploy start, sf project delete, anything against a production alias, and any git push.

See Security & Data Handling for the full list of things worth gating.

Memories

Cursor can remember things across sessions. Memories are short, durable notes the agent keeps about you or the current project. You can ask the agent to remember something ("remember that my default org is acme-uat"), or manage them directly in Cursor's settings.

Memories work best for project conventions, preferences, and gotchas you keep reminding the agent about. If you find yourself saying the same thing three times in a row, promote it to a memory, a rule, or a skill.

Bugbot and Review

If you're on a team, Cursor's Bugbot reviews PRs and leaves comments inline. It's worth enabling in GitHub for any repo where more than one SE is committing, even if the repo is just a collection of POCs. It catches the small stuff before a customer sees it.

The layered mental model

Everything in this guide sits on a ladder. Each rung is more persistent than the one before it:

  1. Tab is one keystroke of help.
  2. Chat is one conversation.
  3. Inline Edit is one selection, one instruction.
  4. Agent is one task, many files.
  5. Rules are always-on nudges in every chat in this project.
  6. Skills are deep playbooks with scoring rubrics and reference material.
  7. MCPs are live tools the agent can call (Salesforce, GitHub, Filesystem, and so on).
  8. Subagents and Background Agents run in parallel.

If you can place every feature on this ladder, you can answer the question "where should this piece of knowledge live?" every time.

Where to go next

On this page