Skip to main content

scratch-sync

Sync private scratch/ folders across multiple machines using Syncthing over Tailscale.

The Problem

Working across multiple machines (Linux workstation, Mac laptop, Windows desktop) with code repositories in different locations:

Machine Example Repo Paths
Linux ~/code/sleap-io, ~/repo1
Mac ~/sleap-io, ~/code/my-repo
Windows D:\sleap-io, C:\Users\me\code\repo1

Each repo has a scratch/ subfolder that's .gitignored — notes, experiments, temp files, WIP that shouldn't be in version control but should sync privately across machines.

Solution

  • Sync scratch/ folders without git
  • Single CLI command to add folders to sync
  • Works across Linux, macOS, and Windows
  • Uses Tailscale for secure direct connections (no cloud relay)
  • Minimal ongoing maintenance

Quick Start

Prerequisites

  • Tailscale installed and connected on all machines
  • All machines on the same Tailnet

Install

macOS / Linux:

curl -LsSf https://scratch.tlab.sh/install.sh | sh

Windows (PowerShell):

iwr -useb https://scratch.tlab.sh/install.ps1 | iex

The installer will download Syncthing, set up auto-start, and show you the status of all dependencies:

Dependencies

  uv           installed 0.9.18     ~/.local/bin/uv
  tailscale    running   1.92.3     your-tailnet.org / you@example.com
  syncthing    running   v2.0.12    ~/.local/bin/syncthing / autostart: launchd

After installation, remember to set up a password for the Syncthing dashboard at http://127.0.0.1:8384/.

Uninstall (macOS / Linux):

curl -LsSf https://scratch.tlab.sh/install.sh | sh -s -- --uninstall

Uninstall (Windows):

$env:UNINSTALL=1; iwr -useb https://scratch.tlab.sh/install.ps1 | iex

Check dependency status:

curl -LsSf https://scratch.tlab.sh/install.sh | sh -s -- --status

Install the CLI

The scratch-sync CLI helps you manage synced folders. Choose your preferred installation method:

Permanent install (recommended):

uv tool install scratch-sync

This installs scratch-sync globally so you can run it from anywhere.

Run without installing:

uvx scratch-sync --help

If you prefer not to install permanently, use uvx to run the latest version on-demand.

Update to latest version:

uv tool upgrade scratch-sync

Uninstall:

uv tool uninstall scratch-sync

Usage

# Inside a git repo with a scratch/ folder
scratch-sync init

# Add a specific scratch folder
scratch-sync add ~/code/myrepo/scratch

How It Works

Syncthing folder IDs just need to match across devices. The actual filesystem paths can be different:

  • scratch-sleap-io on Linux at ~/code/sleap-io/scratch
  • Same folder ID on Windows at D:\sleap-io\scratch
┌─────────────────┐     Tailscale      ┌─────────────────┐
│  Linux Box      │◄──────────────────►│  Mac Laptop     │
│ ~/code/sleap-io │                    │ ~/sleap-io      │
│   └── scratch/  │   folder-id:       │   └── scratch/  │
│                 │  "scratch-sleap-io"│                 │
└────────┬────────┘                    └────────┬────────┘
         │            Tailscale                 │
         └──────────────┬───────────────────────┘
                        ▼
              ┌─────────────────┐
              │  Windows PC     │
              │ D:\sleap-io     │
              │   └── scratch/  │
              └─────────────────┘

Documentation

Full documentation at scratch.tlab.sh.

Development

Setup

Clone the repository and install dependencies:

git clone https://github.com/talmolab/scratch-sync.git
cd scratch-sync
uv sync

This creates a virtual environment and installs all dependencies.

Running in development

Run the CLI directly from source:

uv run scratch-sync --help

Install from GitHub

Install the latest development version from the main branch:

uv tool install git+https://github.com/talmolab/scratch-sync.git

Or run without installing:

uvx --from git+https://github.com/talmolab/scratch-sync.git scratch-sync --help

Local editable install

For development, install as an editable tool from your local checkout:

uv tool install --editable .

This installs scratch-sync globally but uses your local source files, so changes take effect immediately.

To uninstall and reinstall after making changes to entry points:

uv tool uninstall scratch-sync
uv tool install --editable .

License

MIT

Metadata

Release files for scratch-sync 0.2.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for scratch-sync 0.2.1
File Size Uploaded
scratch_sync-0.2.1.tar.gz 15.6 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for scratch-sync 0.2.1
File Interpreter ABI Platform
scratch_sync-0.2.1-py3-none-any.whl Python 3 none any Details

Total release size: 34.1 kB

Release files / scratch_sync-0.2.1.tar.gz

Download URL scratch_sync-0.2.1.tar.gz
Size 15.6 kB
Tags Source
SHA-256 checksum
How to use checksums
8ceb883c78016c07a278b9c514668fb47ca34719070274c0dfe3e9682e2b6218
BLAKE2b-256 checksum
How to use checksums
6b1be62b59178a5ab4286f8c93a17edae283e930e0552e56ac29c97c07cafbc4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jan 3, 2026.

Transparency log

Release files / scratch_sync-0.2.1-py3-none-any.whl

Download URL scratch_sync-0.2.1-py3-none-any.whl
Size 18.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
3270152bdc634d2db6f2c312854e643d3883fa1d308668c06b2ef6346a8297ce
BLAKE2b-256 checksum
How to use checksums
1ca22e2675f224a8d4973e5849aa892b6bf19fef277fe6d9e5284d6bc10af8ed
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jan 3, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.2.1 This release

2 release files

0.2.0

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page