Troubleshooting
Use this guide when something feels off and you are not sure if it is AgentSync, your environment, or your configuration.
Healthy baseline first. In your project root, these three should all pass:
agentsync --versionagentsync doctoragentsync statusIf all three pass and the behavior still looks wrong, work through the sections below in order. Most reports turn out to be one of these: a shadowed binary, a missing PATH entry, expected status drift, or a doctor warning that already names the fix.
Installed a new version but --version shows an old one
Section titled “Installed a new version but --version shows an old one”This is the most confusing one because the installer says success and the CLI disagrees.
Typical symptoms
pnpm add -g @dallay/agentsync# global:# + @dallay/agentsync 1.50.0
agentsync --version# agentsync 1.32.0The new package installed correctly. A different, older binary is winning in your PATH.
Why it happens
AgentSync can be installed two independent ways:
- npm wrapper (
npm / pnpm / yarn / bun -g) — downloads a platform binary and exposes it from the package-manager globalbindirectory, for example~/Library/pnpm/bin/agentsync. - Rust binary (
cargo install agentsync) — compiles and drops a standalone binary into~/.cargo/bin/agentsync.
Those two binaries do not update each other. If ~/.cargo/bin appears earlier in PATH than the pnpm/npm global bin, the shell keeps running the old Rust binary even after a successful pnpm add -g.
Diagnose it
# 1. Which binary is actually running?which agentsyncls -la "$(which agentsync)"
# 2. What does the package-manager binary report directly?# Adjust the path to your setup if needed.~/Library/pnpm/bin/agentsync --version
# 3. Confirm the shadowed copyls -la ~/.cargo/bin/agentsyncecho "$PATH" | tr ':' '\n' | nlWhat you want to see:
which agentsyncpoints to the binary you intend to use.- The direct-path
--versionprints the new version (for example1.50.0). - An old dated binary exists in the earlier
PATHentry (for example a 7 MB file from months ago in~/.cargo/bin).
Fix it: keep the npm wrapper, remove the old cargo binary
If you already manage AgentSync through pnpm/npm, the cleanest fix is to remove the stale standalone binary:
rm ~/.cargo/bin/agentsynchash -r # clear the shell's cached command locationswhich agentsyncagentsync --version # should now print the new versionIf you intentionally want to keep both:
alias agentsync='~/Library/pnpm/bin/agentsync'agentsync --versionAdd the alias to your shell profile (for example ~/.zshrc) so it survives restarts.
Prevent it
- Pick one install method per machine: either the npm wrapper or
cargo install, not both. - After switching methods, verify with
which agentsyncandagentsync --versionbefore reporting a version bug. - In CI, prefer a one-off runner (
npx,pnpm dlx,bunx) so no global binary can shadow the pinned version:
npx @dallay/agentsync --versionpnpm dlx @dallay/agentsync --versionyarn dlx @dallay/agentsync --versionbunx @dallay/agentsync --versionagentsync: command not found after a global install
Section titled “agentsync: command not found after a global install”The package installed, but its bin directory is not on PATH.
# Where did pnpm put the binary?pnpm root -gls -la ~/Library/pnpm/bin/agentsync
# Is that directory on PATH?echo "$PATH" | tr ':' '\n' | grep -i pnpmFixes:
- Add the global bin directory to your shell profile (
export PATH="$HOME/Library/pnpm/bin:$PATH"for pnpm, or the equivalent for npm/yarn/bun), reload the shell, and retry. - Or skip global installs entirely and use a one-off runner in each project:
npx @dallay/agentsync statuspnpm dlx @dallay/agentsync statusyarn dlx @dallay/agentsync statusbunx @dallay/agentsync statusagentsync status reports drift
Section titled “agentsync status reports drift”status is supposed to complain when the filesystem drifted from agentsync.toml. Read its verdict literally:
| Status | Meaning | Typical fix |
|---|---|---|
✔ OK |
Symlink exists and points to the expected source | Nothing to do |
✗ Incorrect link |
Symlink points somewhere else | Run agentsync apply, or apply --clean if you want a full recreate |
! Missing |
Destination does not exist | Run agentsync apply |
· Exists but not a symlink |
A regular file or directory blocks the destination | Back up or remove the blocker, then agentsync apply |
Useful pattern before writing anything:
agentsync statusagentsync apply --dry-runagentsync applyagentsync statusScope the repair when you only care about one agent:
agentsync apply --agents claude --dry-runagentsync apply --agents claudeFor the full schema, exit codes, and CI usage (status --json), see the Status Output reference.
agentsync doctor warns about config or environment
Section titled “agentsync doctor warns about config or environment”doctor names the problem class for you. Common hits:
- Missing
agentsync.tomlor TOML syntax error — run from the project root, or pass--project-root, and validate the TOML. - Target source does not exist — the
sourcepath in your config has a typo or the file was never created under.agents/. module-maptarget with no mappings — the target is misconfigured; add mappings or disable it.- Destination conflicts — same destination claimed twice; narrow it to one owner.
.gitignoreaudit findings — marker-aware parsing found a stale or unexpected managed block. Decide your team policy first in the Gitignore Team Workflows guide.- MCP server not executable — the configured MCP command is missing or not on
PATH. - Unmanaged Claude skills — content exists in
.claude/skills/that no target manages. Either adopt it intoagentsync.tomlor leave it unmanaged on purpose. - Skills mode mismatch — a skills target is configured as
symlink-contentswhile the destination is already the expected directory symlink.statusstaysOKand prints a hint; switch that target tosymlinkto avoid churn.
Run order that separates config problems from environment problems:
agentsync doctoragentsync statusagentsync apply --dry-runagentsync apply fails to create symlinks
Section titled “agentsync apply fails to create symlinks”If apply fails with a symlink-permission error on Windows, fix the shell setup before treating it as an AgentSync bug: Developer Mode or Administrator shell, correct native-versus-WSL context, then apply again. Full steps live in the Windows Symlink Setup guide.
On macOS or Linux, the usual causes are:
- A regular file or directory already occupies the destination (
statusshowsExists but not a symlink). Back it up, remove it, and re-runapply. - The configured
sourcedoes not exist.doctortells you which one. - You are running from the wrong directory. Pass
-p /path/to/repoorcdinto the project root.
Clean retry when you changed approach and want a fresh reconcile:
agentsync cleanagentsync applyagentsync statusUse clean only when you intend to remove managed links before recreating them.
Quick checklist before opening an issue
Section titled “Quick checklist before opening an issue”Collect this output and paste it into the report:
which agentsyncagentsync --versionagentsync doctoragentsync statusagentsync apply --dry-runAlso note:
- Install method (npm/pnpm/yarn/bun global, one-off runner, GitHub release tarball, or
cargo install). - OS and shell.
- Whether
~/.cargo/binor another globalbinshadows the expected binary.
Related docs:
- Getting Started for install methods
- CLI Reference for flags such as
--project-root,--agents,--dry-run, and--no-gitignore - Gitignore Team Workflows for managed-destination policy
- Git Hook Automation for keeping links fresh after branch switches
- Windows Symlink Setup for native and WSL prerequisites