Macros (CBS)
Curly-brace scripting inside any prompt text.
Syntax
Macros are double-brace tokens that expand at request time. They work in character fields, lorebook entries, presets, greetings, and plain chat text, and they nest.
{{char}} smiles at {{user}}.
{{random::sunny::rainy::foggy}}
{{calc::1+2*3}}Arguments are separated with double colons. Unknown macros expand to nothing rather than erroring, so a typo never breaks a request.
Core macros
| Macro | Expands to |
|---|---|
{{char}} | The current character's name (group chats: the current speaker). |
{{user}} | Your persona's name. |
{{persona}} | Your persona's description. |
{{description}} | The current character's description field. |
{{lastmessage}} | The most recent message text. |
{{time}} / {{date}} | Current time / date in your locale and timezone. |
Randomness
random picks one argument fresh each expansion, pick makes a choice that stays stable for the conversation, and roll throws dice with d-notation.
{{random::a::b::c}} {{pick::a::b::c}} {{roll::d20}}Rolls and randoms are seeded per turn: a regenerate reuses the same values, so swiping does not reroll your dice.
Variables
Chat variables persist per conversation branch; global variables persist across all chats. Set them in any macro-capable text or from trigger scripts.
{{setvar::mood::happy}}
{{getvar::mood}}
{{setglobalvar::visits::1}}Branch-scoped storage means swiping to another branch restores that branch's variable state; siblings never leak values into each other.
Block forms
Blocks wrap content: if renders its body only when the condition is truthy, each loops over arrays with slot substitution, and when adds line-based else branches.
{{#if {{equal::{{getvar::mood}}::happy}}}}
{{char}} is in a great mood.
{{/if}}
{{#each {{array::red::green::blue}} item}}
Color: {{slot::item}}
{{/each}}pure and escape protect literal braces from expansion; any closing tag closes the innermost open block.
Comments and literals
Comment macros vanish before the model ever sees them, which makes them ideal for notes inside card fields. Use pure blocks when you need to show macro syntax literally.
{{// note to self, never sent to the model}}
{{#pure}}{{char}} stays literal here{{/pure}}