---
title: "Continue a Cursor session in OpenCode"
canonical: "https://agentdrive.sh/resume/cursor-to-opencode"
---
# Continue a Cursor session in OpenCode

> For the complete documentation index, see [llms.txt](https://agentdrive.sh/llms.txt). Every docs page is also served as markdown at its URL plus `.md`, and the full docs are in one file at [llms-full.txt](https://agentdrive.sh/llms-full.txt).

[Resume across agents](https://agentdrive.sh/resume)

To continue a Cursor session in OpenCode, install AgentDrive once with `curl -fsSL agentdrive.sh/install | sh`. After that, hooks in `~/.cursor/hooks.json` sync each Cursor agent session. Open OpenCode in the same project and run `/agentdrive-resume`. OpenCode loads a handoff brief with the goal, the files touched and the recent turns.

## Steps

1. ### Install AgentDrive

   Run `curl -fsSL agentdrive.sh/install | sh`. It signs you in and wires session sync and resume into every agent it finds on this machine, Cursor and OpenCode included. Reload Cursor after setup (Developer: Reload Window) so it picks up the hooks and the MCP server.

   ```
   curl -fsSL agentdrive.sh/install | sh
   ```

2. ### Work in Cursor as usual

   Hooks in `~/.cursor/hooks.json` fire on `sessionStart`, `stop`, `sessionEnd` and `preCompact`, and hand the session to a background sync. The sync uploads the redacted transcript, plus files the agent wrote that git doesn't track, to `sessions/<project>/cursor/<session>.md` in your workspace. Before you switch, leave a clear goal and next step in the session; the brief carries them over.

3. ### Resume in OpenCode

   Open OpenCode in the same project and run `/agentdrive-resume`. It calls `drive_resume`, which loads the latest session in this project from a different agent. If you run several agents, ask for the session from Cursor by name, or list sessions with `/agentdrive-sessions` and pass an id.

   ```
   /agentdrive-resume
   ```

4. ### Check the files before continuing

   Ask OpenCode to check the files on disk before it continues: the brief says what happened, the repo says what is true now.

From a shell, `adrive resume --list` lists this project's sessions and `adrive resume <id>` prints the brief for one.

## Before you switch from Cursor to OpenCode

- Cursor transcripts don't record the project directory, so the AgentDrive hook records it while the session runs. A Cursor session that ended before the hook was installed has no recorded directory: it is filed under an unknown project and can't be matched to this one.
- Ending the session in Cursor triggers a sync right away. Turn-end events re-sync at most every two minutes, so end or compact the session if you switch mid-task.
- OpenCode's plugin API can't add context at session start, so OpenCode won't mention the Cursor session on its own. Run `/agentdrive-sessions` to see it.

## What carries over

- The goal, the files touched and the most recent turns, as a compact brief (12,000 characters by default).
- Files the Cursor agent wrote that git doesn't track, such as plans and notes.
- The full redacted transcript, which stays in your workspace and is searchable later.
- Sessions encrypted with Private Workspace resume with `adrive resume <id>` on a machine that holds your key.

## Frequently asked questions

### How do I pick a specific Cursor session in OpenCode?

List sessions with `/agentdrive-sessions`. It calls `drive_sessions`, which takes a platform filter, so asking for `cursor` sessions shows only Cursor's. Then resume with the session id.

### Do Cursor and OpenCode need to be on the same machine?

No. Signed-in sessions sync to your workspace, so OpenCode can resume a Cursor session from another machine with the same AgentDrive account. With a git remote, the project is keyed by the normalized remote, so any clone of the repo matches. Without an account, `adrive resume` reads only this machine's local transcripts.

### Why can't OpenCode find an older Cursor session?

Cursor transcripts don't store the project directory, and the AgentDrive hook records it only for sessions that ran after setup. Older Cursor sessions sync under an unknown project, so a resume from this project can't match them.

### Can I hand the work back from OpenCode to Cursor?

Yes. Sync runs in both directions: OpenCode sessions sync too, and in Cursor you run `/agentdrive-resume` to load the latest session from another agent.

## Related guides

- [Continue an OpenCode session in Cursor](https://agentdrive.sh/resume/opencode-to-cursor), the same handoff in reverse
- [AgentDrive for Cursor](https://agentdrive.sh/integrations/cursor) and [AgentDrive for OpenCode](https://agentdrive.sh/integrations/opencode): setup details for each agent
- [Quick start](https://agentdrive.sh/docs/quick-start): install, sign in and run your first handoff

### Other handoffs

- [Continue a Claude Code session in OpenCode](https://agentdrive.sh/resume/claude-code-to-opencode)
- [Continue a Codex session in OpenCode](https://agentdrive.sh/resume/codex-to-opencode)
- [Continue a Cursor session in Claude Code](https://agentdrive.sh/resume/cursor-to-claude-code)
- [Continue a Cursor session in Codex](https://agentdrive.sh/resume/cursor-to-codex)
- [Continue a Cursor session in Antigravity](https://agentdrive.sh/resume/cursor-to-antigravity)
- [Continue an Antigravity session in OpenCode](https://agentdrive.sh/resume/antigravity-to-opencode)
