Skip to content

Named Sessions and Remote Access

Name your sessions, resume them later, continue from another device. Remote control turns Claude into a persistent assistant across machines.

You close your terminal. Maybe you shut down your laptop entirely. Tomorrow you come back, fire up Claude Code, and realize you lost all the context from that two-hour debugging session. Every file you pointed to, every decision you made, every correction you gave. Gone. Starting over from scratch.

Doesn't have to happen.

Sessions Are Like Branches

Think of sessions the way you think about git branches. Each conversation with Claude Code is its own session, tied to the directory you started it in. You can name them, resume them, fork them.

The simplest way to pick up where you left off:

claude --continue

Resumes the most recent conversation in your current directory. No thinking required.

But what if you have multiple sessions going? One for an OAuth migration, another for a memory leak you've been chasing. That's where --resume comes in:

claude --resume "oauth-migration"

Pass a session name or ID. If you don't remember the exact name, run --resume without a value and Claude Code shows you an interactive picker. Scroll through, pick one, you're back in context.

Naming and Renaming

Rename any active session with /rename:

/rename auth-refactor

Run /rename without a name and Claude Code auto-generates one based on the conversation so far. Handy when you forgot to name it at the start.

Good session names read like branch names. Descriptive, short, specific:

  • oauth-migration
  • debugging-memory-leak
  • cart-api-redesign

Forking Sessions

Want to try a different approach without blowing up your current session? /fork creates a copy at the current point:

/fork experimental-approach

You can also combine forking with --continue:

claude --continue --fork-session

This loads the most recent session's context but creates a fresh session ID. The original stays untouched. Perfect for "what if" experiments.

Remote Access and Cross-Device Workflows

This part is genuinely cool. You're debugging something on your desktop, dinner is ready, and you want to keep monitoring progress from your phone. Or you started a task on your laptop and want to pick it up on your workstation.

Setting Up Remote Control

Run this inside an active Claude Code session:

/remote-control

Or start it from the command line:

claude remote-control

You get a web interface that connects to your running Claude Code process. All execution stays on your local machine. Your code, your files, your environment. The web interface is just a window into it. The connection uses short-lived, narrowly scoped credentials, so you're not exposing your machine to the internet.

Try it

  1. Start a Claude Code session and give it a task that takes a while (large refactor, running tests)
  2. Run /remote-control
  3. Open the provided URL on your phone
  4. Watch the progress, send follow-up instructions, or approve tool uses from your phone

You now have a persistent assistant you can check on from anywhere.

Teleporting Web Sessions

Been using Claude Code through the web at claude.ai/code? Started some work there that you want to pull into your local terminal? /teleport does that. Resumes a web session in your local environment, bringing all the context with you.

PR-Linked Sessions

Resume sessions linked to a specific GitHub pull request:

claude --from-pr 123

Great for code review workflows. Start a session reviewing PR #123, close it, come back days later when the author pushes updates. All your previous review context is still there.

Habits That Pay Off

Name sessions immediately. The moment you start a focused workstream, run /rename. Future you will be grateful. Scrolling through a list of unnamed sessions trying to remember which one had the database migration work is not fun.

One session per workstream. Don't mix unrelated tasks in a single session. Working on auth and then switching to a CSS bug? New session. Keeps context focused.

Fork before experimenting. About to try something risky? Fork first. If the experiment fails, your original session is intact with all its context.

Clear wisely. Running /clear resets your input history in the current session, but the previous session is still preserved and resumable. Useful when you want a fresh start without losing the ability to go back.

In VS Code, use the session dropdown. There's a dropdown at the top of the Claude Code panel. Search sessions by keyword, browse by time, hover to rename or remove. The Remote tab shows web sessions from claude.ai.

Quick Reference

  • --continue resumes your last session. --resume "name" picks a specific one. --resume alone opens the picker.
  • Name sessions like branches. /rename early, keep names descriptive.
  • /fork lets you explore without risking your main context.
  • Remote control turns Claude Code into a persistent assistant you can check from anywhere. All execution stays local.
  • /teleport bridges web and terminal. Pull work from claude.ai/code into your local environment without losing context.

Mastering Claude Code

Lesson 20 of 70