sync-instructions

sync-instructions is a command for Claude Code from Leoyang183/sync-agents-settings. It costs 41 tokens per session (642 once invoked), scanned A, original, MIT.

A command that converts Claude Code instruction files into instruction files for other AI coding tools.

In plain words
What is it for?
Use it to sync global instructions, local project instructions, or both to tools such as Gemini, Codex, Cursor, and OpenCode, with optional import handling and JSON reports.
Why use it?
It saves you from rewriting the same global or project instructions for each agent and shows what will change before writing files.

Command for Claude Code

Written for Claude Code: shipped in a Claude Code plugin. Also seen: reads .claude/ paths; mentions CLAUDE.md; mentions Claude Code.

Part of the sync-agents-settings plugin — 1 skill, 8 commands shipped together

Good fit Use it to sync global instructions, local project instructions, or both to tools such as Gemini, Codex, Cursor, and OpenCode, with optional import handling and JSON reports.

Compare 6 commands from other repositories ↓
Install with agentmods
npx agentmods add commands/leoyang183/sync-agents-settings/sync-instructions
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.

Clone the repo
git clone --depth 1 https://github.com/Leoyang183/sync-agents-settings

Made for: Claude Code.

Or install sync-agents-settings, the plugin that ships this one along with the rest of its 1 skill, 8 commands.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for sync-instructions

README.md
[![agentmods](https://agentmods.dev/badge/commands/leoyang183/sync-agents-settings/sync-instructions/github.svg)](https://agentmods.dev/commands/leoyang183/sync-agents-settings/sync-instructions)
Your own site
<a href="https://agentmods.dev/commands/leoyang183/sync-agents-settings/sync-instructions"><img src="https://agentmods.dev/badge/commands/leoyang183/sync-agents-settings/sync-instructions/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for sync-instructions

Your own site · 80×15
<a href="https://agentmods.dev/commands/leoyang183/sync-agents-settings/sync-instructions"><img src="https://agentmods.dev/badge/commands/leoyang183/sync-agents-settings/sync-instructions.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 41 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 642 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
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.1 $0.00041 $0.00642
Opus 5.5 $0.00016 $0.00257
Sonnet 5.5 $0.00008 $0.00128
Haiku 4.5 $0.00004 $0.00064

Measured 1mo ago against content hash df892488d9b5, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

sync-instructions 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 1mo ago.

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.

commands/sync-instructions.md · 51 lines

How it starts

The opening of the file, as written. The whole thing — 51 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Sync CLAUDE.md instruction files from Claude Code format to other AI agent formats.

Arguments

The user may pass target names: /sync-instructions gemini codex If no targets specified, sync to all targets.

The user may also pass flags:

  • --no-backup — skip creating backup of target instruction files
  • --import-mode inline|strip — how to handle standalone @import lines (inline = expand, strip = remove line)
  • --report json — output machine-readable JSON summary (CI-friendly)

Execution Flow

  1. Ask the user which scope to sync:

    • Global (~/.claude/CLAUDE.md) — syncs to agent-specific global instruction files
    • Local (./.claude/CLAUDE.md in current directory, fallback ./CLAUDE.md) — syncs to project-level instruction files
    • Both (default) — syncs both global and local
  2. Parse targets from user arguments. Build the dry-run command: npx sync-agents-settings sync-instructions --dry-run [--global|--local] --target <targets> Omit --global/--local if syncing both (this is the CLI default). Add --no-backup if the user specified it.

  3. Run the dry-run command. Present what will be written:

    • Which instruction files will be created or updated
    • Which targets will be skipped (e.g., Cursor global is unsupported — uses SQLite)
  4. If any target files already exist, ask the user what to do:

    • Overwrite — replace the existing file entirely
    • Append — add Claude instructions after the existing content
    • Skip — leave the existing file untouched
  5. Run the actual command. IMPORTANT: Always pass --on-conflict <action> to prevent the CLI from entering interactive mode (which does not work in Claude Code's bash execution): npx sync-agents-settings sync-instructions [--global|--local] --target <targets> --on-conflict <action> Add --no-backup if the user specified it.

  6. Present the final results: which files were synced, appended, or skipped.

    • If --report json is used, return raw JSON output and avoid text post-processing.

Read the full file on GitHub · 51 lines

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. 1mo ago First seen · 51 lines · 41 tokens per session scan A df892488d9b5

Subscribe to this mod's changes

sync-instructions is a command published in the GitHub repository Leoyang183/sync-agents-settings (7 stars, last pushed 6mo ago), licensed MIT. It adds 41 tokens to every session and 642 once invoked, about $0.0002 per session on Opus 5.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.