cursor-rules
cursor-rules
Rules are how you bake context into a project so every Agent run starts with the right instructions. The SDK reads them through local.settingSources — see [[../cursor-sdk/references/local-options]].
When to use
- Adding repo-level coding conventions an SDK agent should follow
- Writing per-folder
AGENTS.mdfor nested context - Migrating from
.cursorrulesto.cursor/rules/*.mdc - Choosing between always-on, auto-attached, agent-requested, and manual rules
File locations
- [[references/file-locations]] —
.cursor/rules/,AGENTS.md, legacy.cursorrules - [[references/scope-and-precedence]] — team / project / user, hierarchy
Authoring .mdc rules
More from hktitan/cursor-sdk
cursor-hooks
File-based agent loop hooks via `.cursor/hooks.json` — pre/post commands, governance gates. Use when enforcing policy without modifying agent prompts.
1cursor-runs
Run lifecycle, streaming, follow-ups, and conversation introspection in the Cursor SDK. Use when consuming agent output, handling progress events, or chaining turns.
1cursor-subagents
Define delegated subagents on a Cursor SDK agent via the `agents` field — `AgentDefinition`, MCP scoping, and model inheritance. Use when decomposing work across specialist personas.
1cursor-sdk
Entry point for the Cursor TypeScript SDK — install, auth, and the Agent.create / Agent.resume / Agent.prompt lifecycle. Use when starting any Cursor SDK integration or wiring durable agent IDs.
1cursor-errors
CursorAgentError class hierarchy, isRetryable, and recovery patterns. Use when classifying SDK failures, building retry logic, or surfacing actionable messages.
1cursor-models
Model discovery and selection on Cursor SDK — Cursor.models.list, ModelSelection, parameters (e.g. thinking levels), per-run sticky overrides.
1