How Do Coding Agent Sessions Work Across Different AI Coding Tools?
Learn how coding agent sessions store history, restore context, manage branches, recover work, and handle privacy across popular AI coding tools.

In this article · 28 sections +
- What Is a Coding Agent Session?
- Quick Decision Guide
- How Is a Session Different From Chat, Context and Memory?
- What Gets Saved During a Session?
- Does Resuming Restore Your Code?
- Which Commands Resume or Fork Your Work?
- How Do the Five Main Tools Compare?
- How Do Codex Sessions Work?
- What Are Agent Sessions in VS Code?
- How Do Agent Sessions Run on GitHub?
- What Can Linear Coding Sessions Do?
- How Does Claude Code Handle Conversations?
- Where Is Your History Stored?
- How Does Coding Agent Session Search Work?
- Which Names Help You Find Work?
- Does History Sync Across Devices?
- How Can You Recover a Missing Thread?
- What Happens After Expiry?
- Is Archiving the Same as Deleting?
- Can You Move Work Between Tools?
- Which Agent Session Viewer Handles Several Tools?
- How Do You Prevent Parallel File Conflicts?
- What Did My Git Tests Show?
- What Keeps Agent Work Productive?
- What Makes a Coding Agent Session You’re Particularly Proud Of?
- What Should You Check Before Sharing?
- How Should Teams Govern Agent Records?
- FAQs
Coding agent sessions now span terminal CLIs, editors, and cloud platforms, and each product records them differently. That turns simple jobs into guesswork: reopening yesterday’s task, hunting down a lost thread or handing unfinished code to another tool. It gets harder once several agents, folders and accounts touch the same piece of work.
The right move depends on where the work ran and what you need back. A vanished chat calls for different steps than a half-finished branch or a transcript you plan to show someone. Knowing which record you have can save time and keep you from sharing more than you intended.
- My product claims come from vendor documentation, project pages, and published research. I haven’t tested any agent product hands-on. I did run a few small Git tests, which I label separately, and I mark my own frameworks and examples. I last verified product details on November 30, 2026.
What Is a Coding Agent Session?
A coding agent session is the record of one task’s exchange between you and an agent, with the working context attached to it. The meaning of a coding agent session varies by product: one treats it as a saved conversation, while another treats it as a unit of work that can hold several chats.
Quick Decision Guide
Match your next move to what changed. Its slash commands apply to Claude Code and Codex.
| Your situation | What to do |
|---|---|
| Same goal, context still useful | Continue |
| Same goal, context getting crowded | Run /compact if a summary can carry the details; compaction sends a large request and can drop nuance |
| Stale context or two failed fixes | Run /clear or start fresh with a sharper prompt and clear “done” criteria |
| New, unrelated goal | Start a new session |
| Two competing approaches | Branch or fork, and give each its own Git worktree |
| Moving to another tool | Prefer native resume if you can stay; otherwise use a supported import or a handoff note |
| Sharing or application proof | Send a reviewed, secret-free copy that states its limits |
How Is a Session Different From Chat, Context and Memory?
A session tracks one task, a chat holds one conversation, the context window limits what the model can use at once, and project memory supplies lasting guidance. They can drift apart: compaction swaps older messages for a summary, so your saved transcript may show more than the model now sees.
A new session doesn’t automatically recall earlier conversations, although it may load instructions from project files, settings, or a memory system. Claude Code, for example, loads CLAUDE.md files and auto memory at startup. It treats both as guidance, so use hooks or permission deny rules for anything that must hold.
What Gets Saved During a Session?
It depends on the product. Some keep prompts, tool calls, and results in detail, while others document only conversation turns, file references, or logs. Check your tool’s own documentation before you count on a particular output or attachment being there later, especially when you need it as evidence.
| Product | What its documentation describes |
|---|---|
| Claude Code | Messages, tool calls and results in plain text; separate files for large tool output and subagents; pre-edit snapshots of files Claude changed; caches for large pastes |
| VS Code history | Metadata, conversation turns, touched file paths and pull request, issue or commit references; full tool output isn’t documented there |
| GitHub | Session logs, with commit messages that link back to them |
I didn’t verify attachment or tool-output retention for Codex or Linear.
Does Resuming Restore Your Code?
No, don’t expect it to. Resuming mainly reopens the conversation, and some tools also bring back tool records and settings. Your files, Git state, running services, and credentials live outside that thread. Any of them may have changed since you left.
This six-layer framework is mine, and the middle column reflects Claude Code’s resume behavior.
| Layer | What Claude Code does | Verify before continuing |
|---|---|---|
| Conversation | Reloads messages, tool calls, and results; after compaction, the summary plus later and unsummarized messages | Critical constraints |
| Workspace | Leaves your actual project files as they are now | Folder and diff |
| Git | Tracks commits separately from the transcript | Branch, git status and commits |
| Checkpoints | Offers limited file rewind as a separate feature | Which edits it covers |
| Runtime | Doesn’t revive ended background commands; interrupted tool calls don’t finish or rerun | Services and whether commands took effect |
| Access | Restores some permission modes, depending on how you resume | Sign-ins, variables and temporary credentials |
For files, checkpoints let /rewind undo tracked edits. They miss files changed only by Bash commands and usually miss subagent edits, and restores skip symlinked or hard-linked files. Claude Code’s file history covers the 100 most recent checkpoints, so commit important work to Git.
Which Commands Resume or Fork Your Work?
The commands depend on your tool. Claude Code and Codex offer terminal options for reopening earlier work or splitting off a second path, while VS Code relies on its session list and /fork. Syntax can change between releases, so check each command against your installed version before you rely on it.
| Action | Claude Code | Codex CLI | VS Code |
|---|---|---|---|
| Pick an earlier session | claude --resume or /resume |
codex resume |
Open it from the list |
| Continue the latest here | claude --continue |
codex resume --last |
Select it in the list |
| Branch the conversation | /branch or --fork-session |
codex fork or /fork |
/fork |
| Start in a separate checkout | claude --worktree <name> |
--worktree with a session ID |
Worktree isolation |
How Do the Five Main Tools Compare?
The biggest split is where work runs: Claude Code and Codex CLI center on your terminal, VS Code on your editor, and GitHub and Linear add cloud runs tied to repositories or issues. In the table, “Not documented” means my official-page review couldn’t confirm a feature, while “Varies” depends on version or setup.
| Agent | History | Search | File isolation | Sharing and export | Cost |
|---|---|---|---|---|---|
| Claude Code | Local JSONL | Session picker | Optional worktree | Plain-text /export |
Token use |
| Codex CLI | Local Codex folders | Scope filters; text search not documented | Optional worktree | Markdown /export |
I didn’t research it |
| VS Code | Local history database; varies by source | /chronicle:search |
Varies; forks may share a worktree | JSON or Markdown copy; view-only sharing for synced sessions | I didn’t research it |
| GitHub Copilot cloud agent | Logs on GitHub | Questions about your own synced sessions | Temporary cloud environment | Cloud sessions visible to repository users by default | Actions minutes and AI credits |
| Linear | Cloud; storage details not documented | Not documented | Cloud environment; design details not documented | Repository teammates follow and steer | AI credits for tokens and sandbox time |
How Do Codex Sessions Work?
Codex records where each saved chat began. That detail shapes which chats appear when you resume and which directory the tool uses next. Closing the terminal normally leaves the transcript in place, so check your location first whenever an expected chat seems to be missing.
OpenAI’s command reference says --last skips the picker and reopens the latest chat from your current directory; add --all to look elsewhere. When folders differ, Codex asks which to use unless it tui.resume_cwd decides. You can also resume by ID or name.
What Are Agent Sessions in VS Code?
In VS Code, a session can group related chats around one task. Each chat keeps its own conversation history and context, but chats can still work against the same files when they share a workspace or worktree. You manage sessions in the Chat view or the separate Agents window.
| View | What its list shows |
|---|---|
| Chat view | Current-workspace sessions by time; with no workspace open, sessions across workspaces |
| Agents window | Sessions across workspaces, grouped by workspace by default |
Supported external sessions can come from Claude Code, Codex, Copilot CLI, and the GitHub Copilot app. The External filter defaults to seven days, and for supported local sources, Copilot considers only that window, even if you choose 30.
Nested sessions use the parent’s folder or worktree by default. They start without the other chat’s history, so restate requirements.
How Do Agent Sessions Run on GitHub?
GitHub Copilot cloud agent works on a repository branch while you follow status and logs, send corrections or stop the run. A session doesn’t necessarily open a pull request. Depending on how you start it, you can review changes first and create one later, or request one right away.
The agent runs in a temporary GitHub Actions environment. Mention @copilot to request changes to an existing pull request. Per the tracking documentation, stopping a run keeps pushed commits.
A cloud run lasts up to 59 minutes. It works on one branch at a time and can open one pull request per task, within one repository. Each Devin-hosted agent session offers a comparable cloud pattern in its own virtual machine.
What Can Linear Coding Sessions Do?
Linear coding sessions are cloud runs where Linear Agent uses Claude Code or Codex to work from an issue and return a draft pull request. Teammates with repository access can follow progress, add context, steer, and review diffs. In my judgment, contained fixes suit them better than loosely defined work.
Linear’s setup documentation says delegating an issue starts a run. Asking only to investigate or plan produces no code changes, while asking to fix or implement starts coding. You need a GitHub integration and AI credits; your own model key doesn’t remove sandbox charges.
Handle secrets carefully. Anyone who can run sessions in that environment can view its variable values, so use limited development credentials, never production keys.
How Does Claude Code Handle Conversations?
Claude Code sessions are conversations that the CLI saves continuously on your machine and files by project directory. Your starting folder therefore affects what appears in the picker. The desktop app, claude.ai/code, and the VS Code extension also keep separate lists, so check which surface you used.
/branch Copies the conversation and moves you into the copy. Don’t resume one session in two terminals without forking, because both message streams mix into one transcript.
Where Is Your History Stored?
Claude Code CLI, Codex CLI and OpenCode keep history on your machine; GitHub and Linear keep cloud-run activity with their services; and VS Code adds a local history database. Start with an app’s resume or export feature, such as Claude Code’s /export. Open raw files only for diagnosis, because their locations and formats can change.
| Product | Default location | Override or setting | Confidence and limits |
|---|---|---|---|
| Claude Code CLI | ~/.claude/projects/<project>/<session-id>.jsonl |
CLAUDE_CONFIG_DIR |
Vendor path. On Windows, ~/.claude means %USERPROFILE%\.claude |
| Codex | ~/.codex/sessions/; archives in ~/.codex/archived_sessions/ |
CODEX_HOME |
OpenAI names the folders; JSONL evidence comes from one bug report |
| OpenCode | ~/.local/share/opencode/opencode.db |
OPENCODE_DB |
Vendor path; don’t edit the database |
| VS Code history | Local SQLite database | github.copilot.chat.localIndex.enabled |
File path not documented; transcript files may differ by agent type or version |
If you run agents on your own infrastructure, the open-source OpenHands coding agent platform offers a self-hosted route, with hosting and security work for your team.
How Does Coding Agent Session Search Work?
Start with your tool’s built-in list and search a distinctive clue: an error message, file path, branch, or pull request number. Broad words such as “bug” return noise. Where your tool allows, narrow by folder or branch and preview a match before resuming.
- Claude Code: In the
/resumepicker, press/to search,Spaceto preview,Ctrl+Bfor the current branch orCtrl+Afor all local projects. You can paste a pull request URL. - Codex: The
/resumepicker offers current-directory, all-session and, when available, repository scopes.Ctrl+Tpreviews a chat, and--include-non-interactiveadds scripted runs to the list. - VS Code: Run
/chronicle:searchwith a keyword, file path, issue or pull request. - GitHub: Ask Copilot Chat about your own synced sessions.
Which Names Help You Find Work?
Name work after its outcome, such as fix-token-refresh. In Claude Code, use claude -n <name> at startup, /rename during work, or Ctrl+R in the picker. Archiving can also shorten a crowded list.
Does History Sync Across Devices?
It varies. VS Code history sync is experimental and off by default; once on, it uploads local history to your GitHub account. Synced records remain until you delete them.
I didn’t verify built-in sync for local Claude Code CLI or Codex CLI transcripts.
How Can You Recover a Missing Thread?
Don’t treat a missing record as lost right away; it may simply sit out of view. Confirm the app, account, and host, widen folder scope and filters, then match your symptom below. Before attempting any repair, copy whatever you find and leave the originals untouched.
| Symptom | Next step |
|---|---|
| Claude Code project moved or renamed | Press Ctrl+A in the picker, or run claude --resume <session-id> |
claude -p or SDK run is absent |
Resume it by ID; the picker omits these runs |
You ran /clear |
Open /resume; the earlier thread remains if you kept persistence on |
No conversation found with session ID |
Verify the ID and config directory; duplicate copies across projects can confuse lookup |
| Codex chat is absent | Run codex resume --all, then try codex unarchive |
| VS Code session is absent | Confirm the tool supports that source; after a crash or backup restore, rebuild the history index with /chronicle:reindex |
| Claude Code worktree disappeared | Resume lands in your current directory, so confirm the folder and branch |
| Command crashed midway | Confirm whether it took effect before rerunning |
Reindexing refreshes search data; don’t count on it to recreate deleted history.
What Happens After Expiry?
Claude Code CLI keeps transcripts for 30 days by default; the cleanupPeriodDays period can change. Its cleanup sweep removes expired transcripts, subagent files, large tool results, and checkpoint snapshots. To get the conversation back, plan on needing your own export or backup. Desktop app transcripts follow different rules, and I didn’t verify expiry for other tools.
Is Archiving the Same as Deleting?
| Product | Archive | Delete |
|---|---|---|
| Codex CLI | Keeps the transcript and hides it; codex unarchive restores it |
codex delete <SESSION> removes it permanently |
| VS Code | Keeps history; for worktree sessions, commits pending changes and removes the folder, or keeps it if that fails | Permanent; can remove associated, unshared worktrees |
| GitHub | Applies to stopped cloud sessions | Works only for local sessions |
Can You Move Work Between Tools?
Sometimes, but a transfer isn’t a native resume. You receive copied chats or a context summary, while the old runtime stays behind. OpenAI documents a route from Claude Code into Codex CLI, but I found no official instructions for the reverse.
| Route | What moves | Best fit |
|---|---|---|
| Native resume | The same tool’s thread | Staying put |
| Official import | Up to 50 Claude Code chats from the last 30 days, plus supported setup | Moving into Codex CLI |
| Generated handoff | A context document built from local records | Pairs a converter supports |
| Manual handoff | Goal, decisions, branch, test proof, and open gaps | Any other case |
For the official route, type /import in an idle Codex session. OpenAI’s import documentation says your original setup stays unchanged. Afterward, review MCP sign-ins, hooks, and plugins.
cli-continues is an MIT-licensed converter that needs Node 22.5 or later. The project says it doesn’t modify source sessions, but it builds ~/.continues/sessions.jsonland its README has no privacy policy.
Which Agent Session Viewer Handles Several Tools?
Choose a category first. Viewers such as Agent Sessions, AgentsView, and Sessions Viewer browse records, while orchestrators like CCManager run live work. Add one only when native search falls short. Since a viewer may read sensitive history, first check platform support, file access, indexes, sync, telemetry, and removal steps.
| Factor | Agent Sessions | AgentsView |
|---|---|---|
| Platforms | macOS 14+ | macOS, Linux and Windows; macOS and Windows desktop app; Docker |
| Strength | Unified search; resume through supported Mac terminals | Search, usage dashboards and opt-in semantic search |
| Data | Reads session folders and builds indexes; README also describes cleanup workflows you trigger | Local by default; optional database sync |
| Network | Reports no telemetry; optional update and price requests | Limited anonymous telemetry by default; AGENTSVIEW_TELEMETRY_ENABLED=0 disables it |
Both use the MIT license, as does Sessions Viewer, a cross-platform option. Its README says source JSONL stays unchanged yet also says it renames sync to the CLI, so back up first. I found no privacy policy there.
How Do You Prevent Parallel File Conflicts?
Give each independent coding attempt its own Git worktree or isolated sandbox, then review and merge deliberately. A new chat alone won’t protect files, because two agents in one folder can overwrite each other. Worktrees split checked-out files, yet they still share repository data and may reach the same outside services.
Defaults matter when you run multiple Codex agents together: subagents share the parent’s working tree by default, while parallel threads can use worktrees or cloud environments.
What Did My Git Tests Show?
I ran these in a throwaway repository with Git 2.43.0 on November 30, 2026. They test Git itself; no coding agent took part.
| Test | Result |
|---|---|
| Edit inside a new worktree | The main folder’s file didn’t change |
| Look for an ignored .env in that worktree | It was missing |
| Check out one branch in a second worktree | Git refused |
| Commit in the worktree | The shared repository recorded it on that branch |
| Create a worktree while the main folder had an uncommitted edit | The new checkout showed the committed version |
So commit what another attempt needs, and recreate required ignored files and dependencies. My extra check: prevent parallel tests from colliding on one database, port, or external service.
What Keeps Agent Work Productive?
Give the agent one goal, specific context and a check it can run. Judge progress by test output or a diff, not a confident summary. Correct wrong turns as soon as you spot them, before later changes build on top of a bad assumption.
For uncertain work, I’d also request likely causes and affected files before any edit. A fresh reviewer can help, but judge each finding, since one asked to find problems will report some.
What Makes a Coding Agent Session You’re Particularly Proud Of?
A strong example shows your thinking, not how much code the agent generated. Pick a real problem where one decision changed the outcome, and keep that turning point easy to follow. A short transcript built around it can tell a clearer story than a sprawling record of every step.
The phrase spread through Y Combinator applications. A Hacker News discussion quotes an optional, experimental Spring 2026 question requesting such an attachment. I found no official YC page confirming it or its file rules, so read the live form.
State the problem plainly, back the outcome with tests or a diff, and name unfinished work or edits. Don’t polish away a recovered mistake, since it can show useful oversight.
What Should You Check Before Sharing?
Treat every transcript, export and local index as sensitive until you review it. These records may expose source code, customer details, personal data, command output, or credentials. Check the whole export, not only your prompts, and confirm that your employer or client permits disclosure to the people who’ll receive it.
A November 2026 Odin by Brandefense report found 112 user-operated servers exposing agent folders over HTTP, 100 with real user files. This doesn’t show that any coding agent provider suffered a breach. Researchers matched secret patterns but didn’t test credentials, so those hits don’t prove compromise.
- Work on a copy: Keep the original intact.
- Distrust filters alone: Automated screening can miss secrets and personal details.
- Rotate exposed keys: Revoke or replace them, since deleting text isn’t enough.
- Limit access: Prefer view-only links and review their audience.
My rule: don’t share a record that still holds a live credential, confidential code or data you lack permission to disclose, details of an unfixed security flaw, or anything you haven’t fully read. If trimming can’t make it safe, write a clearly labeled summary that discloses no protected detail.
How Should Teams Govern Agent Records?
Teams should set rules for who can start and view sessions, which records they keep, how long they keep them, and how reviewers trace actions to people. Product controls differ, so write rules for each tool and revisit them whenever access or features change.
- Audit trail: GitHub Enterprise owners can filter agentic audit log events
actor:Copilotacross 180 days. Records can identify the initiating user and, for session events, a session ID. The reference doesn’t say whether they include prompts or transcripts. - Identity: Borrowed employee credentials blur attribution. Consider separate AI agent identities with named owners and expiry dates.
- Policy: Enterprise settings can disable VS Code session sync, and GitHub organization rules can block it.
- Access: Review repository membership together with environment permissions.
- Ownership: Name an export owner for each product.
FAQs
Q. Can the Claude desktop app resume a CLI session?
Yes. Although the desktop app keeps its own list, Anthropic says it can also resume a CLI session.
Q. Does Claude Code encrypt saved transcripts?
No. Transcripts and prompt history aren’t encrypted at rest, so operating system file permissions are the only protection. A credential that a command prints can land on disk.
Q. Can you run a coding agent without saving the session?
In some tools, yes. Claude Code skips transcript and prompt history writes when you set CLAUDE_CODE_SKIP_PROMPT_HISTORY. For one claude -p run, you can pass --no-session-persistence. In Codex, codex exec --ephemeral writes no rollout files.
Q. What does claude purge delete?
For one project, it removes transcripts, auto memory, related task, debug and file-history entries, matching prompt lines and the project’s config entry. Preview with --dry-run. Pasted images in the temp directory survive. Before v2.1.288, the command was claude project purge.
Q. Does removing a Claude Code background session erase its transcript?
No. Afterclaude rm <id>, the transcript stays on disk, and you claude --resume can still open it.
Related: 12 Best No-Code AI Agent Builders in 2026 (Compared by Features & Pricing)
| Disclaimer: This article is based on official documentation, published research, and publicly available information, not hands-on testing of every tool. Features, commands, pricing, and session-storage behavior may change over time. |



