---
title: "Sessions and context"
description: "Keep related work in one thread, add context deliberately, steer or stop a running turn, and fork, revert, or hand off a conversation."
slug: "working-with-autohand-code/code/desktop/sessions-and-context"
sidebar:
  label: "Sessions and context"
---

## Project, thread, and agent session

A **project** points to a folder. A **thread** is the conversation and task history Desktop keeps. The **agent session** is the running conversation inside the selected agent. A thread can exist before its agent starts and after the agent process stops.

Sending the first message starts the agent. A finished turn means the agent stopped responding; it does not mean the work is correct or committed.

## Continue a task

Reopen the thread and send a follow-up that states the change and keeps the original acceptance criteria:

```text
Keep the implementation, but add coverage for an empty input and a zero
quantity. Rerun the existing tests. Do not broaden the change.
```

Start a new thread for unrelated work. If both tasks edit the same repository, give each its own [worktree](/working-with-autohand-code/code/desktop/projects#use-a-worktree).

## Add context deliberately

- Type `@` to mention files and folders.
- Use **+ > Files and folders** to attach files, or **Attach window** to add a screenshot of another app's window.
- Paste images, or drag a chat or file into the composer.
- Paste the smallest useful error output, with the expected behavior and the command that reproduces it.

Every agent has a finite context window. Long transcripts, large attachments, and switching agents all change what the model sees. Keep lasting decisions in files, tests, and short summaries.

## While the agent works

Follow its commands, edits, and approval requests in the thread. Some agents (Codex, Claude, and Pi) accept a message during a turn and use it to steer the work. With other agents, a new message waits for the current turn to finish. Use **Stop generation** before you change the goal substantially.

Stopping does not undo edits or commands that already ran. Check the working tree before you retry.

## Goals

**+ > Goal** sets a goal for the thread so the agent keeps working toward it across turns. The thread shows when it is pursuing a goal or paused. A goal does not bypass permissions or guarantee success; check the result like any other turn.

## Fork, edit, and revert

Hover a message for these actions:

- **Fork thread from this turn** starts a new thread that continues from that point. A fork is a new conversation, not a new branch or checkout. Check its environment before both threads edit files.
- **Edit message** changes one of your prompts and reruns from there.
- **Revert to this message** rolls the conversation back to that point and can also restore checkpointed file changes. Read the confirmation first. For deliberate repository recovery, use Git.

## Hand off to another agent [#hand-off-to-another-agent]

Open **Hand off** in the thread header.

<img className="ah-shot-light" src="/images/desktop/app/handoff-light.webp" alt="Hand off menu listing Continue in this thread with Codex and Claude, Continue in a new thread with Codex and Claude, and Continue in Autohand Web." width="2880" height="1800" />
<img className="ah-shot-dark" src="/images/desktop/app/handoff-dark.webp" alt="Hand off menu listing Continue in this thread with Codex and Claude, Continue in a new thread with Codex and Claude, and Continue in Autohand Web." width="2880" height="1800" />

The Hand off menu: continue with Codex or Claude in this thread or in a new thread, or continue in Autohand Web.

- **Continue in this thread** switches the agent and keeps the conversation in place.
- **Continue in a new thread** starts a fresh thread with the other agent and the context carried over.
- **Continue in Autohand Web** copies the conversation to Autohand Code Web. See [the CLI and Web](/working-with-autohand-code/code/desktop/cli-and-web#continue-in-autohand-code-web).

The menu lists the agents you have connected. A handoff carries the conversation context to the other agent; the two agents do not share one live session. Before you continue, check the model and permission mode in the receiving thread.

A useful handoff states the goal, the working directory and branch, the files changed, the tests already run, anything failing, and the next step.

## Imported history

Imports copy supported messages from Claude Code and Codex on this machine. Tool details and attachments may be incomplete, and imported threads do not stay in sync with the original CLI. Ask the agent to read the current files before you continue imported work.

## Archive and temporary chats

Archive finished threads to tidy the sidebar, and find them later in **Settings > Archived threads**. Archiving is not deleting. If **Delete worktree on archive** is on in **Settings > General**, a clean worktree is removed after the undo period only when no other task uses it; its branch is kept.

**Temporary** in the composer starts a chat that is not kept. Leave it off for real tasks, handoffs, and the quickstart.
