# Forking Chats (https://www.librechat.ai/docs/features/fork)

Forking creates a new conversation that branches off from a specific message in an existing one. The new chat copies the messages you choose, so you can explore an alternate direction, test a different prompt, or split a long thread into focused topics without altering the original.

## How to Fork a Conversation

<Steps>
<Step>

**Hover over a message** and open its menu, then select the fork icon. The message you open the menu from becomes the target message for the fork.

</Step>
<Step>

**Choose a fork option** to control which messages are copied (see below).

</Step>
<Step>

**Confirm the fork.** LibreChat opens the new conversation with the copied messages, leaving the original untouched.

</Step>
</Steps>

The *target message* is the message you opened the menu from. If you enable **Start fork here**, the target instead becomes the latest message in the conversation, and forking runs from the selected message forward.

## Fork Options

Each option copies a different set of messages relative to the target.

### Visible messages only

Copies only the visible messages: the direct path to the target message, excluding any branches.

<ThemeImage
  light="https://github.com/danny-avila/LibreChat/assets/32828263/873bdba1-de1f-4b84-a996-b2dbfc866d55"
  dark="https://github.com/danny-avila/LibreChat/assets/32828263/0ed6ea88-5840-4dda-8f8b-305a4c34a050"
  alt="Visible messages only fork option"
/>

### Include related branches

Copies the direct path to the target message along with any branches that sit along that path.

<ThemeImage
  light="https://github.com/danny-avila/LibreChat/assets/32828263/e633f701-acf5-4878-bdd1-29abacb3e3e7"
  dark="https://github.com/danny-avila/LibreChat/assets/32828263/0c297451-990b-4ab2-9ff2-bc3958ab7129"
  alt="Include related branches fork option"
/>

### Include all to/from here

The default option. Copies every message leading up to the target, including neighboring branches, whether or not they are visible or on the same path.

<ThemeImage
  light="https://github.com/danny-avila/LibreChat/assets/32828263/d19b427b-e018-41e6-ab1a-6306a94be26b"
  dark="https://github.com/danny-avila/LibreChat/assets/32828263/ae3e5086-7b8f-417f-8b6e-073776536a49"
  alt="Include all to/from here fork option"
/>

## Additional Settings

**Start fork here** forks from the selected message to the latest message in the conversation, using the option chosen above.

<ThemeImage
  light="https://github.com/danny-avila/LibreChat/assets/32828263/801e50e4-749a-42f3-83bd-a3fc06c6e189"
  dark="https://github.com/danny-avila/LibreChat/assets/32828263/bb2f2e39-091e-4b5b-926d-bf36c7a65079"
  alt="Start fork here setting"
/>

**Remember** saves the options you select and applies them to future forks, so you do not have to set them each time.

<ThemeImage
  light="https://github.com/danny-avila/LibreChat/assets/32828263/9a9f61db-c3ec-4139-8f3a-e25557d95066"
  dark="https://github.com/danny-avila/LibreChat/assets/32828263/a567965f-881e-423b-9eec-e3004643a560"
  alt="Remember fork options setting"
/>

You can also set the default fork behavior from the settings menu.

<ThemeImage
  light="/images/fork/fork-settings-light.png"
  dark="/images/fork/fork-settings-dark.png"
  alt="Default fork behavior in the settings menu"
/>
