Pattern 11 · Control

Branching & versions

Editing an earlier prompt either destroys the conversation or forces the user to start over.

By Aleksey StepikinUpdated October 20263 min readLive demo
Live demo · try it

An interactive mock built in plain HTML, CSS and JavaScript. Data is fictional; no model is called.

FitWhen to use it — and when not

Use it when

  • Exploratory work: drafting, research, design
  • Long conversations where one early message steers everything
  • Comparing two approaches side by side

Skip it when

  • Simple single-turn tools
  • Agents that already executed real-world actions — branch the plan, not the past

AnatomyThe parts of the pattern

  1. Edit affordancePencil on past user messages.
  2. Branch pager‹ 1 / 2 › on the edited message.
  3. Downstream swapEverything below follows the selected branch.
  4. OverviewOptional tree or list of branches for long sessions.

GuidelinesDo & don’t

Do

  • Keep every branch; make switching instant.
  • Show which branch is active and how many exist.
  • Allow naming or pinning a branch in long projects.

Don’t

  • Overwrite the original prompt.
  • Hide branches in a separate history screen.
  • Let a branch silently share memory with its sibling.

In the wildReal-world examples

ChatGPTClaudeTypingMindLibreChat

Products named for reference only — no affiliation, and the demo above is an original illustration, not a copy of their UI.

For engineersImplementation notes

  • Model messages as a tree (id, parent_id); the visible chat is the path from root to the selected leaf.
  • Persist the selected child per node so reloads keep the user on their branch.
  • Build prompts from the active path only — never from the whole tree.

ControlRelated patterns

All 26 LLM UX patterns

Building an AI product?

I design and ship AI products end to end — LLM interfaces, agents, RAG, billing — from concept to a live product in weeks, not quarters. Tell me what you are building and get a fixed estimate.

Get an estimateBook a call

Create bold.
Deliver better.

See our workGet in touch