Configuration
AddautoRules to any label in your labels/config.json:
Rule Properties
| Property | Type | Required | Description |
|---|---|---|---|
pattern | string | Yes | Regex with capture groups. Uses JavaScript regex syntax. |
flags | string | No | Regex flags (default: gi — global, case-insensitive). g is always enforced. |
valueTemplate | string | No | Template using $1, $2 for capture group substitution. If omitted, uses first capture group. |
description | string | No | Human-readable description of what this rule matches. |
Regex Patterns
Rules use JavaScript regular expressions with capture groups:- Capture groups:
$1,$2, etc. are replaced with matched groups invalueTemplate - Global matching: The
gflag is always enforced, so all occurrences in a message are found - Multiple matches:
"CRA-1 and CRA-2"produces two label entries on the same label
Evaluation Behavior
When are rules evaluated?
When are rules evaluated?
Rules run when a user message is sent (both fresh messages and queued messages). Only user messages are scanned — assistant output and tool results are not.
Code block stripping
Code block stripping
Content inside fenced code blocks (
```) and inline code (`) is stripped before evaluation. This prevents false matches on code examples.Deduplication
Deduplication
The same label+value combination won’t be added twice to a session. If
"linear-issue::CRA-123" already exists, mentioning CRA-123 again is a no-op.Match limit
Match limit
Maximum 10 matches per message to prevent label explosion from pasted data (e.g., a log file with hundreds of issue keys).
Multiple rules per label
Multiple rules per label
All rules on a label are evaluated. All matches across all rules are collected and applied.
Error handling
Error handling
Invalid regex patterns are skipped at runtime and logged as warnings. Patterns are also validated at config-save time.
Value Normalization
Extracted values are normalized based on the label’svalueType:
| valueType | Raw Capture | Normalized |
|---|---|---|
string | CRA-123 | CRA-123 (pass-through) |
number | $45,000 | 45000 (strip symbol + commas) |
number | 1.5M | 1500000 (expand suffix) |
number | 50k | 50000 (expand suffix) |
date | 2026-01-30 | 2026-01-30 (pass-through) |
Full Example
A workspace that auto-tags Linear issues, deadlines, contacts, and budgets:- Pasting
https://linear.app/team/issue/CRA-456addslinear-issue::CRA-456 - Typing
deadline is 2026-03-15addsdeadline::2026-03-15 - Mentioning
reach out to alice@example.comaddscontact::alice@example.com - Writing
budget is $50kaddsbudget::50000