git-under-contention

git-under-contention is a skill for Claude Code, Codex from TAKEOFF69/codex-skills-kit. It costs 71 tokens per session (960 once invoked), scanned A, original, MIT.

A set of rules for using Git safely when several people or AI agents may change the same repository, checkout, branch, or worktree.

In plain words
What is it for?
Use it before committing, pushing, merging, rebasing, creating worktrees, or recovering changes in a shared repository.
Why use it?
It helps prevent accidental staging, overwriting, or committing of someone else’s unfinished work.

Skill for Claude CodeCodex

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 skills/takeoff69/codex-skills-kit/git-under-contention
Any agent
npx skills add TAKEOFF69/codex-skills-kit --skill git-under-contention
Clone the repo
git clone --depth 1 https://github.com/TAKEOFF69/codex-skills-kit

Made for: Claude Code, Codex.

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-under-contention

README.md
[![agentmods](https://agentmods.dev/badge/skills/takeoff69/codex-skills-kit/git-under-contention.svg)](https://agentmods.dev/skills/takeoff69/codex-skills-kit/git-under-contention)
Your own site
<a href="https://agentmods.dev/skills/takeoff69/codex-skills-kit/git-under-contention"><img src="https://agentmods.dev/badge/skills/takeoff69/codex-skills-kit/git-under-contention.svg" alt="Measured on agentmods" height="20"></a>
Per session 71 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 960 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.00071 $0.00960
Opus 5 $0.00036 $0.00480
Sonnet 5 $0.00014 $0.00192
Haiku 4.5 $0.00007 $0.00096

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

Security

Grade A, and why

git-under-contention 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 4d ago.

The scan reads SKILL.md. This mod also ships 1 executable file (scripts/contention_preflight.py), listed below but not scanned — reading those needs a real analyzer, not pattern matching.

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.

skills/git-under-contention/SKILL.md · 103 lines

How it starts

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

Git Under Contention

Preserve every participant's work when repository state may change concurrently.

Core rule

Treat shared checkout as contested state. Stage exact paths, commit only owned changes, and leave unfamiliar hunks untouched.

Preflight

Run bundled detector before first commit in shared checkout:

python <skill-dir>/scripts/contention_preflight.py
python <skill-dir>/scripts/contention_preflight.py --mine path/owned-by-task

Signals include registered worktrees, recent HEAD movement, pre-staged files, and dirty paths outside owned pathspecs. CONTENTION is not automatic failure – it means use isolated worktree or stricter path ownership.

Skip detector only inside isolated worktree created for current task and still run normal status checks.

Shared-checkout rules

  • Inspect git status --porcelain, current branch, top-level path, and staged diff before mutation.
  • Stage with git add <path>...; avoid git add ., git add -A, and git commit -a.
  • Review git diff --cached --name-only and git diff --cached before commit.
  • Commit with explicit pathspec when repository conventions allow it.
  • Leave changes outside owned paths unchanged, staged or unstaged.
  • Avoid stash in contested checkout because stash captures shared state. Use task worktree or WIP commit on owned branch.
  • Fetch before deciding branch freshness; do not reset shared checkout to match remote.
  • Push durable work promptly so recovery does not depend on one disk.

Worktree lifecycle

Prefer worktree per task when work is multi-file, long-running, risky, or parallel.

  1. Fetch remote and create short-lived branch from intended base.
  2. Create worktree at explicit validated path.
  3. Record absolute root, branch, and base commit in handoff.
  4. Edit, stage exact paths, commit, and push as one durable sequence.
  5. Recheck dirty state and unpushed commits before cleanup.
  6. Remove worktree only through repository helper when one exists.

Before recursive worktree cleanup, inspect symlinks, junctions, mounts, and dependency links. Remove links safely before recursive deletion so cleanup cannot traverse into another checkout.

Read the full file on GitHub · 103 lines

Files

What ships with it

2 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. 4d ago First seen · 103 lines · 71 tokens per session scan A f9fda51dd749

Subscribe to this mod's changes

git-under-contention is a skill published in the GitHub repository TAKEOFF69/codex-skills-kit (7 stars, last pushed 1mo ago), licensed MIT. It adds 71 tokens to every session and 960 once invoked, about $0.0004 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.

Related

Other skills, from other repositories

manage-codex-skills

Inventory, classify, route, catalog, relocate, or validate Codex skills and generate a skills menu. Use for skill-library organization or when Codex must find task-relevant skills. Classification, relocation, creation, revision, and promotion require user approval.

WildPigKing/codex-project-skill-manager · 58 tokens

reflect-codex-workflows

Compare evidence from a current or completed project with installed skills and decide whether to reuse, revise, create, or not skill the lesson. Use for workflow reflection or proposed skill upgrades. Do not edit skills without explicit authorization.

WildPigKing/codex-project-skill-manager · 51 tokens

bootstrap-codex-workspace

Inspect a Windows or macOS Codex environment and produce a read-only, approval-bound plan for the global AGENTS.md path, user skills root, and root for future projects. Use for workspace setup, bootstrap, or location planning. Do not write outside the repository until the user approves the exact plan ID.

WildPigKing/codex-project-skill-manager · 69 tokens

maintain-project-ai-records

Initialize and maintain lightweight AI work records in a writable project. Use on the first substantive writable task and after meaningful milestones. Do not create records for read-only inspection or trivial answers.

WildPigKing/codex-project-skill-manager · 43 tokens

organize-codex-projects

Choose a location and internal structure for a future Codex project, including focused projects and umbrella projects with durable subprojects. Use when creating or planning a new project. Do not move, rename, or normalize existing projects.

WildPigKing/codex-project-skill-manager · 52 tokens

eco-max

Maximum-savings variant of eco - the same frugality rules with a tighter reply budget, for routine chores (rename, small fix, quick lookup, boilerplate). Prefer plain eco for hard or high-stakes work. Works in any language.

sup3x/codex-eco · 53 tokens