git-sync-workspace

git-sync-workspace is a skill for Claude Code, Cursor from emaraschio/cursor-commands. It costs 85 tokens per session (1,305 once invoked), scanned A, original, MIT.

A workflow for updating every Git repository in a multi-root development workspace to its remote default branch, usually main or master. It fetches remote changes and uses fast-forward updates without discarding local work.

In plain words
What is it for?
Use it before starting fresh work, after switching projects, or when you need all repositories in a workspace aligned with their latest remote base branch.
Why use it?
It avoids manually updating each repository and reduces the risk of accidentally overwriting uncommitted changes. Repositories with dirty or unsafe working trees are skipped and reported.

Skill for Claude CodeCursor

Written for Claude Code and Cursor: user-invocable in frontmatter, but also shipped in a Cursor plugin.

Needs its repository: it reads a path above its own folder, which exists only inside the repository. The line is - path: ../repo1.

Part of the cursor-commands plugin — 44 skills, 43 commands shipped together

Good fit Use it before starting fresh work, after switching projects, or when you need all repositories in a workspace aligned with their latest remote base branch.

Compare 6 skills from other repositories ↓
Install

Getting it into your agent

It runs from inside its repository, so the clone comes first — what it calls does not travel with the file alone.

Clone the repo
git clone --depth 1 https://github.com/emaraschio/cursor-commands
agentmods
npx agentmods add skills/emaraschio/cursor-commands/git-sync-workspace

Made for: Claude Code, Cursor.

Or install cursor-commands, the plugin that ships this one along with the rest of its 44 skills, 43 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 git-sync-workspace

README.md
[![agentmods](https://agentmods.dev/badge/skills/emaraschio/cursor-commands/git-sync-workspace/github.svg)](https://agentmods.dev/skills/emaraschio/cursor-commands/git-sync-workspace)
Your own site
<a href="https://agentmods.dev/skills/emaraschio/cursor-commands/git-sync-workspace"><img src="https://agentmods.dev/badge/skills/emaraschio/cursor-commands/git-sync-workspace/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 git-sync-workspace

Your own site · 80×15
<a href="https://agentmods.dev/skills/emaraschio/cursor-commands/git-sync-workspace"><img src="https://agentmods.dev/badge/skills/emaraschio/cursor-commands/git-sync-workspace.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 85 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,305 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.00085 $0.01305
Opus 5.5 $0.00034 $0.00522
Sonnet 5.5 $0.00017 $0.00261
Haiku 4.5 $0.00009 $0.00130

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

Security

Grade A, and why

git-sync-workspace 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.

.cursor/skill-contracts/git-sync-workspace/SKILL.md · 106 lines

How it starts

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

Git sync workspace

Role

You sync multiple git repositories in a Cursor workspace to the latest remote default branch (main or master). This is the safe "back to base state" routine: fetch, checkout default, fast-forward pull, not a destructive reset.

When to use

Use when the user wants every repo in a multi-root workspace updated after context-switching, before cross-repo assessments, or when starting fresh work from remote HEAD. For a single broken repo (merge conflict, detached HEAD), use fix-git-issues instead.

Workflow

Run phases in order. Preflight every repo before any write.

Phase 0: Discover repos

  1. Workspace file (preferred): find *.code-workspace under the Cursor workspace root(s). Parse folders[].path and resolve relative paths against the workspace file location.
  2. Host profile (fallback): if no workspace file, read optional profiles/repos.yaml beside this skill (see Host overlay).
  3. Ask (last resort): if discovery yields nothing, ask the user which paths to include. Do not scan arbitrary ~/code/* without direction.
  4. De-duplicate paths. Keep only directories that contain a .git directory.
  5. If the user scopes the request (e.g. "only repo1 and repo2"), filter to matching paths only.

Phase 1: Preflight (read-only, every repo)

Before modifying any repo, show a preflight table:

Path Current branch Default branch Working tree Ahead / behind

Collect:

  • Path: repository root (absolute or workspace-relative).
  • Current branch: git branch --show-current (note detached HEAD).
  • Default branch: from git symbolic-ref refs/remotes/origin/HEAD (strip refs/remotes/origin/), else main, else master.
  • Working tree: git status --porcelain (empty = clean).
  • Ahead / behind: git rev-list --left-right --count @{u}...HEAD when upstream exists.

Also detect in-progress operations (merge, rebase, cherry-pick) via git status or .git/MERGE_HEAD / .git/rebase-merge. Treat these as unsafe; skip with reason skipped_unsafe.

Read the full file on GitHub · 106 lines

Files

What ships with it

4 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

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 · 106 lines · 85 tokens per session scan A 6dad32dfa1b3

Subscribe to this mod's changes

git-sync-workspace is a skill published in the GitHub repository emaraschio/cursor-commands (9 stars, last pushed 2d ago), licensed MIT. It adds 85 tokens to every session and 1,305 once invoked, about $0.0003 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-09-03.

Related

Other skills, from other repositories

active-review

Use when the user wants to prepare for a manual PR code review and asks for help targeting it — a terse PR summary, ranked files to read first, and paste-ready inline comment drafts with GitHub deep-links. Triggers: "active review this PR", "walk me through this PR", "help me review this", "give me inline comments to…

paultyng/skill-issue · 0 tokens

bisect

Use when hunting a regression, phrases like "bisect", "find the commit that broke X", "this used to work", "regression in test Y", "when did start". Also use when escalated from ci-debug-loop because log analysis can't pinpoint the offending change, or when a previously-passing test/build/behavior is now failing and…

paultyng/skill-issue · 121 tokens

analyze-knowledge

Use when the user asks who knows specific code, who should review a PR or files, what the lottery factor is, whether knowledge is concentrated or spread, who to talk to about a code area, or when suggesting reviewers beyond GitHub's built-in suggestions.

paultyng/skill-issue · 57 tokens

fix-pr-conflict

Resolve merge conflicts on a pull request by rebasing onto the base branch. Use when a PR is not mergeable, has merge conflicts, or the user asks to fix conflicts on a PR.

paultyng/skill-issue · 44 tokens

ship-it

End-to-end shipping workflow. Formats, lints, tests, creates a changelog entry, commits with conventional commits, pushes, updates PR description, and suggests reviewers. Use when the user says "ship it", "commit and push", "fmt lint test commit push", or similar shipping commands.

paultyng/skill-issue · 63 tokens

create-pr

Use when creating a new GitHub pull request, opening a PR for the current branch, or when another skill (like ship-it) needs a PR created for a branch that does not have one yet.

paultyng/skill-issue · 44 tokens