codeagent-sync 0.1.0 → 0.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Samet Birer
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,188 @@
1
+ [![CI](https://github.com/sametbrr/codeagent-sync/actions/workflows/ci.yml/badge.svg)](https://github.com/sametbrr/codeagent-sync/actions/workflows/ci.yml)
2
+ [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](LICENSE)
3
+ [![Go](https://img.shields.io/badge/Go-1.24-00ADD8?logo=go&logoColor=white)](go.mod)
4
+
5
+ # codeagent-sync
6
+
7
+ Keeps Claude Code and Codex configuration — instructions, settings, skills, agents, hooks, MCP servers and plugin lists — the same on every machine, end-to-end encrypted.
8
+
9
+ > 🇹🇷 Türkçe için [README.tr.md](README.tr.md)
10
+
11
+ [Quick Start](#quick-start) • [Installation](#installation) • [Usage](#usage) • [What Is Synced](#what-is-synced) • [Troubleshooting](#troubleshooting) • [Security](#security)
12
+
13
+ ---
14
+
15
+ ## Quick Start
16
+
17
+ ```bash
18
+ npm install -g codeagent-sync # or: pnpm add -g codeagent-sync
19
+ codeagent-sync init # storage, passphrase, first sync
20
+ ```
21
+
22
+ On every other machine: `codeagent-sync join-code` on a machine that is set up, then `codeagent-sync init --join <code>` on the new one.
23
+
24
+ ---
25
+
26
+ ## Features
27
+
28
+ - **Both tools, one layout** — `~/.claude`, `~/.claude.json` (MCP servers only), `~/.codex` and the skills both tools read in `~/.agents/skills`
29
+ - **End-to-end encrypted** — every file is encrypted with [age](https://age-encryption.org) before it leaves the machine; the storage sees names and sizes only
30
+ - **Merges, not overwrites** — settings files merge item by item, so two machines changing different settings never conflict; comments in `config.toml` stay
31
+ - **Portable paths** — home-directory paths are translated, so machines with other user names or systems get their own
32
+ - **Shares between tools** — judges whether a skill or MCP server one tool has works in the other, and shares it when you agree
33
+ - **Automatic** — hooks sync in the background and tell the agent about conflicts and new things to share, once
34
+ - **Your choice of what syncs** — include and exclude rules for every machine or just one, down to a single setting
35
+ - **Machine inventory** — shows how the tools and MCP programs are installed elsewhere and what this machine lacks
36
+ - **Safe** — backups and `undo` for every change, conflicts set aside instead of overwritten, conditional writes against races
37
+ - **Storage** — Cloudflare R2, Amazon S3 and S3-compatible services, Google Cloud Storage, WebDAV
38
+
39
+ ---
40
+
41
+ ## Requirements
42
+
43
+ - macOS, Linux or Windows
44
+ - Claude Code and/or Codex (a tool that is not installed on a machine is left alone there)
45
+ - A bucket on Cloudflare R2, S3, GCS or a WebDAV server, with credentials that can read and write it
46
+ - Node.js 18 or later to install with npm or pnpm (or a release binary, or Go 1.24 or later to build from source)
47
+
48
+ ---
49
+
50
+ ## Installation
51
+
52
+ ```bash
53
+ npm install -g codeagent-sync
54
+ pnpm add -g codeagent-sync
55
+ ```
56
+
57
+ The package installs the program for your system at `~/.local/bin/codeagent-sync` (on Windows `%USERPROFILE%\.local\bin`), checked against the release's checksums. pnpm skips install scripts by default; the first run installs it then. Keep it at the same place on every machine: the hooks of automatic sync start it from there. `codeagent-sync update` replaces it with the latest release.
58
+
59
+ <details>
60
+ <summary><strong>Release binaries and building from source</strong></summary>
61
+
62
+ Binaries for macOS, Linux and Windows are on the [releases](https://github.com/sametbrr/codeagent-sync/releases) page: rename the one for your system to `codeagent-sync` and put it in `~/.local/bin`.
63
+
64
+ To build from source (Go 1.24 or later):
65
+
66
+ ```bash
67
+ git clone https://github.com/sametbrr/codeagent-sync && cd codeagent-sync
68
+ make install
69
+ ```
70
+
71
+ </details>
72
+
73
+ ---
74
+
75
+ ## Usage
76
+
77
+ ### Set up the first machine
78
+
79
+ ```bash
80
+ codeagent-sync init
81
+ ```
82
+
83
+ `init` asks for the storage and a passphrase, creates the bucket if the credentials allow it, lists what it will upload and asks before it does, then offers automatic sync. The passphrase cannot be recovered: keep it in your password manager. Instead of a passphrase you can use an age key file (`--key-file`).
84
+
85
+ ### Add another machine
86
+
87
+ ```bash
88
+ codeagent-sync join-code # on a machine that is set up
89
+ codeagent-sync init --join cas1-… # on the new machine, same passphrase
90
+ ```
91
+
92
+ The code carries the storage settings, encrypted with the bucket's passphrase. On a machine's first sync, files only it has are uploaded only when you confirm; files from the other machines are written with a backup.
93
+
94
+ ### Every day
95
+
96
+ ```bash
97
+ codeagent-sync sync # download others' changes, upload this machine's
98
+ codeagent-sync status # what a sync would do, changing nothing
99
+ codeagent-sync conflicts # versions set aside; settle with: conflicts resolve <path> --keep local|remote
100
+ codeagent-sync undo # take back a change; undo --list shows them all
101
+ ```
102
+
103
+ `pull` and `push` sync one direction only. `sync`, `status`, `scan`, `conflicts`, `doctor`, `paths`, `machines` and `auto status` print JSON with `--json`.
104
+
105
+ ### Sync automatically
106
+
107
+ ```bash
108
+ codeagent-sync auto enable
109
+ ```
110
+
111
+ Adds hooks to Claude Code and Codex: they sync in the background when a session starts and after every answer, and pass what you should hear about — a conflict, something new to share, a program another machine has — to the agent with your next message, once. The hooks are part of the synced settings, so they reach your other machines too. Codex runs new hooks only after you trust them: type `/hooks` in Codex once on each machine.
112
+
113
+ ### Choose what syncs
114
+
115
+ ```bash
116
+ codeagent-sync paths # what syncs, and the rules
117
+ codeagent-sync paths include claude/plans/** # sync more
118
+ codeagent-sync paths exclude claude/look-again/** # sync less
119
+ codeagent-sync paths exclude claude-state/.claude.json # not Claude Code's MCP servers
120
+ codeagent-sync paths exclude claude/settings.json#permissions --local
121
+ codeagent-sync paths reset claude/plans/** # drop a rule
122
+ ```
123
+
124
+ Rules are `<root>/<pattern>` (roots: `claude`, `codex`, `agents`, `claude-state`, `home`, `codeagent`). They live in `~/.codeagent-sync/sync.yaml`, which syncs so every machine follows them, and with `--local` in `sync.local.yaml`, for one machine. A path left out stops syncing but is deleted nowhere. After a `#`, an exclude names items of a settings file — `settings.json` keys, `config.toml` tables such as `mcp_servers.*`, `.claude.json` MCP servers — and each machine keeps its own version of them.
125
+
126
+ ### Share between Claude Code and Codex
127
+
128
+ ```bash
129
+ codeagent-sync scan # what only one tool has, and whether it works in the other
130
+ codeagent-sync share skill:foo # share it
131
+ codeagent-sync unshare foo --to claude # keep it with one tool again
132
+ codeagent-sync mark mcp:bar --codex-only # record a decision, change nothing
133
+ ```
134
+
135
+ Shared skills live in `~/.agents/skills`, which Codex reads; Claude Code reaches each one through a link in `~/.claude/skills`. `scan` names the file and line of every reason: a skill using a Claude Code variable or tool stays with Claude Code; an MCP server is converted between the tools' formats where it can be. `--deep` asks the other tool's CLI for a second opinion, with no tools and no file access. Decisions live in `~/.codeagent-sync/registry.yaml`, which syncs, so a question answered on one machine is not asked again on another.
136
+
137
+ ### Set up a machine like another
138
+
139
+ ```bash
140
+ codeagent-sync machines
141
+ ```
142
+
143
+ Shows how Claude Code, Codex and the programs MCP servers start are installed on each machine — versions and the command that installed each (native installer, npm, Homebrew, pipx, uv, pip) — and what this machine lacks, with the command to install it. Nothing is installed without you.
144
+
145
+ ---
146
+
147
+ ## What Is Synced
148
+
149
+ | Where | What |
150
+ |---|---|
151
+ | `~/.claude` | `CLAUDE.md`, `settings.json`, `agents/`, `commands/`, `hooks/`, `skills/`, `look-again/`, `statusline.sh`, the plugin lists |
152
+ | `~/.claude.json` | only `mcpServers` |
153
+ | `~/.codex` | `AGENTS.md`, `config.toml`, `hooks.json`, `agents/` |
154
+ | `~/.agents/skills` | the skills both tools read |
155
+ | `~/skills-lock.json` | the lock file of `npx skills` |
156
+ | `~/.codeagent-sync` | `registry.yaml` (sharing decisions), `sync.yaml` (rules), `machines/` (inventories) |
157
+
158
+ Never synced: sessions, history, credentials, caches, and what belongs to one machine — trusted projects, approved hooks, the rest of `.claude.json`. An MCP server whose command is not installed on a machine is held back there until it is.
159
+
160
+ ---
161
+
162
+ ## Troubleshooting
163
+
164
+ **Something does not sync, or you are not sure why** — run `codeagent-sync doctor`: it checks the setup, storage, key, conditional writes, conflicts, rules, hooks and what this machine lacks.
165
+
166
+ **"the credentials may not use the bucket (HTTP 403)"** — the API token is limited to other buckets, or the bucket does not exist and the token may not create it. Create the bucket and give the token read and write access to it.
167
+
168
+ **Codex does not sync automatically** — Codex skips hooks it has not been told to trust: type `/hooks` in Codex and trust the codeagent-sync hooks. `codeagent-sync auto status` shows whether it does.
169
+
170
+ **A skill works in one tool but not the other** — `codeagent-sync status --check` lists skills and agents a tool would ignore, such as a `SKILL.md` that is a symlink.
171
+
172
+ ---
173
+
174
+ ## Security
175
+
176
+ Every file is encrypted with age before upload; the key is derived from the passphrase with Argon2id and a random salt kept in the bucket, and a key check catches a wrong passphrase before anything is touched. The storage sees file names and sizes, not contents. Conditional writes keep two machines syncing at once from overwriting each other; deletions are recorded, not lost.
177
+
178
+ ---
179
+
180
+ ## Acknowledgements
181
+
182
+ Started as a fork of [claude-sync](https://github.com/tawanorg/claude-sync) (MIT); see [THIRD_PARTY_NOTICES.md](THIRD_PARTY_NOTICES.md).
183
+
184
+ ---
185
+
186
+ ## License
187
+
188
+ MIT — see [LICENSE](LICENSE).
@@ -0,0 +1,24 @@
1
+ # Third-party notices
2
+
3
+ Portions of this software are derived from claude-sync, distributed under the
4
+ MIT License:
5
+
6
+ Copyright (c) 2026 tawanorg
7
+
8
+ Permission is hereby granted, free of charge, to any person obtaining a copy
9
+ of this software and associated documentation files (the "Software"), to deal
10
+ in the Software without restriction, including without limitation the rights
11
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
12
+ copies of the Software, and to permit persons to whom the Software is
13
+ furnished to do so, subject to the following conditions:
14
+
15
+ The above copyright notice and this permission notice shall be included in all
16
+ copies or substantial portions of the Software.
17
+
18
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
19
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
20
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
21
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
22
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
23
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
24
+ SOFTWARE.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "codeagent-sync",
3
- "version": "0.1.0",
3
+ "version": "0.1.1",
4
4
  "description": "Keep Claude Code and Codex configuration (skills, settings, MCP servers, hooks) the same on every machine, end-to-end encrypted",
5
5
  "bin": {
6
6
  "codeagent-sync": "codeagent-sync.js"
@@ -9,7 +9,8 @@
9
9
  "postinstall": "node codeagent-sync.js --codeagent-sync-install"
10
10
  },
11
11
  "files": [
12
- "codeagent-sync.js"
12
+ "codeagent-sync.js",
13
+ "THIRD_PARTY_NOTICES.md"
13
14
  ],
14
15
  "keywords": [
15
16
  "claude",