In Devin Desktop (formerly Windsurf), how does a workspace rule's trigger value decide when the agent sees it, and what size limits apply?
answer
- four values in the frontmatter
- context cost differs per value
- a description for model choice
- an @-mention for the manual one
- 12,000 per file, 6,000 global
basics
~20 sThe trigger field picks the mode: always_on is in every message, model_decision shows only its description, glob fires on matching files, manual waits for @rule-name. Workspace rule files cap at 12,000 characters, global_rules.md at 6,000.
solid answer
~60 sEach file in `.devin/rules/` (or the fallback `.windsurf/rules/`) declares `trigger:` in its frontmatter, and the value decides both when the agent sees the rule and what it costs in context. `always_on` puts the full text in the system prompt on every message. `model_decision` puts only the `description` there, and the agent reads the whole file when it judges that description relevant. `glob` applies the rule when the agent reads or edits a file matching `globs`, such as `src/**/*.ts`. `manual` keeps it out of the prompt until someone types `@rule-name`. Workspace rule files are limited to 12,000 characters each and `global_rules.md` to 6,000; the global file and a root `AGENTS.md` take no frontmatter and are always on, while a subdirectory `AGENTS.md` behaves as a glob rule for its folder. These values and limits come from the rules page Devin Desktop wrote for its Cascade agent, which the v3.9.19 changelog (September 8, 2026) says has been removed; the Devin Local agent reads the same `trigger` frontmatter from `.devin/rules/`, and Devin CLI's rules page lists `always_on`, `manual`, `model_decision`, `agent` and `glob`.
code
markdown · 8 lines---
trigger: model_decision
description: Conventions for writing and changing database migrations in this repository
---
- Never edit a migration that has already run; add a new one.
- Every migration ships with a rollback.
- Name files with a timestamp prefix.go deeper
Recall the four trigger values and the two limits: 12,000 characters per workspace rule file and 6,000 for global_rules.md.
Explain what each mode puts in the system prompt and when, why model_decision depends on its description, and how a subdirectory AGENTS.md acts as a glob rule.
Show you can diagnose a rule that is ignored or bloats context: wrong mode, weak description, a glob that misses the edited files, or text past the limit.
Frame rule activation as a context budget: always-on guarantees obedience at a cost on every message, while on-demand modes save tokens but risk the rule never loading.
## What the trigger field is A **workspace rule** in Devin Desktop is a Markdown file in `.devin/rules/` (preferred) or the legacy `.windsurf/rules/`, one rule per file. Its YAML frontmatter carries a **`trigger`** field, the rule's **activation mode**. The mode answers two questions at once: **when** the rule's text reaches the agent, and **how much of the context window** it consumes on each message. Choosing it well is the difference between a rule that is always obeyed and one that crowds out the code the agent needs to see. ## The four activation modes | Mode | `trigger:` value | How it reaches the agent | Context cost | | - | - | - | - | | Always On | `always_on` | full content in the system prompt on every message | every message | | Model Decision | `model_decision` | only the `description` in the prompt; the full file is read when the agent judges it relevant | description always, body on demand | | Glob | `glob` | applied when the agent reads or edits a file matching `globs` | only when matching files are touched | | Manual | `manual` | not in the prompt; activated by typing `@rule-name` in the input box | only when mentioned | Practical consequences: - **`model_decision` lives or dies by its `description`.** The agent only ever sees that line until it decides to open the file, so a vague description means a rule that is never read. - **`glob` keeps file-type conventions cheap.** A testing convention scoped to `**/*.test.ts` costs nothing while the agent works on production code. - **`manual` is for rare, deliberate guidance**, such as a release checklist someone pulls in by name. - **`always_on` should stay short**, because it is paid for on every message. ## Files that take no frontmatter Two kinds of rule ignore `trigger` entirely: 1. The personal **`global_rules.md`** (at `~/.codeium/windsurf/memories/global_rules.md`) is always on across every workspace. 2. A **root `AGENTS.md`** is always on. A **subdirectory `AGENTS.md`** is handled like a `glob` rule with the generated pattern `<directory>/**`, so its activation comes from where the file sits. ## Size limits The docs state two ceilings, which together with the context cost of the mode are a reason to keep rules short: - each **workspace rule file**: 12,000 characters; - the **global rules file**: 6,000 characters. The pages state the limits but not what happens to text beyond them, so treat them as hard ceilings and split a long rule into several narrower files with their own triggers. The docs' own advice points the same way: simple, specific rules formatted as bullet points are easier for the agent to follow than long paragraphs, and generic advice such as "write good code" adds nothing. ## Choosing a mode 1. A convention that applies to every change in the repository and fits in a few lines: `always_on`. 2. A convention tied to a file type or a folder: `glob` with a precise `globs` pattern, or a subdirectory `AGENTS.md` if you want no frontmatter at all. 3. Background knowledge that matters only for some tasks: `model_decision` with a description that names those tasks. 4. A procedure someone invokes deliberately: `manual`, or a workflow if it is really a sequence of steps. A worked example: a repository has a forty-line guide to database migrations. As `always_on` it costs forty lines on every message, including messages about CSS. As `glob` with `globs: db/migrations/**` it would load only when the agent reads or edits a migration file, so it could miss a request for a new migration made before any such file is touched. As `model_decision` with a description such as "conventions for writing and changing database migrations", only one line rides in every prompt and the agent can pull the body in as soon as the task is about migrations. The right mode follows from **when the rule is needed**, not from how important it feels. ## The same fields under Devin Local The Devin Local agent, now the default for new tabs, reads `.devin/rules/` and `.windsurf/rules/` through the Devin CLI rules system with the same `trigger` frontmatter, and its @-mention menu includes rules so a manual rule can still be pulled into a conversation. A well-chosen trigger therefore survives the change of agent. ## Which agent reads them The Devin Desktop rules page was written for the Cascade agent, and the stable changelog for v3.9.19 (September 8, 2026) says Cascade has been removed, leaving Devin Local as the only agent. Devin Local loads the same files: Devin CLI's rules page reads `.devin/rules/*.md` (and `.windsurf/rules/*.md`) with the same frontmatter, so `always_on`, `manual`, `model_decision` and `glob` keep their meaning, and it lists one more value, `agent`.
- A glob rule in Devin Desktop never seems to fire. What do you check first?Check the `globs` pattern against the files the agent actually touches: a glob rule is applied only when the agent reads or edits a matching file, so a pattern like `*.js` will not match the TypeScript it is editing. Then check the rule sits in a discovered folder, `.devin/rules/` or `.windsurf/rules/` in the workspace or a parent up to the git root.
- Why might a team turn an always_on rule into a model_decision rule?Context cost. An `always_on` rule's full text rides in the system prompt on every message, while `model_decision` keeps only its `description` there and loads the body when the agent judges it relevant. For long guidance that matters to a minority of tasks, that trades a small risk of the rule being skipped for a leaner prompt.
- A model_decision rule is loaded in full on every message.
- A glob rule is active from the start of every conversation.
- A manual rule is run with a slash command, like a workflow.
- The 12,000-character limit is a total for all workspace rules combined.
- global_rules.md can be scoped to some files with trigger: glob frontmatter.