Skip to content

The mention trigger

Using @ to invoke a scope, a person, or a tool.

7 min

The at-sign is the composer's secret handshake. Typed mid-sentence, it gives the user a way to reference a doc, a person, a channel, a file, without leaving the flow of writing. Done poorly, it's a dropdown that pops open and kills the sentence. Done well, it's a second composer hiding inside the first.

"Every at-sign is a contract: the thing I named will be read by the model, exactly as I named it."
The pattern

Type @, get a menu, click or enter to insert.

The trigger is the glyph. Typing @ opens an inline menu beneath the cursor. The menu shows kind (doc, person, channel), name, and a short path. Fuzzy-matches as the user types. Clicking or pressing enter inserts a token — visually distinct from the surrounding prose, removable as a unit.

The key detail: the token is a first-class citizen of the prompt, not a string. Its name, source, and ID travel with it to the model.

Type @ to pull in a doc, person, or channel
Tokens are removable, typed, and readable in one glance
Type @ to reference a doc, person, or channel
Pull numbers from

One glyph (@) triples the composer's reach. The menu should feel like Slack, not SQL.

The why

Writing a name is different from picking one.

Typing "the Q2 plan" means the model has to guess which plan. Typing "@Q2-plan.pdf" means the user has already chosen. That small act of naming collapses half the ambiguity in most prompts and makes follow-up questions shorter and more precise.

Three moves

Details that separate great from workable.

  • Type glyph in the token. A tiny label in the pill — DOC, USER, CHAN — so the token is scannable without a hover state.
  • Ranked matches. Prior mentions first. Recently edited docs second. Then everything else. The menu should feel like it knows your week.
  • No fallback to text. If the user types @nothing-matches, don't silently leave the literal text. Show an empty state. Fail loud and editable.

The trap

Tokens that aren't really tokens.

Some products render the at-mention as styled text that is, under the hood, still just a string. When the prompt reaches the model, "Q2-plan.pdf" is just four words, not a fetched file. The token was a costume. Users notice the first time the answer is built from nothing.

Failure modes

What this pattern gets wrong when it gets wrong.

Phantom tool
A visible tool call that didn't happen, or happened but with different arguments than shown.
Leaky context
Content from another source, session, or user surfacing in a place it shouldn't.
Seen in the wild

Three shipping variants worth copying.

  • Typed @ opens a three-column menu: docs, people, tools
  • Selected mention renders as a pill in-line, not as text
  • Arrow-key cycling with a subtle focus outline, not a highlight