Skip to content

The context pill

How attached sources sit next to the cursor.

8 min

A context pill is what the model is actually reading. Not the prompt. The everything-else: files, threads, selections, URLs, prior memory. Most products hide this behind a settings panel or a paperclip icon, which is how users end up surprised by answers that ignored the thing they thought was obviously in scope.

Pills move that question to the surface. Each source gets a pill. Each pill is named, typed, and removable. That's it. The rest is typography.

"If the model is using it, the user should be looking at it. Otherwise you are building a product with one of its senses hidden."
The pattern

One source, one pill, one click to remove.

Pills live above the composer. They show kind (file, URL, thread, selection), name, and a small x. Clicking the name expands. Clicking the x removes. No modals, no drawers, no hidden configuration.

The discipline is naming. A pill labeled "context-43.json" is an abdication. A pill labeled "Q2 revenue memo · p4–8" is a sentence the user can reason about before they press send.

Attached-context tray · each pill is a source
Remove any source before send; model reads only what's left
Attached context · 4
FILE
THREAD
URL
SEL
Using: Q2-plan.pdf, #design-review, figma.com/… · Ceiling, Selected: lines 42–68.

Context belongs above the composer, not hidden in a side panel. Every source is removable before send.

The why

The answer is only as honest as the inputs.

Users blame the model when the answer is wrong. Often the real issue is that the model was working from three sources when the user assumed it had five, or vice versa. Pills close that gap. When the inputs are visible, the output becomes debuggable.

Three moves

Signals worth building in.

  • Type glyphs. A tiny FILE / URL / THREAD / SEL label on each pill. Makes the tray scannable without reading every name.
  • Span clauses. Not just "Q2.pdf." Write "Q2.pdf · p4–8." Precision is a form of truth-telling.
  • Silent auto-add. When the product pulls in context on its own, it should show a pill, never a toast. A toast disappears. A pill persists until the user consents.

The trap

Hidden context is a rigged answer.

The worst version of this pattern ships invisible context: prior turns, system prompts, "memory" the user never turned on. Every such source the user doesn't see is a surprise waiting to happen. The moment it contradicts an obvious assumption, trust collapses.

Failure modes

What this pattern gets wrong when it gets wrong.

Leaky context
Content from another source, session, or user surfacing in a place it shouldn't.
Empty disclaimer
A legal-feeling warning that carries no specific information about this particular response.
Ambiguous state
Running, done, errored, paused all look the same. The user has to infer from context.
Seen in the wild

Three shipping variants worth copying.

  • A pill with an icon, a name, and a one-line hover preview
  • A dismissable close button that undoes within 5s
  • A color shift when the model is actively reading from the source