sync-instructions

sync-instructions is a command for coding agents 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

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

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/leoyang183/sync-agents-settings/sync-instructions
Clone the repo
git clone --depth 1 https://github.com/Leoyang183/sync-agents-settings

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

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. 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.00041 $0.00642
Opus 5 $0.00020 $0.00321
Sonnet 5 $0.00008 $0.00128
Haiku 4.5 $0.00004 $0.00064

Measured 3d ago against content hash df892488d9b5, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, 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 3d 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. 3d 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 (8 stars, last pushed 5mo ago), licensed MIT. It adds 41 tokens to every session and 642 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.