Skip to content
Current section: Sync

Set Up Sync in a Repository

Part of Sync. Start here to configure the product.

In the app, Sync opens on its Setup tab until a repo pushes: five steps covering the CLI, where your rules start (org rules on the Rules tab or a repo’s own .cedr/), connecting a repo, the first check and push, and what arrived. After the first push, Overview opens first and Setup moves to the last tab, ready for the next repo.

Use a clean working tree so you can review and undo the import. Inspect existing generated-file notices first: if another tool owns the agent configuration, decide which source will own it before running Sync. Do not overwrite another source of truth.

Sync manages repository configuration. It does not install global workstation governance or automatically register a user-level MCP connection. For an agent connection, use Local MCP or Hosted MCP.

Edit the source, then regenerate the agent files
  1. ImportBring existing configuration into .cedr/
  2. EditMaintain rules, skills and settings in .cedr/
  3. PreviewInspect the proposed generated changes
  4. Compile and checkWrite native files, then run the drift check

After the first import, repeat Edit → Preview → Compile and check. Commit the source and generated files together.

Install the CLI first (Install the CLI), version 0.5.0 or later. Then, from the repo’s root:

  1. Import what you have. cedr sync init reads the agent files already in the repo and writes them into .cedr/: AGENTS.md, CLAUDE.md and other instruction files become rules, skills are copied, MCP servers from every agent’s config are merged into one list, and Claude Code’s permissions and hooks are translated. Literal secrets in a server’s settings are replaced by ${NAME} references, and the command lists them so you can set the variables.
  2. Choose your agents. Edit targets in .cedr/sync.toml to the agents your team uses.
  3. Compile. cedr sync --dry-run shows what would change; cedr sync writes it.
  4. Check. cedr sync check must pass. Commit .cedr/ and the generated files together.

From then on, change agent setup only in .cedr/ and run cedr sync.

After the first compile, inspect the diff and check that existing settings remain intact. If Sync refuses a Markdown file, review the import and source rules rather than adding --force by default. To undo an uncommitted setup, restore the reviewed original files and remove only the files created by that setup.

The Ask your agent menu at the top right of the Sync page in the app has Fix this repo (resolves drift, hand edits and rule findings), Roll out new org rules (pulls the latest org rules into each repo for review) and Troubleshoot Sync, beside Set up this repo, Draft org rules and Add Sync to CI. Each copies a prompt filled in with your organization’s settings; see Ask Your Agent in the App.

Removing Sync stops it generating your agent files. You choose whether the generated files stay as ordinary files you edit by hand (the default) or go back to the versions from before Sync. Its CI checks go too; Guard’s files stay. The repo stays on the Sync page until an owner or admin removes it there. In the app, Ask your agent has Remove Sync from this repo:

Remove Cedr Sync from the git repository I have open.
Before deleting anything, list every file, setting, registration and scheduled job you would remove, with its path, and wait for my approval on each one. Skip anything I want to keep. Back up every configuration file you will change or delete into a new folder ~/cedr-backup-<YYYY-MM-DD>/ first, keeping its path. Never touch my organization's data in the cedr.dev app. Finish by telling me what you removed, where the backups are and what is left.
1. List Sync's sources: .cedr/sync.toml, .cedr/rules/, .cedr/skills/, .cedr/org-rules.json and .cedr/sync.lock, and the generated files .cedr/sync.lock lists (AGENTS.md and each agent's files).
2. Ask me what to do with the generated files: keep them as ordinary files that I edit by hand from now on (the default), or restore the versions from before Sync with git log and git show. Never delete my agent instructions without asking.
3. CI: delete .github/workflows/cedr-sync-repair.yml if present. In .github/workflows/cedr.yml, set sync: 'false' under with if Guard still uses that workflow (.cedr/guard.lock or a legacy cedr.lock at the repo root exists); otherwise offer to delete it.
4. Remove the Sync sources I approve, leaving Guard's files in .cedr/ alone. Commit on a new branch with chore: remove cedr sync. Do not push unless I ask.

By hand: keep or restore the generated files, delete .cedr/sync.toml, .cedr/rules/, .cedr/skills/, .cedr/org-rules.json and .cedr/sync.lock, delete .github/workflows/cedr-sync-repair.yml, and in .github/workflows/cedr.yml set sync: 'false' if Guard still uses it (otherwise delete it); then commit.

Next, learn the configuration format or add CI checks.