---
title: "Claude Code auto-resume: restore every session after a restart"
description: "Claude Code auto resume for every project: claude --continue and codex resume restore one conversation; magent --go resumes them all after a reboot."
date: 2026-07-22
reading_time: "5 min"
keywords: ["claude code auto resume","claude --continue multiple projects","resume codex session","restore AI coding session","resume Claude Code after restart","claude code restore last session"]
canonical: https://magent.now/blog/auto-resume-claude-code-codex-sessions
markdown: https://magent.now/blog/auto-resume-claude-code-codex-sessions.md
site: https://magent.now
publisher: DevinoSolutions
---

# Claude Code auto-resume: restore every session after a restart

> **Short answer:** Claude Code resumes the latest conversation in a project folder with `claude --continue`, and Codex does the same with `codex resume --last`. To auto-resume every project at once after a restart, run `magent --go`: it reopens each project in its own terminal, resumes the Claude Code or Codex conversation in each, and tiles the windows across your monitors.

Friday, 18:42. You close the laptop mid-task — three Claude Code sessions deep in refactors, a Codex session halfway through a queue consumer, VS Code open on the docs. Monday, 09:01. All of that context is gone from your screen, and the first half hour of the week goes to reconstruction: reopening projects, hunting for windows, and trying to remember where each conversation left off.

The agents themselves solved half of this problem already. The other half — doing it _across every project at once_ — is what this post is about.

## Restore the last Claude Code session: claude --continue

Both major CLI agents can pick up their latest conversation in the current project directory:

```
cd ~/code/api && claude --continue   # resumes the latest Claude Code conversation here
cd ~/code/worker && codex resume     # same idea for Codex
```

Run either and the agent is back mid-thought — the plan it was following, the files it had touched, the question it was about to ask. No re-prompting, no pasting context back in. For the exact flags, where transcripts live and what a crash does not restore, see [how to resume a Claude Code session after a restart](https://magent.now/blog/resume-claude-code-session-after-restart).

## The half they didn’t

Resume commands are per-directory. With eight active projects, a restart means eight times: open a terminal, `cd`, type the right resume command for the right tool, drag the window somewhere sensible. It is exactly the kind of work that feels too small to automate and costs you every single day — and it is why _re-entry_, not agent speed, ends up being the tax on multi-project work.

## Resuming the whole desk at once

[mAgent](https://magent.now/) (the `magent` CLI) treats resume as a property of the workspace, not of one session. Its config knows every project and which tool each one uses; `magent --go` replays all of it:

```
$ magent --go
✓ layout restored — 2 monitors · 2×2
✻ claude  md:api     resumed "refactor routes"    (14h ago)
✻ claude  md:web     resumed "fix nav overflow"   (14h ago)
▌ codex   md:worker  resumed "queue consumer"     (15h ago)
▮ cursor  md:ops     launched — fresh session    (no resume)
⧉ vscode  md:docs    reopened last workspace
```

Three layers come back together:

- **Windows** — each project in its own terminal, auto-tiled into the same grid across your monitors as last time.
- **Agents** — the right tool starts in each window: Claude Code here, Codex there, Cursor where that project uses it.
- **Conversations** — `claude --continue` and `codex resume` run per window automatically; VS Code reopens its last workspace.

> The stable grid matters more than it sounds: the same project lands in the same tile every time, so your eyes and hands stop searching. Re-entry becomes a glance, not an archaeology dig.

## Restarts stop being expensive

Once resume is one command, a class of small decisions disappears. Reboot for the OS update now, not “after I finish these threads.” Shut down on Friday instead of leaving the machine hot all weekend. Undock the laptop without ceremony. The workspace is reproducible, so tearing it down costs nothing — the reasoning is the same as in [one command to set up your entire dev workspace](https://magent.now/blog/multi-project-development-setup), and it pairs well with [running multiple Claude Code sessions in parallel](https://magent.now/blog/run-multiple-claude-code-sessions) once everything is back up. For the day-to-day side of a restored fleet, see [managing a fleet of AI coding agents across projects](https://magent.now/blog/parallel-ai-coding-agents-workflow).

## Set it up once

First run scans your Claude Code, Codex, and VS Code history and writes the config; every run after that is the two-second version of your Monday morning. The [install guide](https://magent.now/install) takes about two minutes end to end.

## Step by step

1. **Install mAgent.** Run `pip install magent-multi-ai-agents-manager`. It needs Python 3.10 or newer and works on Windows, macOS and Linux.
2. **Generate your project config once.** Run `magent`. On first run it scans your Claude Code, Codex and VS Code history, finds your recent projects and writes the config.
3. **Run magent --go after any restart.** Run `magent --go`. It reopens each project in its own terminal, resumes the Claude Code or Codex conversation in each, and tiles the windows across your monitors.

## Frequently asked questions

### How do I auto-resume Claude Code after a restart?

Claude Code resumes the latest conversation in a folder with `claude --continue`. To do it for every project at once, run `magent --go`: it reopens each project in its own terminal, runs `claude --continue` in each, and tiles the windows across your monitors.

### How do I restore the last Claude Code session?

Run `claude --continue` (or `claude -c`) in the project folder: it reopens the most recent conversation in that directory without a picker. To choose an older conversation instead, run `claude --resume`. `magent --go` does the same for every project at once.

### Can Codex sessions be resumed automatically too?

Yes. `codex resume --last` reopens the most recent Codex chat in the current directory, and `magent --go` resumes Codex and Claude Code sessions together, each in its own window.

### What if a project has no previous conversation?

For a Claude Code project with no stored conversation, mAgent starts a fresh session instead of failing on `--continue`, so a brand-new project directory still opens with the agent running.
