anthropics / anthropics/claude-code
[FEATURE] Feature request: easy way to move a session from Cloud to Local (Local→Cloud nice-to-have)
- Dominant language
- Python
- Stars
- 145k
- Forks
- 23.1k
- PR merge metrics
- PR metrics pending
Description
### Preflight Checklist
- [x] I have searched [existing requests](https://github.com/anthropics/claude-code/issues?q=is%3Aissue%20label%3Aenhancement) and this feature hasn't been requested yet
- [x] This is a single feature request (not multiple features)
### Problem Statement
Problem
When working in a Claude Code Cloud/remote session (claude.ai/code, or a remote environment), there's no direct way to continue that same session locally. Today, moving to local requires:
Manually git fetch/checkout-ing whatever branch the cloud session pushed, in a local clone.
Starting a brand-new local claude session with no memory of the cloud session's conversation, decisions, or context — the user has to manually recap what happened.
Remote Control lets a local CLI attach to a running cloud session, but execution still happens in the remote container — it doesn't actually relocate the session to run locally.
Request
A supported way to convert/hand off a Cloud session to a Local one:
Carries over the conversation/context (or at least an exportable summary) so a local session can resume with full understanding of what was done and why, not just the resulting code.
Handles the git branch handoff automatically (checkout/create the right branch in the target local clone) rather than requiring manual git fetch/checkout.
Nice to have
The reverse direction — Local → Cloud — would also be useful for the same reason (e.g. starting locally, then wanting to hand off to a cloud session for long-running/background work), if not already possible today.
Why it matters
Right now switching between Cloud and Local means re-establishing context by hand every time, which is slow and error-prone for anything beyond trivial changes, and undermines the value of having done meaningful investigation/discussion in the prior session.
### Proposed Solution
Ideal UX: Cloud → Local
In a Cloud/remote session, I type /handoff local (or click a "Continue Locally" button in the claude.ai/code UI).
Claude Code checks: is there a local clone of this repo on a machine I've used before (it already knows this from prior local sessions tied to my account)? If yes, it offers a pick-list ("continue on: MacBook-Pro ~/code/covu-os"); if no, it prints the exact git fetch/checkout command for the current branch, pre-filled — no guessing which branch or remote.
It gives me a one-time handoff token (short-lived, like a pairing code) — I run claude --resume locally (or it's auto-detected if Remote Control is already linked on that machine).
My local session opens with:
The branch already checked out (it ran the fetch/checkout for me, or told me to).
A condensed context brief injected as the first message — not the full raw transcript, but the equivalent of what I'd write in a handoff Slack message: what's been done, key decisions made and why, open threads (e.g. "PR [#3565](https://github.com/covu-inc/covu-os/pull/3565) is up, CI green, waiting on review; adversarial review already run twice, findings fixed"), and any state that matters (pending background tasks, scheduled check-ins).
The option to pull the full transcript on demand ("show me exactly what happened before this point") rather than it being force-fed into context by default.
The cloud session either auto-archives (since work continues locally) or stays live read-only, with a banner: "Continued locally on MacBook-Pro at 2:14pm — [view local session]" — so if I switch back later, I'm not confused about which one is current.
Any in-flight background work the cloud session started (a scheduled PR check-in, a Routine) transfers ownership to the local session automatically, or at minimum gets flagged so it doesn't silently die when the cloud session archives.
Local → Cloud (nice-to-have): same flow in reverse — /handoff cloud, pushes whatever's uncommitted-but-safe-to-share (or just current HEAD if already committed), spins up a cloud session on that branch with the same condensed-brief injection, and hands me a link.
What I don't want: a full raw JSONL transcript dumped into the new session's context (token waste, and mixes signal with noise like every intermediate tool call) — the condensed brief should be the default, full transcript available but opt-in.
### Alternative Solutions
_No response_
### Priority
Medium - Would be very helpful
### Feature Category
Developer tools/SDK
### Use Case Example
Scenario: Debugging an infrastructure issue mid-session
I'm working in a Claude Code Cloud session on a repo, mid-way through a feature — several commits pushed, a PR open, CI green. Then I hit a real infrastructure issue that needs investigation against a live cloud account (e.g. a permissions error on a deployed resource).
I ask Claude to look into it.
Claude has no credentials for that cloud account in the remote sandbox — it can search the repo's IaC for related config, but can't actually query the live resource or see the real error.
This is exactly where I'd want to hand off: I have the right credentials configured locally, via SSO or a local profile. Today, my only option is to open a totally fresh local claude session and manually re-explain the whole feature, what I've already tried, and what I suspect the issue is.
With the feature: I type /handoff local. My local machine (already linked from a prior session) gets a resume token. I run claude --resume in my already-checked-out local clone.
The local session opens already knowing what I was building, what state the PR is in, and what I'd already ruled out — I don't need to re-paste any of that.
It also now has my real local credentials, so it can immediately query the live resource, see the actual error, cross-reference it against the IaC it already knows about from the handed-off context, and pinpoint the fix in one pass instead of several rounds of re-explaining the codebase.
Fix gets made locally (where I can also run deploy tooling against the real account), and if I want to hand it back to PR-driving duty in the cloud afterward, /handoff cloud sends it back.
The core waste this eliminates: today, hitting "I need real credentials/local tooling mid-task" means either abandoning the cloud session's context entirely, or manually relaying CLI output back and forth — both slow compared to the session just continuing where it left off, with the right execution environment.
### Additional Context
_No response_
Contributor guide
No contributing guide indexed for this repository
Research direction
No implementation files or tests are named. Start by tracing the existing Remote Control flow and the `claude --resume` entry point, then determine how Cloud/Local session context, branches, and in-flight work are represented; done would be an agreed, tested handoff flow in both directions.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- git, python
- Domain
- cli, cloud, developer-experience, devtools
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Active
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100