---
title: Saved Sessions
description: Resume an AI coding session where you left off. Sessions are saved locally on your machine and scoped to each repository.
---

# Saved Sessions

TheGitAI saves your sessions locally so you can pick up exactly where you left
off. Saved sessions are **scoped to the repo** you were working in. Their local
history remains available on your computer regardless of which account is
currently signed in.

## List saved sessions

```bash
ai --list-sessions
```

Lists the locally saved sessions for the current repo. This does not require an
online ownership check.

## Resume a session

```bash
ai --session session_abc123
ai --session my-named-session
```

Resume a saved session by its id or name. Inside a running session you can also
use `/resume` to pick one interactively.

## What's kept

- Sessions are stored locally and scoped to the current repo.
- Continuing through the service requires the TheGitAI account used for the session.
- The **ten most recent** sessions per repo are kept.
- A resumed session restores its conversation history and the work state from
  where you left off. Mode is session-local and resumes in Default mode.

## Change where sessions are stored

Set `THEGITAI_SESSION_DIR` to override the default local directory where saved
sessions live.

::tip
Because sessions are repo-scoped, `ai --list-sessions` only shows sessions for
the repo you're currently in. `cd` into a different project to see its sessions.
::

You can reopen and read any session saved locally, even while signed out. If you
submit a request after signing in with a different account, the server explains
that the session is still saved on your computer and asks you to sign in with
the account used for that session or start a new one. If you accidentally
created a duplicate account, contact `support@thegit.ai`.
