Skip to content

Latest commit

 

History

2 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 

Repository files navigation

opencode-session-transfer

An OpenCode skill for migrating session history between machines (or between separate data directories) using the official opencode export / opencode import CLI.

Compatibility: OpenCode agents that support the standard skill format (~/.config/opencode/skills/<name>/SKILL.md). Not tested with other agent runtimes.

Version: 1.0.0

Why

OpenCode stores sessions in a per-machine SQLite database and keys projects by git remote identity. When you work on the same repo from a second machine — or reach it through a mapped drive / different path — your session history does not follow you. There is no built-in bulk migration; the official building blocks are opencode export, opencode import, and the TUI /move-session command.

This skill turns those blocks into a safe, repeatable workflow:

  1. Identify source sessions (opencode session list or read-only SQLite query)
  2. Export them as JSON into a transfer directory both machines can reach
  3. Import on the target machine (idempotent — same ID updates, no duplicates)
  4. Verify, and re-home sessions with /move-session if their recorded directory still points at the source machine

Install

Clone the repository and copy SKILL.md into your OpenCode skills directory:

git clone https://github.com/sterraMind/opencode-session-transfer.git
cd opencode-session-transfer
mkdir -p ~/.config/opencode/skills/opencode-session-transfer
cp SKILL.md ~/.config/opencode/skills/opencode-session-transfer/SKILL.md

Use

Ask your agent things like:

  • "Migrate my opencode sessions to another machine"
  • "Export my sessions for project X and import them on machine B"
  • "Why does this project show empty history on my other computer?"

Safety notes

  • Never hand-edit opencode.db as a migration strategy.
  • Avoid two opencode instances writing the same DB file concurrently (SQLite locking over network shares is unreliable).
  • /share links are public — do not use them to move private sessions.
  • Exported JSON contains full conversation content; delete transfer files after import.

License

MIT

About

OpenCode skill: migrate session history between machines via the official export/import CLI

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors