Docs › Context

Rules

Persistent instructions the agent reads before it starts: per project, per file type, or on demand.

A rule is a file of instructions the agent reads before it does anything. Use them for conventions that should hold every time: how this project names things, which patterns it avoids, what a commit message looks like here.

Where they go

When a rule applies

Frontmatter decides. These keys are Cursor's, kept exactly, because people arrive with these files already written and they should keep working:

FrontmatterWhen the rule is used
alwaysApply: trueIn every conversation.
globs: "src/**/*.ts"When a matching file is in play.
description onlyOffered by its description; the agent decides whether to read it.
none of theseManual, attached when you type @name.

What a rule cannot do

A rule is text from a file. It can shape how code gets written; it cannot grant permissions or change the task. A rule saying to skip approval does not skip approval.

Rules are never read in a folder you have not trusted.

Rules, memories and skills

A rule always applies and is written by you. A memory is one fact the agent asked to keep. A skill is a procedure loaded only when the work calls for it.

All documentation

Get started

Agent

Context

Workspaces

Connectors

Extending AstraCode

CLI

Reference