Thread Branching

Thread branching is an AI UX pattern that lets users edit an earlier message and fork the conversation into a new path while keeping prior turns available. It supports exploration without destroying the original thread, so people can compare outcomes from different prompts or corrections.

Share

Interactive demo

How do I center a div?
1/2
Use flex items-center justify-center.

Overview

The design problem

How might we design thread branching so people can trust and act on AI output?

Use this pattern

When this pattern fits

  • Ideal for AI coding assistants, creative writing tools, and research applications where users need to explore multiple solution paths without losing conversation history.

Avoid this pattern

When to skip or lighten it

  • Single-turn tools where there is no conversation history to fork.
  • Compliance-heavy audit chats that must stay linear and immutable.
  • Tiny mobile composers where branch UI would bury send and regenerate.

States

State model coming soon

Key UX elements

Key UX elements coming soon

Anti-patterns to avoid

  • Editing a past message silently rewrites the whole transcript with no branch marker.

  • Forking without a way to return to the original path.

  • Losing tool calls, attachments, or artifacts when a branch is created.

  • Showing branches only as raw IDs with no preview of the differing turn.

How products use it

ProductImplementation
ChatGPTEdit a prior user message to regenerate from that point as a new branch.
ClaudeEdit-and-retry flows that preserve earlier context for comparison.
CursorChat forks and composer retries that keep alternate agent paths.
GitHub Copilot ChatRegenerate from an earlier prompt without wiping the session.

Implementation

Copy this prompt to generate a production-ready implementation in Cursor, Claude Code, Lovable, or any AI coding agent.

Generate a production-ready implementation of the "Thread Branching" AI interface design pattern.

Pattern Definition:

Frequently asked questions

What is thread branching in AI chat UX?

Thread branching lets you change an earlier message and continue from that point as a new path, while the original conversation remains available. It is how users explore alternate prompts without losing work.

When should I use branching instead of regenerate?

Use regenerate when you want another answer to the same prompt. Use branching when you need to change the prompt or context mid-thread and keep both outcomes.

How should branches be labeled?

Show a short preview of the differing user turn, a clear current-branch indicator, and one-tap switch back to the original path. Avoid burying branches in a generic history list.

What must survive a fork?

Attachments, tool results, and artifacts tied to shared ancestors should remain reachable. Only the divergent turns should change.

Weekly AI UX in your inbox

Weekly AI interface UX notes and resources on Substack, no spam, unsubscribe anytime.

Subscribe on Substack