Checked against the Claude Code and Codex documentation on December 2, 2026.
If you use Claude Code (Anthropic's coding agent) or Codex (OpenAI's) every day, you probably have hundreds of agent chats by now. Most of them are quick, like fixing a test or explaining an error. A few matter a lot: the refactor you're halfway through, or the plan you spent an afternoon on and meant to come back to.
The quick ones bury the important ones. I have thousands of agent chats, often several dozen open at once, and I kept losing track of work I cared about. I'd come back weeks or months later and struggle to find the conversation again.
The short version
- Raise
cleanupPeriodDaysin~/.claude/settings.json. Claude Code deletes sessions you haven't touched in 30 days. - Name the sessions you'll come back to with
/rename, which works in both tools. - Resume with
claude --resumeorcodex resume, and widen the list to every project when a chat seems missing. - Ask the agent for a handoff note before you stop.
- Keep one task per session, and give parallel sessions their own git worktree.
- To see which sessions are unfinished across both tools, use a board like Agent ATC.
Where your sessions live, and why they get buried
Claude Code saves each session as a JSONL file under ~/.claude/projects, with one folder per project. Codex saves its sessions under ~/.codex/sessions.
Both tools let you reopen an old session from a resume picker, and both pickers are built around recent chats in the folder you're in. With five chats, that's all you need. With five hundred spread over a dozen repos, the one you want is far down the list, in a different folder, under a title taken from your first message.
Neither tool tracks whether the work got finished. A chat where the agent wrapped up with every test passing looks exactly like one you dropped halfway because something more urgent came up. The only way to tell is to open it.

1. Stop Claude Code sessions from disappearing
If your old Claude Code chat history is gone, this is the likely reason: by default, Claude Code deletes chats you haven't touched in 30 days. I'd fix this one first.
The setting is cleanupPeriodDays. Add it to ~/.claude/settings.json:
{
"cleanupPeriodDays": 365
}Use whatever number covers how far back you'd want to look. Setting it to 0 won't keep chats forever: Claude Code rejects 0, so pick a large number instead. Chats that were already deleted stay deleted; the setting protects what's still on disk.
Codex has no equivalent setting for sessions. The size limit you may have seen, history.max_bytes in ~/.codex/config.toml, applies to ~/.codex/history.jsonl, the file of prompts you've typed, not to your sessions. It's off by default. If you set it, Codex drops the oldest prompts once the file passes that size, and your sessions in ~/.codex/sessions stay as they are.
2. Name the sessions you'll come back to
Generated titles are fine for quick chats. For anything you'll return to next week, give it a name you'll recognize.
In Claude Code, start a named session with claude -n billing-migration, or rename the one you're in with /rename billing-migration. Later, claude --resume billing-migration from the same repo takes you straight back.
In Codex, type /rename billing-migration inside a chat, or name a new chat as you create it with /new billing-migration. codex resume billing-migration brings it back.
3. Resume the right session
Resume a Claude Code session
To resume the last session in the current folder, run claude -c. To pick from a list, run claude --resume, or /resume inside a session. Press Ctrl+A to widen the list to every project on your machine, / to search, and Space to preview a session before you open it. If you pick a chat from another project, Claude Code copies the cd and resume command to your clipboard for you. The sessions guide lists the rest of the picker's keys.
Resume a Codex session
codex resume opens a list of your saved sessions. codex resume --last continues the most recent one in the current folder, and adding --all looks beyond it. Inside a chat, /resume opens the same list, with a switch between sessions from this folder and all of them. The command reference covers the flags.

4. Ask for a handoff before you walk away
In every Claude Code session I run, the agent keeps a PROGRESS file up to date as it works: what got done, what was decided and why, what's still open, and the next step. The instruction lives in my CLAUDE.md, so I never have to remember to ask.
When I come back to a chat after a couple of weeks, I read that note instead of scrolling back through the whole conversation.
You don't need a file for this. A last message like this one works:
Before we stop, write a short handoff: what's done, what's left,
any open questions, and the exact next step.5. Keep one task per session, and run parallel sessions in worktrees
Chats that wander across three unrelated tasks are the hardest to pick back up, and the hardest to find. Start a new chat when the work changes.
When you want to try a different approach without losing the current one, branch the chat instead of steering it somewhere new. In Claude Code that's /branch; in Codex it's /fork. Both copy the conversation so far into a new chat and leave the original as it was.
You can run several sessions on the same repo at once. Give each its own git worktree so they don't edit the same files: claude --worktree <name> in Claude Code, --worktree or /worktree in Codex. And don't resume the same Claude Code session in two terminals at the same time. Both write to one transcript, and messages can go missing. Add --fork-session if you need both.
When something is finished in Codex, codex archive <name> (or /archive) takes it out of the picker without deleting the transcript.
Cheat sheet: session commands in Claude Code and Codex
| Task | Claude Code | Codex |
|---|---|---|
| Where sessions are saved | ~/.claude/projects | ~/.codex/sessions |
| Keep sessions longer | "cleanupPeriodDays": 365 in ~/.claude/settings.json | Nothing to change; history.max_bytes only trims prompt history |
| Name a session | claude -n <name> or /rename <name> | /new <name> or /rename <name> |
| Resume the last session | claude -c | codex resume --last |
| Pick a session from a list | claude --resume or /resume | codex resume or /resume |
| Look in every project | Ctrl+A in the picker | All in /resume, or codex resume --last --all |
| Branch a session | /branch or --fork-session | /fork or codex fork |
| Run sessions in parallel | claude --worktree <name> | --worktree or /worktree |
Where the built-in tools run out
None of this tells you which chats you're still in the middle of. The pickers are per tool and sorted by date. If you use both Claude Code and Codex, that's two lists to check, and if you remember what was said but not where or when, you're back to scrolling.
Agent ATC started in August as a small terminal tool I built for myself, when I had around thirty Claude Code sessions going and couldn't keep them straight. It has since grown into a proper Mac app.
Agent ATC: a session manager for Claude Code and Codex
Agent ATC is a native Mac app we made for this. It reads the Claude Code and Codex chats already saved on your Mac and turns each one into a card on a board, with columns for Backlog, In progress, Needs review and Done. There's nothing to configure. You keep using Claude Code and Codex the way you do now, and new chats show up on their own.

Here's what it does:
- Shows what's unfinished. Move cards between columns as the work moves, and star the chats that matter so they stay in view.
- Finds a conversation by what was said. One search covers both tools. Alongside keyword search there's a meaning search, which runs on a small model inside the app, so a rough description of what you discussed is often enough.
- Gets you back in. Open a chat to see where it stopped, copy the resume command, and paste it into your terminal.
- Catches you up. An optional AI recap summarizes a long chat and suggests next steps. It runs through your own Claude Code or Codex account, so it counts toward your plan's limits or API bill, and only the part you approve is sent.
- Comes with an iPhone app. The free iPhone companion shows the same board, so you can check what's unfinished, change a status or star a chat away from your desk.
Your chats never come to us. The library and search stay on your Mac, and iPhone sync goes through your iCloud account.
Agent ATC runs on Apple Silicon and Intel Macs with macOS 14 or later. It costs $29 once, with no subscription and a 7-day money-back guarantee. Get Agent ATC.
Where MemoryPlugin fits
Agent ATC and MemoryPlugin do different jobs.
MemoryPlugin Sync, on a Pro plan, adds your Claude Code, Codex and Cursor sessions to your MemoryPlugin chat history, so whichever AI you open next can recall what was decided in them. Ask ChatGPT why you chose that database, and it can find the Claude Code session where you made the call.
Agent ATC looks after the work itself: which chats are done, which ones you're in the middle of, and how to get back into them.
Frequently asked questions
Where is Claude Code chat history stored?
In ~/.claude/projects, with one folder per project and one JSONL file per session. Setting the CLAUDE_CONFIG_DIR environment variable moves it somewhere else.
Why did my Claude Code sessions disappear?
Claude Code deletes sessions you haven't touched in 30 days by default. Raise cleanupPeriodDays in ~/.claude/settings.json to keep them longer. Sessions that were already deleted don't come back.
How do I resume my last Claude Code session?
Run claude -c to continue the most recent session in the current folder, or claude --resume to pick from a list. If you named the session, claude --resume <name> opens it directly.
How do I find an old Claude Code conversation?
Run claude --resume, press Ctrl+A to include every project, then use / to search or Space to preview. If you haven't touched the chat for longer than your cleanupPeriodDays setting (30 days by default), it has already been deleted.
Does Codex delete old sessions?
Codex doesn't document any automatic deletion of sessions. The history.max_bytes setting in ~/.codex/config.toml only caps ~/.codex/history.jsonl, the file of past prompts, and it's off by default. Sessions in ~/.codex/sessions stay until you remove them, for example with codex delete.
How do I list and resume Codex sessions?
codex resume opens a list of your saved sessions. codex resume --last continues the most recent one in the current folder, and adding --all looks in every folder. A session you named with /rename opens with codex resume <name>.
Can I run multiple Claude Code sessions at once?
Yes. Start each one in its own git worktree with claude --worktree <name> so they don't edit the same files. Don't resume the same session in two terminals at once; add --fork-session if you need two copies.
Is there a session manager for Claude Code and Codex?
Each tool has its own resume picker, which lists that tool's sessions, newest first. Agent ATC, a Mac app we make, shows your Claude Code and Codex sessions together on one board, with search and status columns.
Does Agent ATC upload my chats?
Not to us. Your library and search stay on your Mac. If you turn on iPhone sync, your chats go through your own iCloud account. If you ask for an AI recap, only the part you approve is sent to Anthropic or OpenAI, through your own Claude Code or Codex account.
