TypeClawTypeClaw
Reference

Match-rule DSL

Grammar and examples for roles.<name>.match[]

Compact strings parsed at config load. AND within a rule (whitespace-separated tokens), OR across rules. The parser rejects redundant or impossible forms and gives precise typo errors (autor: → "Did you mean 'author:'?").

Origin-kind prefixes

FormMatches
tuiany TUI session
cronany cron-fired session
subagentany subagent
subagent:<name>one specific subagent (e.g. subagent:memory-logger)

Channel prefixes

FormMatches
*any channel session, any platform
slack:*any Slack chat, any workspace
slack:T0123one Slack workspace
slack:T0123/C0ABCDEone specific Slack chat
slack:dm/*any Slack DM
discord:9999one Discord guild
discord:9999/<channel-id>one specific Discord channel
telegram:<chat-id>one Telegram chat
kakao:dm/*any KakaoTalk DM
kakao:group/*any KakaoTalk group chat
kakao:group/<chat-id>one specific group chat

Author qualifier

Appended to a channel rule, AND-combined:

slack:T0123 author:U_ME
discord:9999 author:U_MOD

The qualifier matches the specific author within the named scope. Authors and chats are AND'd; multiple authors require multiple rules.

Composition

Multiple rules within one role's match[] are OR'd:

{
  "roles": {
    "owner": {
      "match": ["tui", "slack:T0123 author:U_ME", "discord:9999 author:U_MOD"]
    }
  }
}

This role matches any TUI session OR the named Slack author OR the named Discord author.

Rejected forms

FormWhy rejected
slack:*/*redundant (matches everything slack:* already matches)
slack:*/C0ABCDEimpossible (wildcard workspace with specific chat)
slack:T0123/*redundant (matches everything slack:T0123 already matches)
team:T0123legacy prefix; not supported — rejected by the parser with a hint to use slack:T0123
guild:9999legacy prefix; not supported — rejected by the parser with a hint to use discord:9999
tg:42legacy prefix; not supported — rejected by the parser with a hint to use telegram:42
channel:<id>workspace-less channel id; not supported — canonical DSL requires <adapter>:<workspace>/<chat>

Built-in role match additions

User-declared match[] appends to the built-in match list. User-declared permissions[] replaces the built-in list entirely (no merge — "permissions": [] means none).

RoleBuilt-in match
owner[{ kind: 'tui' }] (always)
trusted[]
member[]
guest[] (fallback)

On this page