Skip to content

Feature Request: Cross-environment session resume (local ↔ Codespace) #1635

Closed

Description

@maxbeizer

Problem

There's no supported way to resume a Copilot CLI session across environments. A common workflow is starting work locally, then needing to continue in a Codespace (or vice versa). Today, --resume only works for sessions created in the same environment.

Current behavior

I manually copied a session directory (~/.copilot/session-state/<uuid>/) from my local machine to a Codespace and ran copilot --resume <uuid>. The CLI found the session directory but overwrote events.jsonl with a fresh session start event, destroying the transferred conversation history. The session had no prior context.

Desired behavior

A first-class way to continue a session in a different environment. This could take many forms — some options:

  1. Make --resume work with transferred session directories — restore conversation history from the existing events.jsonl rather than overwriting it
  2. Cloud-backed sessions — sessions stored server-side so --resume <id> works from any authenticated environment
  3. Import from /share output — /share gist already exports sessions; a /import <gist-url> or copilot --resume-from <gist-url> could restore context from that export

Security considerations

Cross-environment session transfer raises real security questions that should inform the design:

  • Session data is sensitive. events.jsonl contains the full conversation history — source code, command output, file contents, and potentially secrets or credentials that appeared in the session. Any transfer mechanism needs to treat this data carefully.
  • Authentication boundary. Sessions reference tools, MCP servers, and permissions that may differ between environments. A resumed session shouldn't inherit elevated permissions from the source environment.
  • Shared environments. If sessions can be transferred to Codespaces, there's a risk of session data landing in shared or org-wide Codespaces where others have access. The mechanism should warn or prevent transfer to untrusted environments.
  • Gist-based transfer. If /share gist output becomes importable, secret gists are still accessible to anyone with the URL. Importing from gists should be opt-in and warn about the sensitivity of the data.
  • Replay safety. Replaying events.jsonl in a new environment could re-execute tool calls (bash commands, file writes) that made sense in the original environment but are dangerous in the new one. Resume should restore context, not replay actions.

Workaround

Today I use /share gist to export the session, then manually paste a summarized handoff prompt into a new session in the target environment. This works but loses the structured session state (plan, todos, session DB, file tracking).

Environment

  • Copilot CLI v0.0.415
  • macOS → GitHub Codespace transfer

Activity

  1. added
    area:toolsBuilt-in tools: file editing, shell, search, LSP, git, and tool call behavior
    on Apr 6, 2026
  2. added
    area:sessionsSession management, resume, history, session picker, and session state
    on Apr 6, 2026
  3. patniko commented on Oct 26, 2026

    @patniko
    Collaborator

    Thanks for the detailed proposal, including the security considerations. The cloud-backed option is now available: Copilot CLI can sync sessions to GitHub.com for cross-device use (you opt in through the session sync prompt), synced sessions can be resumed from another environment with --resume (including by name), and remote sessions can be reached with --connect; as of v1.0.92 both use your configured GitHub auth. v1.0.85 also added copilot sessions import for importing a session from a semantic JSONL transcript. If you specifically need --resume to work with a manually copied session directory, please open a new issue so we can track that separately.

    Triaged as part of a Copilot SDK backlog review, with help from GitHub Copilot.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:sessionsSession management, resume, history, session picker, and session statearea:toolsBuilt-in tools: file editing, shell, search, LSP, git, and tool call behavior

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions