Agent skill

Sync Upstream

by nklisch in nklisch/claude-code-modes

Compare this project's base prompts and model metadata against a Claude Code release.

MITAuto-check: notes

Install Sync Upstream

skills CLI
$ npx skills add nklisch/claude-code-modes --skill sync-upstream -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install nklisch/claude-code-modes sync-upstream --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/nklisch/claude-code-modes.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.claude/skills/sync-upstream .claude/skills/sync-upstream && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
sync-upstream
GitHub stars
116
Token cost
~1.8k tokens
SKILL.md length
914 words
Files
3 (incl. references)
Skills in repo
4
Repo updated
First seen
Licence
MIT

At a glance

Compare this project's base prompts and model metadata against a Claude Code release.

  • User says sync upstream
  • SKILL.md covers What "aligned" means, Ground truth and how to reach it, Finding what isn't on the map and Classifying a difference, plus 2 more sections
  • Calls bun and npm
  • Check for drift

What it does

Sync Upstream is an agent skill from nklisch/claude-code-modes. Compare this project's base prompts and model metadata against a Claude Code release. Extracts and greps the upstream prompt assembly, finds both drift in tracked fragments and content we never tracked at all, classifies each change as intentional omission or real drift, and applies approved updates. Use when user says "sync upstream", "check for drift", "new CC version", or runs /sync-upstream.

Its SKILL.md is about 1.8k tokens, which your agent loads only when the skill is triggered. The skill folder holds 3 other files, including reference files (for example `references/fragment-map.md` and `references/intentional-omissions.md`).

The repository describes itself as: CLI launcher for Claude Code with behaviorally-tuned system prompts — control agency, quality, and scope instead of fighting the defaults. The licence is MIT.

When your agent uses it

  • User says sync upstream
  • Check for drift
  • Runs /sync-upstream

Example prompts

  • “sync upstream”
  • “check for drift”
  • “new CC version”
  • “/sync-upstream”

Requirements

  • Python 3
  • Pre-approved tools (allowed-tools): Bash, Read, Edit, Grep, Glob, Write, AskUserQuestion

What it can do on your machine

Read from SKILL.md and the folder at commit 4dbbb28. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves these tools, so the agent can use them without asking each time:

    • Bash
    • Read
    • Edit
    • Grep
    • Glob
    • Write
    • AskUserQuestion

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Shell commands in SKILL.md call:

    • bun
    • npm

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md. Its commands use npm, which can reach the network depending on how they are called.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Sync Upstream loads about 1.8k tokens when it runs, and up to ~11k if it reads all its reference files. Until then it costs about 103 tokens; SKILL.md has 914 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~103
When it runs · the whole SKILL.md, loaded when a task matches
~1.8k
With references · SKILL.md plus every file in references/, read only if the agent opens them
~11k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check: notes

The automated check noted patterns worth knowing about, such as sudo or a known installer.

  • NotePre-approves every shell command (allowed-tools: Bash)SKILL.md
    allowed-tools: Bash, Read, Edit, Grep, Glob, Write, AskUserQuestion

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from nklisch/claude-code-modes at commit 4dbbb28, republished under its MIT licence (© nklisch). 914 words, ~1,772 tokens.

Download SKILL.mdSave it as .claude/skills/sync-upstream/SKILL.md (or your agent's skills folder). This skill also uses 2 other files; get the full folder from GitHub.
name
sync-upstream
description
Compare this project's base prompts and model metadata against a Claude Code release. Extracts and greps the upstream prompt assembly, finds both drift in tracked fragments and content we never tracked at all, classifies each change as intentional omission or real drift, and applies approved updates. Use when user says "sync upstream", "check for drift", "new CC version", or runs /sync-upstream.
allowed-tools
Bash, Read, Edit, Grep, Glob, Write, AskUserQuestion
user-invocable
true

Sync Upstream

Keep prompts/base/, prompts/lean/, the prompt-bundle modifiers, and the model table in src/env.ts aligned with what Claude Code actually sends.

This is an investigation, not a checklist. The sections below describe what has to be true when you're done and the tools available to get there — how you sequence them is yours to judge. Two things are not yours to judge: confirm the target version before doing the work, and get changes approved before applying them.

What "aligned" means

Three prompt shapes exist upstream, assembled by one function that forks on a model-capability predicate. All three matter here:

ShapeWho gets itTracked in
standard headmodels without lean_promptprompts/base/
lean headmodels with lean_promptprompts/lean/
shared taileveryone, both headsduplicated in both bases
bundle sectionsmodels with opus_5_prompt_bundleprompts/modifiers/

Capabilities also drive --base auto, so the model table in src/env.ts is part of the sync, not a side note: a new flagship changes which base users get by default.

references/fragment-map.md holds the current local↔upstream mapping and the marker strings to find each piece. references/intentional-omissions.md holds every difference that is deliberate.

Ground truth and how to reach it

bun run scripts/extract-upstream-prompt.ts [version] pulls named prompt functions into upstream-prompts/. It is the fastest path for what it covers, which is the standard head and not much else. It does not extract the shared tail, the lean head, the bundle sections, or model capabilities.

For anything it misses, grep the release binary directly:

bash
npm pack @anthropic-ai/claude-code-linux-x64@<version> && tar xzf *.tgz   # → package/claude

It's ~275 MB, so slice by byte offset in Python rather than running wide regexes:

python
data = open("package/claude","rb").read()
i = data.find(b"<marker text>")
print(data[i-4000:i+4000].decode("utf8","replace"))

Useful anchors: search a distinctive sentence to land in the assembler, then read outward. strings -n 8 package/claude | grep -o 'id:"claude-[a-z0-9-]*"[^}]\{0,220\}' gets the model table with its capabilities arrays.

Diffing two extractions is the cheapest first move. If a previous version's file is still in upstream-prompts/, diff it against the new one — most releases are pure minifier churn (ja_ → aO_) with one or two real sentence changes, and the diff isolates them in seconds. Ignore renamed symbols, template-variable syntax, and whitespace; they are noise.

You may be running under one of these prompts yourself. If so, your own system prompt is a live sample of what a real session receives — worth more than inference about which branch fires. Use it to confirm, and say so when you report.

Finding what isn't on the map

The mapping files are a record of what we already know. Diffing only against them can never surface content we never tracked — that blind spot is exactly how the shared tail sections went missing from prompts/base/ for several releases.

So each sync, spend some effort in the other direction: read the assembler's return value and account for every section it can emit. For each one, land in a category and be able to say which:

  • tracked in a local fragment
  • documented as an intentional omission
  • genuinely inapplicable — session-, environment-, or experiment-gated (a flag that fires on one model, a background-session block, an output-style hook)
  • unaccounted for — a real gap, whether or not the current release changed it

Watch for gates that turn out to mean something other than their name suggests. A branch filed as "some terser variant" may be a whole prompt shape; a "compact" mode may be reachable on exactly one model in one experiment. When a gate's meaning is unresolved, resolving it is usually higher-value than diffing another fragment, because an unresolved gate can hide an entire category of content.

Show full SKILL.md (339 more words)Show less

Classifying a difference

  • Intentional omission — matches a documented entry. Leave it; if the upstream wording moved, update the quote in the reference so future diffs still match.
  • Local addition — we carry content upstream doesn't (gitStatus block, tool-agnostic rewrites of tool names). Leave it.
  • Drift — upstream changed and we haven't. Candidate to apply.
  • Unaccounted — from the sweep above. Report it separately; it usually needs a new fragment or a new omission entry, which is a decision, not a mechanical edit.

New content that lands in axis territory is a new omission, not drift. The test: would carrying it in a base contradict any value of the agency, quality, or scope axes? Read the axis fragments and check rather than guessing — # Delivering work looked like neutral guidance until its scope sentences were read against scope/unrestricted.

Reporting and applying

Report grouped by classification, with the specific changed text for each drift item, and an explicit count of what didn't change so the user can see coverage. Then get approval — AskUserQuestion with a multi-select works well when there are several independent items.

When applying:

  • Edit the local fragments. Changes to the shared tail apply to both bases.
  • Model table changes usually travel together: a new flagship touches MODEL_TABLE, MODEL_ALIASES, and the "most recent Claude models" line in every base's env.md.
  • New fragments need registering in scripts/generate-prompts.ts and src/embedded-prompts.test.ts, plus the manifest and the fragment counts in the count tests and CLAUDE.md.
  • Bump the validated-against version in CLAUDE.md and README.md.
  • Regenerate embedded prompts and run bun test.

Keeping the references current

The reference files are the durable output of every sync — more so than the prompt edits, which git already records. Before finishing, make sure they reflect what you learned: new mappings and refreshed minified names in fragment-map.md; new or newly-grounded omissions in intentional-omissions.md.

Record resolved mysteries, not just changes. "vE is the lean predicate" and "YFc returns false outright, so that section is dead code" are the findings that save the next sync the most time, and neither shows up as a diff.

© nklisch, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 2 other files (references) in .claude/skills/sync-upstream of nklisch/claude-code-modes.

  • SKILL.md
  • references/fragment-map.md
  • references/intentional-omissions.md

Open the folder on GitHubat commit 4dbbb28

Compare with similar skills

Sync Upstream next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Sync Upstream compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Sync Upstream this skillnklisch/claude-code-modes116—~1.8kAutomated safety check: NotesMIT
Sync Upstreamnyaruka/phonenumbers1.6k—~2.8kAutomated safety check: PassMIT
Upstream Syncevloghq/evlog1.9k—~856Automated safety check: PassMIT
Knowledge Basesickn33/agentic-awesome-skills47k1 repos~3.3kAutomated safety check: PassMIT
React Syncvercel/next.js143k—~486Automated safety check: PassMIT
Sync Upstream Radiustalkincode/toughradius691—~736Automated safety check: PassMIT

Similar skills

  • Sync Upstream

    nyaruka/phonenumbers

    Sync this Go port with a new upstream google/libphonenumber release — regenerate the embedded metadata and reconcile the ported Java logic.

    1.6k GitHub stars~2.8k tokensUpdated 5 days ago
    Business, Finance & HRAuto-check passed
  • Upstream Sync

    evloghq/evlog

    Check the eve and Vercel Connect ecosystem for updates and new features, keep the app current with them, and replace workarounds with the real improvements.

    1.9k GitHub stars~856 tokensUpdated yesterday
    DevelopmentAuto-check passed
  • Knowledge Base

    sickn33/agentic-awesome-skills

    Knowledge base register: article title, category, department, owner, tags, summary, linked SOP, audience, last and next review dates and status.

    47k GitHub starsUsed in 1 repo~3.3k tokens
    Knowledge ManagementAuto-check passed
  • React Sync

    vercel/next.js

    Official

    Build local React changes in the bundle variants consumed by Next.js, sync them into a local Next.js checkout, and test the resulting integration.

    143k GitHub stars~486 tokensUpdated today
    Auto-check passed
  • Sync Upstream Radius

    talkincode/toughradius

    Track and sync the upstream layeh.com/radius library to the org fork talkincode/radius (TR-F021/TR-F022).

    691 GitHub stars~736 tokensUpdated 4 days ago
    Auto-check passed
  • Claude-Mem Cloud Sync

    thedotmack/claude-mem

    Checks claude-mem cloud sync status and guides you through connecting a cmem.ai Pro account without the sync token ever passing through the chat.

    98k GitHub starsUsed in 1 repo~1k tokens
    Agent WorkflowsAuto-check: notes

More from nklisch/claude-code-modes

  • Structural Refactor

    nklisch/claude-code-modes

    Project structural organization rules for Bun/TypeScript CLI.

    116 GitHub stars~526 tokensUpdated 7 days ago
    Auto-check: notes
  • Stylistic Refactor

    nklisch/claude-code-modes

    Project stylistic refactoring rules for Bun/TypeScript CLI. An agent skill from nklisch/claude-code-modes.

    116 GitHub stars~523 tokensUpdated 7 days ago
    Auto-check: notes
  • Patterns

    nklisch/claude-code-modes

    Project code patterns and conventions. An agent skill from nklisch/claude-code-modes.

    116 GitHub stars~228 tokensUpdated 7 days ago
    Auto-check passed

Questions about Sync Upstream

What does Sync Upstream do?

Compare this project's base prompts and model metadata against a Claude Code release. Sync Upstream is an agent skill from nklisch/claude-code-modes. Compare this project's base prompts and model metadata against a Claude Code release.

When should I use Sync Upstream?

Sync Upstream fits situations like: user says sync upstream; check for drift; runs /sync-upstream.

How do I install Sync Upstream in Claude Code?

Run `npx skills add nklisch/claude-code-modes --skill sync-upstream -a claude-code`. Or copy the skill folder (.claude/skills/sync-upstream in nklisch/claude-code-modes) into .claude/skills/sync-upstream in your project. Claude Code loads it when a task matches its description.

How do I install Sync Upstream in Codex?

Run `npx skills add nklisch/claude-code-modes --skill sync-upstream -a codex`. Or copy the skill folder (.claude/skills/sync-upstream in nklisch/claude-code-modes) into .agents/skills/sync-upstream in your project. Codex loads it when a task matches its description.

Can I use Sync Upstream in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add nklisch/claude-code-modes --skill sync-upstream -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/sync-upstream, .gemini/skills/sync-upstream, .github/skills/sync-upstream and .opencode/skills/sync-upstream in your project.

What does Sync Upstream need to run?

Going by SKILL.md and its folder, Sync Upstream needs the command-line tools its instructions call (bun and npm). Our summary lists: Python 3. Its frontmatter pre-approves these tools: Bash, Read, Edit, Grep, Glob, Write, AskUserQuestion.

Does Sync Upstream access the network?

SKILL.md contains no URLs. Its commands use npm, which can reach the network depending on how they are called. This is read from the text; nothing was executed.

Is Sync Upstream safe to install?

Our automated static check of SKILL.md found notes only (pre-approves every shell command (allowed-tools: bash)), nothing it rates as a warning. It is not a guarantee. Review the folder before installing.

What licence does Sync Upstream use?

Sync Upstream is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Sync Upstream use?

About 1.8k tokens (SKILL.md is roughly 7.1k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full. Its references folder adds about 9.2k tokens, read only when the agent opens those files.

What are the alternatives to Sync Upstream?

Skills that share tags, products or a category with Sync Upstream: Sync Upstream (nyaruka/phonenumbers, 1.6k stars), Upstream Sync (evloghq/evlog, 1.9k stars), Knowledge Base (sickn33/agentic-awesome-skills, 47k stars) and React Sync (vercel/next.js, 143k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Sync Upstream?

nklisch (a GitHub user) maintains it in nklisch/claude-code-modes, which has 116 GitHub stars. The repository holds 4 skills in this directory. The repository was last updated on October 1, 2026.

Source: nklisch/claude-code-modes on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.