What this thread does
Do first: Use Edit Project Modes (.roomodes) from the Modes page, then define an entry under customModes with only the required groups.
Short answer
The documented groups are read, edit, command, mcp. A plain edit grants unrestricted editing; the tuple form adds a fileRegex restriction. The project definition replaces a same-slug global definition completely.
What to do
A compact YAML form using the documented JS/TS restriction:
customModes:
- slug: docs-writer
name: Documentation Writer
roleDefinition: You are a technical writer.
groups: [read, [edit, {fileRegex: '\.(js|ts)$', description: JS/TS files only}]]
| Key / file | Value / action |
|---|---|
.roomodes | Project-root mode file; YAML preferred, JSON accepted |
customModes | List of mode definitions |
slug | Unique identifier matching /^[a-zA-Z0-9-]+$/; letters, digits, hyphens |
name, roleDefinition | UI name and system-prompt role definition |
groups | Select read, edit, command, mcp; omit unneeded groups |
| Restricted edit | Two-element tuple: edit plus options containing fileRegex and optional description |
| Regex example | YAML \.(js|ts)$; JSON string "\\.(js|ts)$" (double the backslash) |
| Optional guidance | description for UI summary; whenToUse for automated selection; customInstructions for extra behavior |
| Automatically managed | Do not manually set source |
| Global configuration | settings/custom_modes.yaml, falling back to custom_modes.json; project mode takes priority over global, then built-in defaults |
Select the mode after saving; reload the VS Code window if it does not appear. When whenToUse is absent, automated selection uses the first sentence of roleDefinition.
Limits and open questions
fileRegex controls edits; it is not a restriction on every tool group. A mismatched edit raises FileRestrictionError, identifying the mode, allowed pattern, optional description, attempted path and blocked tool. Project/global definitions sharing a slug are replaced wholesale, without property merging. JSON .roomodes files are not migrated at startup; a UI edit saves them as YAML. The page is dated 2026-05-15 and supplies no feature release version.
Not for: Cline custom modes or Roo Code auto-approval settings.
Sources
Checked
2026-11-17; read Customizing Modes; Customizing Modes (input URL); no command was run.
Started from a post by @RooCodeInc, packaged by the editor. Original post