Skip to lesson
Exit
Cursor Developer-Surface Mastery1 / 2

2 min lesson

The three invocation patterns and the runtime-agnostic interface

Compare two rows from "The three invocation patterns and the runtime-agnostic interface", then say when each one fits.

Step 1 of 2

The three invocation patterns and the runtime-agnostic interfacethe part candidates skip

The SDK is a single, runtime-agnostic interface: one set of code targets local, Cursor Cloud and self-hosted-cloud runtimes - you pass the runtime you want and the rest is identical. There are three core concepts (the agent object, the prompt interface and message/stream handling) and three invocation patterns worth naming explicitly because they map to different jobs.

Pattern
agent.prompt
Shape
Fire-and-forget one-shot
Use it when
A single discrete task: summarize a diff, run a check, draft a changelog entry.
Pattern
Durable agent
Shape
Back-and-forth conversation
Use it when
Multi-turn work where you keep talking to the same agent across steps.
Pattern
agent.resume
Shape
Pick up an existing agent
Use it when
Preserve context across surfaces - resume a run started elsewhere instead of rebuilding state.

Same harness behind all three; the choice is one-shot vs. conversation vs. resuming an existing run.

It has full model neutrality (specify any model per agent), supports subagents (passed into agent.create) for context and token reuse, and lets you inject MCPModel Context Protocol. A standard that lets an AI agent pull in context from outside the repo, like Jira tickets or internal docs. Press Enter for the full definition. servers, skills and hooks at runtime. TypeScript and Python are both documented today; the fastest start is the built-in /sdk skill, which scaffolds working code, plus the SDK cookbook repo. A REST API exists as an alternative.

The SDK is a superset of a skill

The clean teaching line: a skill or slash command only works inside a Cursor surface; the SDK brings the same agent anywhere - any TypeScript service, CI pipeline or backend - so it is a superset of a skill. A vivid proof point: Cursor's field team built a security-questionnaire app on the SDK - upload a questionnaire doc and it spawns a cloud agent that does a first pass against the trust-center docs, privacy policies and security documentation. SDK use cases span finance, legal, support and design, not just coding.