Skip to content

Adopt a populated machine

Goal: you’ve been using Claude and OpenCode for a while, each hand-configured. Bring it all under agentsync without retyping — and without losing anything.

  1. Initialize (if you haven’t) and register your agents:

    Terminal window
    agentsync init
    agentsync agent add claude
    agentsync agent add opencode
  2. Survey what’s on disk versus what agentsync would write:

    Terminal window
    agentsync status
  3. Import each agent’s existing config into your canonical source. Preview first:

    Terminal window
    agentsync import claude --dry-run
    agentsync import claude
    agentsync import opencode

    Imported secrets are re-referenced to ${secret:…} form on the way in, so nothing sensitive lands in your source as cleartext.

  4. Review the imported source files in ~/.agentsync/ and tidy as needed — they’re plain TOML and markdown.

  5. Apply. The first apply treats any remaining pre-existing native files as a foreign-collision: it backs each up to ~/.agentsync/.state/backups/<timestamp>/ before writing.

    Terminal window
    agentsync apply --dry-run # see exactly which files get backed up
    agentsync apply
flowchart LR
    NATIVE["existing native config<br/>~/.claude.json, opencode.json"]
    NATIVE -->|import| SRC["~/.agentsync/<br/>(canonical source)"]
    SRC -->|apply| ALL["all enabled agents<br/>(fanned out)"]

Import pulls each agent’s config in to one canonical source; apply pushes that source back out to every agent — so a server you only had in Claude now also lands in OpenCode.