sync

A command for mirroring files between a local directory and a server using rsync, a file-copying tool. It previews changes by default and requires explicit options to apply them or delete files.

In plain words
What is it for?
Use it to compare or transfer a local directory and server directory, optionally applying the transfer or confirmed deletions.
Why use it?
It helps inspect synchronization changes before making them and adds confirmation checks around potentially destructive deletions.

Command

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add commands/callmetechie/fleet-manager/sync
Clone the repo
git clone --depth 1 https://github.com/CallMeTechie/fleet-manager
Per session 30 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 1,036 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00030 $0.01036
Opus 5 $0.00015 $0.00518
Sonnet 5 $0.00006 $0.00207
Haiku 4.5 $0.00003 $0.00104

Measured yesterday against content hash 4a0144f0bb3f, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

sync scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured yesterday.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

plugin/commands/sync.md · 71 lines

What it actually says

Sync

set -euo pipefail
source "${CLAUDE_PLUGIN_ROOT:-plugin}/commands/_transfer-lib.sh"

SRC=""; DST=""; APPLY=0; DELETE=0; TOKEN=""; DELTOKEN=""
set -f
# shellcheck disable=SC2086  # intentional: split ARGUMENTS into positional params
set -- ${ARGUMENTS:-}
while [ $# -gt 0 ]; do
  case "$1" in
    --apply) APPLY=1 ;;
    --delete) DELETE=1 ;;
    --confirm=*) TOKEN="${1#*=}" ;;
    --confirm-delete=*) DELTOKEN="${1#*=}" ;;
    --*) echo "Unknown flag: $1" >&2; exit 1 ;;
    *) if [ -z "$SRC" ]; then SRC="$1"; elif [ -z "$DST" ]; then DST="$1"; else echo "Too many args" >&2; exit 1; fi ;;
  esac
  shift
done
if [ -z "$SRC" ] || [ -z "$DST" ]; then echo "Usage: /sync <src> <dst> [--apply] [--delete --confirm-delete=<server>]" >&2; exit 1; fi

parse_endpoint "$SRC"; SRC_KIND="$FM_EP_KIND"; SRC_SERVER="$FM_EP_SERVER"; SRC_PATH="$FM_EP_PATH"
parse_endpoint "$DST"; DST_KIND="$FM_EP_KIND"; DST_SERVER="$FM_EP_SERVER"; DST_PATH="$FM_EP_PATH"
if [ "$SRC_KIND" = remote ] && [ "$DST_KIND" = remote ]; then echo "ERROR: server↔server not supported." >&2; exit 1; fi
if [ "$SRC_KIND" = local ] && [ "$DST_KIND" = local ]; then echo "ERROR: both paths local — use rsync locally." >&2; exit 1; fi
if [ "$DST_KIND" = remote ]; then SERVER="$DST_SERVER"; else SERVER="$SRC_SERVER"; fi
load_profile "$SERVER"; echo_target "$SERVER"   # project convention: show target first

is_scope_authorized "$SERVER" file_transfer || { echo "REFUSED: scope 'file_transfer' not authorized for '$SERVER'." >&2; exit 1; }
if ! local_has_rsync; then echo "ERROR: rsync not found locally — /sync requires rsync (install it)." >&2; exit 1; fi
if ! remote_has_rsync "$SERVER"; then echo "ERROR: rsync not found on '$SERVER' — /sync requires rsync on both ends." >&2; exit 1; fi

if [ "$DST_KIND" = remote ] && is_protected_path "$SERVER" "$DST_PATH"; then
  confirm_destructive "$SERVER" "$TOKEN" || exit 1
fi

build_rsync_rsh "$SERVER"
if [ "$SRC_KIND" = remote ]; then RS_SRC="$FM_REMOTE:$SRC_PATH"; else RS_SRC="$SRC_PATH"; fi
if [ "$DST_KIND" = remote ]; then RS_DST="$FM_REMOTE:$DST_PATH"; else RS_DST="$DST_PATH"; fi

OPTS=(-a -i -s)
[ "$DELETE" -eq 1 ] && OPTS+=(--delete)
if [ "$APPLY" -eq 0 ]; then
  OPTS+=(--dry-run)
  echo "── DRY RUN (no changes) — re-run with --apply to execute ──"
  rsync "${OPTS[@]}" -e "$FM_RSYNC_RSH" "$RS_SRC" "$RS_DST"
  echo "(Tip: check trailing slashes — 'dir' copies the dir, 'dir/' copies its contents.)"
  exit 0
fi

# --apply path: gate --delete behind the match token.
if [ "$DELETE" -eq 1 ] && [ "$DELTOKEN" != "$SERVER" ]; then
  echo "REFUSED: --delete needs --confirm-delete=$SERVER (you typed: '${DELTOKEN:-<none>}')." >&2
  echo "Inspect first with a dry run: /sync $SRC $DST --delete   (no --apply)" >&2
  exit 1
fi
if rsync "${OPTS[@]}" -e "$FM_RSYNC_RSH" "$RS_SRC" "$RS_DST"; then
  if [ "$DELETE" -eq 1 ]; then echo "Verdict: synced (with --delete)."; else echo "Verdict: synced."; fi
else
  echo "ERROR: rsync failed." >&2; exit 1
fi
Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. yesterday First seen · 71 lines · 30 tokens per session scan A 4a0144f0bb3f

Subscribe to this mod's changes

sync is a command published in the GitHub repository CallMeTechie/fleet-manager (1 stars, last pushed 29d ago), licensed MIT. It adds 30 tokens to every session and 1,036 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.