Rules Relay
Rules Relay keeps your Claude Code rules in step between your computers, through a folder in your
own Google Drive. You pick which files are synced: your user-level CLAUDE.md, and any Markdown
files under ~/.claude/rules/. Write a rule once, sync, and every machine you use Claude Code on
has it.
Rules Relay is an independent project. It is not made by, affiliated with, or endorsed by Anthropic
or Google.
Getting started
- Install Rules Relay and click its icon in the activity bar.
- Click Sign In to Google Drive. Your browser opens Google's sign-in page, where you choose
your account and allow access to the files Rules Relay creates.
- Pick what to sync. Sync My CLAUDE.md sends your user-level
CLAUDE.md, and Add Files to
Sync... lists every rule file that is not synced yet.
- On your other computers, install Rules Relay, sign in with the same Google account, and click
Sync. Everything in the Drive folder comes down.
Rules Relay only ever looks at CLAUDE.md and rules/**/*.md inside the Claude config directory
(~/.claude, or CLAUDE_CONFIG_DIR when that is set). Settings, project transcripts, skills, and
everything else there are invisible to it. Files are synced in place, at their own paths, so
however you organise rules/ is how it arrives on your other computers. In your Drive, the files
live in a top-level folder named Rules Relay that mirrors the same paths. There is no separate
list of synced files anywhere: the file at its path is the only copy on a computer, and the Drive
folder is the only record of what is shared.
What is synced
A file is synced on a computer when it is in the Drive folder and you have not excluded it there.
Nothing is uploaded until you ask:
- Add to Sync (the
+ on a file in the Not Synced section, or Add Files to Sync... for
several) uploads the file now. From then on it is synced everywhere.
- Don't Sync on This Computer keeps a file out of the sync on the computer where you choose
it. The list is in the
rulesRelay.ignoredPaths setting, which is machine-scoped, so VS Code
Settings Sync never copies it to another computer. Sync on This Computer Again reverses it.
- Stop Syncing Everywhere moves the Drive copy to the Drive trash and leaves every computer's
copy where it is. The file then shows under Not Synced on each of them.
- Delete Everywhere moves the Drive copy to the Drive trash and each computer's copy to that
computer's recycle bin or trash, on its next sync.
Keep anything machine-specific, such as absolute paths, in a file you never add, for example
rules/local.md.
Synced Rules lists each synced file with what the next sync would do: in sync, changed here,
changed in Drive, new on either side, changed on both sides, or waiting for a decision. Click a
file to open it. Not Synced lists the rule files on this computer that are not in Drive, plus
the ones you excluded here. Click the + on a file to add it.
Some rows need you to choose, and clicking them opens the choices:
- Exists in both places. A file is in Drive and on this computer with different contents, and
the two have never been synced. This is what you see on a second computer that already has its
own
CLAUDE.md. Choose Keep mine (upload; Drive's version is saved beside the file as a
conflict copy), Use Drive's (download; your version is saved as a conflict copy), Compare
first, or Don't sync on this computer.
- Deleted here. A synced file disappeared from this computer. Rules Relay never treats that as
a request to delete it elsewhere. Choose Delete everywhere, Restore from Drive, or
Don't sync on this computer.
- Deleted everywhere but edited here. Another computer deleted the file everywhere, but you
changed it since the last sync. Choose Keep mine (upload it again), Delete here too, or
Don't sync on this computer.
Title bar buttons: Sync, Pull, Push, and Refresh on Synced Rules; Add Files to Sync and
Refresh on Not Synced. The ... menu holds Open Rules Folder, Open Folder in Google Drive, Show
Log, Open Setup Guide, and Sign Out.
Conflict copies appear under the file they belong to. Click one to compare it side by side
with the current file. When you have merged what you need, use its check button to delete it.
The status bar shows the same state at a glance: a check when everything is in sync, an upload
icon with a count when files are waiting, a warning when something needs a decision, and a spinner
while syncing. Clicking it opens the view. Local edits update the view straight away, while Google
Drive is re-read on Refresh and after every sync.
Sign-in, Sync, Pull, Push, Refresh, Add Files to Sync, Sync My CLAUDE.md, and the folder and log
commands are also in the Command Palette (Ctrl+Shift+P) under Rules Relay. Actions on a single
file are in that file's row. Every file action is logged in the Rules Relay output channel.
How syncing decides what to do
Each computer remembers what every file looked like the last time both sides agreed. That lets it
tell which side changed a file, so an edit made on another computer is not overwritten by an older
local copy.
- Push sends files you changed locally. It leaves changes made in Drive alone and tells you it
skipped them.
- Pull is the reverse: it takes changes made in Drive and leaves your local changes alone.
- Sync does both. This is the one to use day to day.
- Both sides edited the same file: the command's own side wins (local for Push and Sync, Drive
for Pull). The other version is saved next to the file as
name.md.drive-conflict-<time> or
name.md.local-conflict-<time>. Those names do not end in .md, so Claude Code does not load
them as rules, and they are never synced.
- Deletions never happen on their own. A file missing from this computer asks what to do. A
file missing from Drive is treated as stopped, and your copy stays, unless another computer
chose Delete Everywhere, which leaves a small marker in
Rules Relay/.relay/deleted/ so the
deletion is carried out on every computer.
- Deletions are recoverable. Local files go to the Recycle Bin or Trash, and Drive files go to
the Drive trash.
Subfolders of rules/ are synced too. Google Docs files and shortcuts in the Drive folder are
ignored, because they have no plain file contents to download.
Upgrading from 0.4
The first run of 0.5 on each computer moves your existing vs_code_synced Drive folder into
Rules Relay/rules/ (the first computer does the move, the others find it done) and carries that
computer's sync history over, so nothing is re-uploaded or asked about. Nothing moves on your
computer: the files stay in ~/.claude/rules/vs_code_synced/, which is now an ordinary folder
with no special meaning. If you would rather have them elsewhere under rules/, move them, add
the new paths, and answer the "deleted here" prompts for the old ones with Delete everywhere.
Install 0.5 on every computer. A computer still on 0.4 will create a new, empty vs_code_synced
folder at the top of your Drive and upload into it; once that computer is updated, Rules Relay
points out the leftover folder and offers to move it to the trash. If two computers run 0.5 for
the first time at the same moment, each may create a Rules Relay folder; the extension uses the
older one and logs it, and the empty newer one can be deleted by hand.
If you had changed the rulesRelay.localFolder setting in 0.4 to sync some other folder, 0.5
leaves your old Drive folder where it is, because its files cannot be mapped onto rules/ without
guessing. Add the files you want synced from the Not Synced section, then delete the old
vs_code_synced folder in Drive yourself.
Privacy and what Rules Relay can see
Rules Relay asks Google for one permission: access to the files it creates (drive.file). It
cannot see anything else in your Drive. The email address it shows, so you know which account is
signed in, is reported by the Drive API under that same permission; no identity permission is
requested.
Rules Relay has no servers. Your sign-in stays in your operating system's credential store, and
your files travel only between your computer and your own Google Drive. Sign Out forgets the
sign-in on the computer and keeps the sync history (file paths and checksums, never contents), so
signing in again later resumes where you left off.
The same prompt offers Sign Out and Revoke Access, which withdraws Rules Relay's access in
your Google account and deletes everything it stored on the computer, apart from the ignore list
in your VS Code settings. Use it before uninstalling if you want nothing left behind, because VS
Code keeps an uninstalled extension's stored state. Use it with care otherwise: Google ties an
app's access to the files it created to that authorization, so once it is withdrawn the Rules
Relay folder is hidden from the extension for good, on every computer. The files stay in your
Drive, but the next sign-in starts a new, empty folder. The privacy policy has the
details.
Because Google limits Rules Relay to the files it created, a file you upload into the Drive folder
through the Drive website stays invisible to it. Add new rules from the sidebar instead.
Does Claude Code load the synced rules?
Yes. Claude Code's documentation only promises recursive loading for project rules in
.claude/rules/, so this was checked by hand on Claude Code 2.1.274. Marker files were placed in
three spots, and a fresh session reported which markers it could see:
| File |
Loaded |
~/.claude/rules/canary_top.md |
yes |
~/.claude/rules/vs_code_synced/canary_sub.md |
yes |
~/.claude/rules/vs_code_synced/canary_sub.md.drive-conflict-20260927T120000 |
no |
So files anywhere under ~/.claude/rules/ load as user-level rules, ~/.claude/CLAUDE.md is the
user-level memory file Claude Code documents, and conflict copies stay out of context. If a later
Claude Code release changes this, run /memory to see which files it loaded.
Settings
| Setting |
Default |
Meaning |
rulesRelay.claudeDir |
empty |
The Claude config directory. Empty means CLAUDE_CONFIG_DIR if set, otherwise ~/.claude. ~ is expanded. |
rulesRelay.ignoredPaths |
[] |
Files not synced on this computer, as paths relative to the config directory. Machine-scoped, so never copied by Settings Sync. |
rulesRelay.syncOnStartup |
false |
Sync when VS Code starts. Only conflicts and errors are reported. |
rulesRelay.showStatusBar |
true |
Show the sync status in the status bar. |
rulesRelay.oauthClientId |
empty |
Only for builds from source; see below. |
rulesRelay.localFolder and rulesRelay.driveFolderName from earlier versions are ignored.
Building from source
npm install
npm test # compiles, then runs the sync-engine tests under Node
npm run package # produces rules-relay-<version>.vsix
Google requires every app that uses the Drive API to have its own OAuth client, and the client
used by the published extension is not in this repository. A build from source therefore needs a
client of your own:
- In the Google Cloud console, create a project and enable
the Google Drive API.
- Under Google Auth Platform, set up the consent screen with an External audience, then
Publish app. While an app is in Testing status, Google expires its sign-ins after seven
days.
- Create an OAuth client of type Desktop app and select Download JSON.
- Either save that file as
oauth-client.json in the project root before packaging, so the build
carries it, or leave it out and paste the client ID and secret when Sign In asks for them.
oauth-client.json is in .gitignore. A client ID set in rulesRelay.oauthClientId overrides a
bundled client, and its secret is kept in VS Code's secret storage.