---
title: "Manage CLI sessions and history"
summary: "Resume past sessions, name the current one, branch or rewind the conversation, and clean up old sessions in the Matilda Code CLI."
url: https://help.maincode.com/products/matilda/v1/en/code/cli-sessions
product: "Matilda"
kind: how-to
version: v1
discovery: {"area":"code","components":["code-cli"],"capabilities":["conversations"],"tasks":["Resume a previous session","Name the current session","Branch or rewind the conversation","Delete old sessions"],"platforms":[],"releases":[]}
source: MaincodeHQ/matilda-code@9cb4e347eac124436884507afaa521a370ed5850
---

# Manage CLI sessions and history

The CLI keeps your past sessions, so you can pick up where you left off, try a different direction, or tidy up later.

## Resume a past session {#resume-a-past-session}

Run `/resume` (or `/continue`) to open the session picker and choose a past session. To skip the list, pass the session ID or a name you gave it, for example `/resume deploy-fix`. If the name matches several sessions, the picker lists only the matches.

## Name the current session {#name-the-current-session}

Run `/rename <name>` (or `/tag <name>`) to label the session you are in, so it is easy to spot in the picker later. Run `/rename` with no name (or `/rename --auto`) to have the model generate one from the conversation, using the Fast Model from `/settings` if one is set, otherwise the main model. Generated names show up dimmed in the picker so you can tell them from your own.

## Branch the conversation {#branch-the-conversation}

Run `/branch` to copy the conversation so far into a new session and switch to it. The original session is untouched, and the CLI prints a `/resume <id>` hint for getting back to it. Name the branch with `/branch api-redesign`, or it takes its name from your first message and shows up with a `(Branch)` suffix in the picker. The command refuses while a response or tool call is in flight.

## Rewind to an earlier turn {#rewind-to-an-earlier-turn}

Run `/rewind` (or `/rollback`), move through your turns with the arrow keys, and press Enter. If checkpointing captured file edits after that turn, choose to restore code and conversation, restore conversation only, or restore code only. Otherwise the conversation after the turn is removed and your prompt comes back into the input box for editing. Rewinding never touches files you edited by hand or with shell commands.

## Delete old sessions {#delete-old-sessions}

Run `/delete` to open the Delete Session picker, mark the sessions you want gone, and confirm to remove them. The session you are in cannot be selected.
