Skip to content

York Sync

What gets merged, what gets rejected, and how to recover. SQLite, text files and folders use different sync rules.

SQLite: writes stay local, changes travel

Each copy is an ordinary SQLite file in WAL mode. The daemon notices writes within half a second and pushes bounded bursts with shared request pacing. It durably receives remote changes while local writes queue. Conflicting rows wait for acknowledgement; unrelated rows and columns keep updating.

When copies disagree
SituationResult
Offline writesQueue in the file, then push on reconnect. Status never says synced with unsent changes.
Same column edited twiceLast change to reach the server wins; the other writer gets a note. Different columns in one row both apply.
Rejected writeUndone locally and noted: CHECK, NOT NULL, UNIQUE, foreign-key failures, an update to a deleted row, read-only access or the storage limit.
Duplicate integer primary keyThe later row gets a new key; declared foreign-key references follow. York records a note.
Unwanted update or deleteRestore through the file's Backups tab. Every copy resets with a restored note.
Schema migrationEvery copy resets with a migration note. Direct schema edits cause drift and stop that copy syncing until york sync reset.

Check or recover a copy

york sync status       # daemon, file states and unsent changes
york sync reset notes  # saves notes.db.york-drift, replaces from shared copy

Text files: saves become text patches

  • Every copy applies the same patches in the same order. The local file holds the merged text.
  • Patches use surrounding text to find their place. If someone removed that context, the unplaced edit appears in york sync status; it is never dropped silently.
  • An older copy’s save does not erase edits merged since. Known exception: a line removed within 10 minutes of being merged, together with another edit, comes back.
  • Merges never stop for a conflict, which suits notes, docs, config and data. Use git for source code, where a conflict should stop the merge.
  • Files must be UTF-8 and free of NUL bytes. Up to 4 MiB they merge; from there to 32 MiB each save replaces the whole file, as with a document. Connecting refuses an existing path.
  • Office documents and PDFs can’t be merged. Each save replaces the whole file. If two saves cross, the later one wins and every copy keeps the other beside the file as name (conflict date).ext, with a note in york sync status. Conflict copies are not synced.

Folders

york link skills syncs a folder. On another machine, york connect skills downloads it to ./skills; york connect skills <dir> chooses a new or empty directory. Read, edit, create, move and delete files with your usual tools.

York merges other people's changes into this folder. Re-read files before editing them, and prefer edit tools over rewriting whole files.

  • Any extension, at most 32 MiB per file (SQLite databases follow the plan's storage limit instead) and 1,000 files per folder. Text files up to 4 MiB merge; files first seen larger, and binary files such as images, PDFs and Office documents, are replaced whole, and if two saves cross, the other version is kept as a conflict copy. Subfolders sync; empty directories do not. Over 1,000 files blocks syncing.
  • Skipped: .git, node_modules, .DS_Store, .venv, __pycache__, target, *.swp, *~, .#*, York temp files (.*.york-*.tmp) and symlinks. Agent runtime databases are skipped too: state.db, sessions.db, openclaw-agent.sqlite, .openclaw/memory/*.sqlite, Codex state_N.sqlite and logs_N.sqlite, and SQLite -wal, -shm and -journal files. So are agent session logs: *.jsonl under .claude/projects, .codex/sessions and .codex/archived_sessions. Other SQLite databases sync as their own linked files inside the folder.
  • A text file York already syncs that grows past 4 MiB, or any other file over 32 MiB that isn't a SQLite database, is skipped: left alone, never treated as deleted. Check york sync status for skipped files and merge notes.
  • If a large deletion is blocked, york sync reset skills accepts those deletes on the next tick.

Schema rules

Supported SQLite schema
FeatureRule
Primary keysRequired on every table, with non-null row values and BINARY collation. Integer keys may be renumbered; use TEXT or a separate UNIQUE column for meaningful numbers such as barcodes.
Foreign keysOnly NO ACTION and RESTRICT actions. No deferred foreign keys.
Unsupported objectsUser triggers and virtual tables, including FTS.
Reserved namesColumns named with __, _york, _cf_ or sqlite_ are refused. Objects starting with _york belong to York.
BlobsValues over about 1 MiB cannot sync.